diff -u -Naur emacs-21.2/confdefs.h emacs-f/confdefs.h
--- emacs-21.2/confdefs.h	Wed Dec 31 19:00:00 1969
+++ emacs-f/confdefs.h	Thu Oct 10 11:01:22 2002
@@ -0,0 +1,2 @@
+
+#define MAIL_USE_POP 1
diff -u -Naur emacs-21.2/config.log emacs-f/config.log
--- emacs-21.2/config.log	Wed Dec 31 19:00:00 1969
+++ emacs-f/config.log	Thu Oct 10 11:01:22 2002
@@ -0,0 +1,4 @@
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+configure:759: checking host system type
diff -u -Naur emacs-21.2/configure emacs-f/configure
--- emacs-21.2/configure	Fri Mar 15 07:46:09 2002
+++ emacs-f/configure	Thu Oct 10 11:01:22 2002
@@ -555,8 +555,8 @@
 
 
 lispdir='${datadir}/emacs/${version}/lisp'
-locallisppath='${datadir}/emacs/${version}/site-lisp:'\
-'${datadir}/emacs/site-lisp:${datadir}/emacs/${version}/leim'
+locallisppath='@PREFIX@/etc/emacs21:@PREFIX@/etc/emacs:@PREFIX@/etc/lisp/emacs/21.2/site-lisp:'\
+'@PREFIX@/etc/lisp/emacs/site-lisp:${datadir}/emacs/${version}/site-lisp:${datadir}/emacs/site-lisp:${datadir}/emacs/${version}/leim'
 lisppath='${locallisppath}:${lispdir}'
 etcdir='${datadir}/emacs/${version}/etc'
 archlibdir='${libexecdir}/emacs/${version}/${configuration}'
@@ -1172,6 +1172,24 @@
   ;;
   hppa*-*-nextstep* )
     machine=hp800 opsys=nextstep
+  ;;
+
+  ## Mac OS X Server
+  *-*-rhapsody*)
+    opsys=rhapsody
+    case "${canonical}" in
+      powerpc-*-rhapsody*) machine=powermacintosh ;;
+      i386-*-rhapsody*)    machine=intel386 ;;
+    esac
+  ;;
+
+  ## Darwin / Mac OS X
+  *-*-darwin*)
+    opsys=darwin
+    case "${canonical}" in
+      powerpc-*-darwin*) machine=powermacintosh ;;
+      i?86-*-darwin*)    machine=intel386 ;;
+    esac
   ;;
 
   ## Orion machines
diff -u -Naur emacs-21.2/configure.in emacs-f/configure.in
--- emacs-21.2/configure.in	Fri Mar 15 07:44:20 2002
+++ emacs-f/configure.in	Thu Oct 10 11:01:23 2002
@@ -28,8 +28,9 @@
 AC_CONFIG_HEADER(src/config.h:src/config.in)
 
 lispdir='${datadir}/emacs/${version}/lisp'
-locallisppath='${datadir}/emacs/${version}/site-lisp:'\
-'${datadir}/emacs/site-lisp:${datadir}/emacs/${version}/leim'
+
+locallisppath='@PREFIX@/etc/emacs21:@PREFIX@/etc/emacs:@PREFIX@/etc/lisp/emacs/21.2/site-lisp:'\
+'@PREFIX@/etc/lisp/emacs/site-lisp:${datadir}/emacs/${version}/site-lisp:${datadir}/emacs/site-lisp:${datadir}/emacs/${version}/leim'
 lisppath='${locallisppath}:${lispdir}'
 etcdir='${datadir}/emacs/${version}/etc'
 archlibdir='${libexecdir}/emacs/${version}/${configuration}'
@@ -546,6 +547,24 @@
   ;;
   hppa*-*-nextstep* )
     machine=hp800 opsys=nextstep
+  ;;
+
+  ## Mac OS X Server
+  *-*-rhapsody*)
+    opsys=rhapsody
+    case "${canonical}" in
+      powerpc-*-rhapsody*) machine=powermacintosh ;;
+      i386-*-rhapsody*)    machine=intel386 ;;
+    esac
+  ;;
+
+  ## Darwin / Mac OS X
+  *-*-darwin*)
+    opsys=darwin
+    case "${canonical}" in
+      powerpc-*-darwin*) machine=powermacintosh ;;
+      i?86-*-darwin*)    machine=intel386 ;;
+    esac
   ;;
 
   ## Orion machines
diff -u -Naur emacs-21.2/fix-info emacs-f/fix-info
--- emacs-21.2/fix-info	Wed Dec 31 19:00:00 1969
+++ emacs-f/fix-info	Thu Oct 10 11:01:23 2002
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+THE_INFO_PREFIX=$1
+
+for file in ada-mode autotype ccmode cl dired-x ebrowse ediff efaq \
+            emacs emacs-mime eshell eudc forms gnus idlwave info message mh-e \
+            pcl-cvs reftex sc speedbar vip viper widget woman
+do
+    ./mangle-info ${THE_INFO_PREFIX}/${file}
+done
diff -u -Naur emacs-21.2/lisp/startup.el emacs-f/lisp/startup.el
--- emacs-21.2/lisp/startup.el	Thu Nov  1 08:10:34 2001
+++ emacs-f/lisp/startup.el	Thu Oct 10 11:01:23 2002
@@ -339,6 +339,10 @@
 
 (defvar normal-top-level-add-subdirs-inode-list nil)
 
+(defconst fink-emacs-flavor 'emacs21
+  "A symbol representing the particular fink flavor of emacs running.
+Something like 'emacs20, 'xemacs20, etc.")
+
 (defun normal-top-level-add-subdirs-to-load-path ()
   "Add all subdirectories of current directory to `load-path'.
 More precisely, this uses only the subdirectories whose names
@@ -848,8 +852,20 @@
     ;; Run the site-start library if it exists.  The point of this file is
     ;; that it is run before .emacs.  There is no point in doing this after
     ;; .emacs; that is useless.
-    (if site-run-file 
-	(load site-run-file t t))
+
+    ;; (if site-run-file                                                       
+    ;;     (load site-run-file t t))                                           
+                                                                               
+    ;; Fink version of site-start.                                           
+    (if site-run-file                                                          
+        (progn                                                                 
+          ;; Load all the fink package snippets.                             
+          ;; It's in here because we want -q to kill it too.                   
+          (if (load "fink-startup" t t nil)                                  
+              (fink-startup fink-emacs-flavor))                            
+          ;; Now the normal site file...                                       
+          (load site-run-file t t nil)))                                       
+
 
     ;; Sites should not disable this.  Only individuals should disable
     ;; the startup message.
diff -u -Naur emacs-21.2/lisp/startup.elc emacs-f/lisp/startup.elc
--- emacs-21.2/lisp/startup.elc	Fri Jan 11 03:29:37 2002
+++ emacs-f/lisp/startup.elc	Thu Oct 10 11:01:23 2002
@@ -1,7 +1,7 @@
 ;ELC
-;;; Compiled by eliz@fencepost.gnu.org on Fri Jan 11 03:29:37 2002
-;;; from file /home/fsf/eliz/emacs-pretest/emacs/lisp/startup.el
-;;; in Emacs version 21.1.30
+;;; Compiled by cds@moth.ccs.brandeis.edu on Wed May 29 18:47:44 2002
+;;; from file /Users/cds/Desktop/emacs-21.2.fink/lisp/startup.el
+;;; in Emacs version 21.2.1
 ;;; with bytecomp version 2.85
 ;;; with all optimizations.
 
@@ -17,12 +17,12 @@
 
 (byte-code "\301\302\207" [top-level (normal-top-level) nil] 1)
 #@46 Non-nil once command line has been processed
-(defvar command-line-processed nil (#$ . 685))
+(defvar command-line-processed nil (#$ . 687))
 (custom-declare-group 'initialization nil "Emacs start-up procedure" :group 'internal)
 #@156 *Non-nil inhibits the initial startup message.
 This is for use in your personal init file, once you are familiar
 with the contents of the startup message.
-(custom-declare-variable 'inhibit-startup-message 'nil '(#$ . -871) :type 'boolean :group 'initialization)
+(custom-declare-variable 'inhibit-startup-message 'nil '(#$ . -873) :type 'boolean :group 'initialization)
 #@518 *Non-nil inhibits the initial startup echo area message.
 Setting this variable takes effect
 only if you do it with the customization buffer
@@ -32,26 +32,26 @@
  (eval '(setq inhibit-startup-echo-area-message "YOUR-USER-NAME"))
 Thus, someone else using a copy of your `.emacs' file will see
 the startup message unless he personally acts to inhibit it.
-(custom-declare-variable 'inhibit-startup-echo-area-message 'nil '(#$ . -1140) :type '(choice (const :tag "Don't inhibit") (string :tag "Enter your user name, to inhibit")) :group 'initialization)
+(custom-declare-variable 'inhibit-startup-echo-area-message 'nil '(#$ . -1142) :type '(choice (const :tag "Don't inhibit") (string :tag "Enter your user name, to inhibit")) :group 'initialization)
 #@50 *Non-nil inhibits loading the `default' library.
-(custom-declare-variable 'inhibit-default-init 'nil '(#$ . -1860) :type 'boolean :group 'initialization)
+(custom-declare-variable 'inhibit-default-init 'nil '(#$ . -1862) :type 'boolean :group 'initialization)
 #@213 Alist of command-line switches.
 Elements look like (SWITCH-STRING . HANDLER-FUNCTION).
 HANDLER-FUNCTION receives switch name as sole arg;
 remaining command-line args are in the variable `command-line-args-left'.
-(defvar command-switch-alist nil (#$ . 2021))
+(defvar command-switch-alist nil (#$ . 2023))
 #@46 List of command-line args not yet processed.
-(defvar command-line-args-left nil (#$ . 2285))
+(defvar command-line-args-left nil (#$ . 2287))
 #@398 List of functions to process unrecognized command-line arguments.
 Each function should access the dynamically bound variables
 `argi' (the current argument) and `command-line-args-left' (the remaining
 arguments).  The function should return non-nil only if it recognizes and
 processes `argi'.  If it does so, it may consume successive arguments by
 altering `command-line-args-left' to remove them.
-(defvar command-line-functions nil (#$ . 2385))
+(defvar command-line-functions nil (#$ . 2387))
 #@122 Default directory to use for command line arguments.
 This is normally copied from `default-directory' when Emacs starts.
-(defvar command-line-default-directory nil (#$ . 2837))
+(defvar command-line-default-directory nil (#$ . 2839))
 #@446 Alist of X Windows options.
 Each element has the form
   (NAME NUMARGS HANDLER FRAME-PARAM VALUE)
@@ -60,32 +60,32 @@
 FRAME-PARAM (optional) is the frame parameter this option specifies,
 and VALUE is the value which is given to that frame parameter
 (most options use the argument for this, so VALUE is not present).
-(defconst command-line-x-option-alist '(("-bw" 1 x-handle-numeric-switch border-width) ("-d" 1 x-handle-display) ("-display" 1 x-handle-display) ("-name" 1 x-handle-name-switch) ("-title" 1 x-handle-switch title) ("-T" 1 x-handle-switch title) ("-r" 0 x-handle-switch reverse t) ("-rv" 0 x-handle-switch reverse t) ("-reverse" 0 x-handle-switch reverse t) ("-reverse-video" 0 x-handle-switch reverse t) ("-fn" 1 x-handle-switch font) ("-font" 1 x-handle-switch font) ("-ib" 1 x-handle-numeric-switch internal-border-width) ("-g" 1 x-handle-geometry) ("-lsp" 1 x-handle-numeric-switch line-spacing) ("-geometry" 1 x-handle-geometry) ("-fg" 1 x-handle-switch foreground-color) ("-foreground" 1 x-handle-switch foreground-color) ("-bg" 1 x-handle-switch background-color) ("-background" 1 x-handle-switch background-color) ("-ms" 1 x-handle-switch mouse-color) ("-itype" 0 x-handle-switch icon-type t) ("-i" 0 x-handle-switch icon-type t) ("-iconic" 0 x-handle-iconic) ("-xrm" 1 x-handle-xrm-switch) ("-cr" 1 x-handle-switch cursor-color) ("-vb" 0 x-handle-switch vertical-scroll-bars t) ("-hb" 0 x-handle-switch horizontal-scroll-bars t) ("-bd" 1 x-handle-switch) ("--border-width" 1 x-handle-numeric-switch border-width) ("--display" 1 x-handle-display) ("--name" 1 x-handle-name-switch) ("--title" 1 x-handle-switch title) ("--reverse-video" 0 x-handle-switch reverse t) ("--font" 1 x-handle-switch font) ("--internal-border" 1 x-handle-numeric-switch internal-border-width) ("--geometry" 1 x-handle-geometry) ("--foreground-color" 1 x-handle-switch foreground-color) ("--background-color" 1 x-handle-switch background-color) ("--mouse-color" 1 x-handle-switch mouse-color) ("--icon-type" 0 x-handle-switch icon-type t) ("--iconic" 0 x-handle-iconic) ("--xrm" 1 x-handle-xrm-switch) ("--cursor-color" 1 x-handle-switch cursor-color) ("--vertical-scroll-bars" 0 x-handle-switch vertical-scroll-bars t) ("--line-spacing" 1 x-handle-numeric-switch line-spacing) ("--border-color" 1 x-handle-switch border-width)) (#$ . 3021))
+(defconst command-line-x-option-alist '(("-bw" 1 x-handle-numeric-switch border-width) ("-d" 1 x-handle-display) ("-display" 1 x-handle-display) ("-name" 1 x-handle-name-switch) ("-title" 1 x-handle-switch title) ("-T" 1 x-handle-switch title) ("-r" 0 x-handle-switch reverse t) ("-rv" 0 x-handle-switch reverse t) ("-reverse" 0 x-handle-switch reverse t) ("-reverse-video" 0 x-handle-switch reverse t) ("-fn" 1 x-handle-switch font) ("-font" 1 x-handle-switch font) ("-ib" 1 x-handle-numeric-switch internal-border-width) ("-g" 1 x-handle-geometry) ("-lsp" 1 x-handle-numeric-switch line-spacing) ("-geometry" 1 x-handle-geometry) ("-fg" 1 x-handle-switch foreground-color) ("-foreground" 1 x-handle-switch foreground-color) ("-bg" 1 x-handle-switch background-color) ("-background" 1 x-handle-switch background-color) ("-ms" 1 x-handle-switch mouse-color) ("-itype" 0 x-handle-switch icon-type t) ("-i" 0 x-handle-switch icon-type t) ("-iconic" 0 x-handle-iconic) ("-xrm" 1 x-handle-xrm-switch) ("-cr" 1 x-handle-switch cursor-color) ("-vb" 0 x-handle-switch vertical-scroll-bars t) ("-hb" 0 x-handle-switch horizontal-scroll-bars t) ("-bd" 1 x-handle-switch) ("--border-width" 1 x-handle-numeric-switch border-width) ("--display" 1 x-handle-display) ("--name" 1 x-handle-name-switch) ("--title" 1 x-handle-switch title) ("--reverse-video" 0 x-handle-switch reverse t) ("--font" 1 x-handle-switch font) ("--internal-border" 1 x-handle-numeric-switch internal-border-width) ("--geometry" 1 x-handle-geometry) ("--foreground-color" 1 x-handle-switch foreground-color) ("--background-color" 1 x-handle-switch background-color) ("--mouse-color" 1 x-handle-switch mouse-color) ("--icon-type" 0 x-handle-switch icon-type t) ("--iconic" 0 x-handle-iconic) ("--xrm" 1 x-handle-xrm-switch) ("--cursor-color" 1 x-handle-switch cursor-color) ("--vertical-scroll-bars" 0 x-handle-switch vertical-scroll-bars t) ("--line-spacing" 1 x-handle-numeric-switch line-spacing) ("--border-color" 1 x-handle-switch border-width)) (#$ . 3023))
 #@78 Normal hook run after handling urgent options but before loading init files.
-(defvar before-init-hook nil (#$ . 5495))
+(defvar before-init-hook nil (#$ . 5497))
 #@265 Normal hook run after loading the init files, `~/.emacs' and `default.el'.
 There is no `condition-case' around the running of these functions;
 therefore, if you set `debug-on-error' non-nil in `.emacs',
 an error in one of these functions will invoke the debugger.
-(defvar after-init-hook nil (#$ . 5621))
+(defvar after-init-hook nil (#$ . 5623))
 #@73 Normal hook run after loading init files and handling the command line.
-(defvar emacs-startup-hook nil (#$ . 5932))
+(defvar emacs-startup-hook nil (#$ . 5934))
 #@243 Normal hook run after loading terminal-specific Lisp code.
 It also follows `emacs-startup-hook'.  This hook exists for users to set,
 so as to override the definitions made by the terminal-specific file.
 Emacs never sets this variable itself.
-(defvar term-setup-hook nil (#$ . 6055))
+(defvar term-setup-hook nil (#$ . 6057))
 #@192 The brand of keyboard you are using.
 This variable is used to define
 the proper function and keypad keys for use under X.  It is used in a
 fashion analogous to the environment variable TERM.
-(defvar keyboard-type nil (#$ . 6345))
+(defvar keyboard-type nil (#$ . 6347))
 #@153 Normal hook run to initialize window system display.
 Emacs runs this hook after processing the command line arguments and loading
 the user's init file.
-(defvar window-setup-hook nil (#$ . 6582))
+(defvar window-setup-hook nil (#$ . 6584))
 #@68 Major mode command symbol to use for the initial *scratch* buffer.
-(custom-declare-variable 'initial-major-mode ''lisp-interaction-mode '(#$ . 6783) :type 'function :group 'initialization)
+(custom-declare-variable 'initial-major-mode ''lisp-interaction-mode '(#$ . 6785) :type 'function :group 'initialization)
 #@622 Identity of user whose `.emacs' file is or was read.
 The value is nil if `-q' or `--no-init-file' was specified,
 meaning do not load any init file.
@@ -100,7 +100,7 @@
 
 Setting `init-file-user' does not prevent Emacs from loading
 `site-start.el'.  The only way to do that is to use `--no-site-file'.
-(custom-declare-variable 'init-file-user 'nil '(#$ . 6979) :type '(choice (const :tag "none" nil) string) :group 'initialization)
+(custom-declare-variable 'init-file-user 'nil '(#$ . 6981) :type '(choice (const :tag "none" nil) string) :group 'initialization)
 #@745 File containing site-wide run-time initializations.
 This file is loaded at run-time before `~/.emacs'.  It contains inits
 that need to be in place for the entire site, but which, due to their
@@ -114,13 +114,13 @@
 option or by setting `inhibit-default-init' in their own init files,
 but inhibiting `site-start.el' requires `--no-site-file', which
 is less convenient.
-(custom-declare-variable 'site-run-file '"site-start" '(#$ . 7737) :type '(choice (const :tag "none" nil) string) :group 'initialization)
+(custom-declare-variable 'site-run-file '"site-start" '(#$ . 7739) :type '(choice (const :tag "none" nil) string) :group 'initialization)
 #@54 *Name of this machine, for purposes of naming users.
-(custom-declare-variable 'mail-host-address 'nil '(#$ . -8625) :type '(choice (const nil) string) :group 'mail)
+(custom-declare-variable 'mail-host-address 'nil '(#$ . -8627) :type '(choice (const nil) string) :group 'mail)
 #@154 *Full mailing address of this user.
 This is initialized based on `mail-host-address',
 after your init file is read, in case it sets `mail-host-address'.
-(custom-declare-variable 'user-mail-address 'nil '(#$ . -8797) :type 'string :group 'mail)
+(custom-declare-variable 'user-mail-address 'nil '(#$ . -8799) :type 'string :group 'mail)
 #@396 Prefix for generating `auto-save-list-file-name'.
 This is used after reading your `.emacs' file to initialize
 `auto-save-list-file-name', by appending Emacs's pid and the system name,
@@ -128,58 +128,61 @@
 Directories in the prefix will be created if necessary.
 Set this to nil if you want to prevent `auto-save-list-file-name'
 from being initialized.
-(custom-declare-variable 'auto-save-list-file-prefix '(cond ((eq system-type 'ms-dos) "~/_emacs.d/auto-save.list/_s") (t "~/.emacs.d/auto-save-list/.saves-")) '(#$ . 9048) :type '(choice (const :tag "Don't record a session's auto save list" nil) string) :group 'auto-save)
+(custom-declare-variable 'auto-save-list-file-prefix '(cond ((eq system-type 'ms-dos) "~/_emacs.d/auto-save.list/_s") (t "~/.emacs.d/auto-save-list/.saves-")) '(#$ . 9050) :type '(choice (const :tag "Don't record a session's auto save list" nil) string) :group 'auto-save)
 (byte-code "\301B\304\301!\204\f\305\302B\304\302!\204\305\303B\304\303!\204$\305\305\207" [current-load-list init-file-debug init-file-had-error normal-top-level-add-subdirs-inode-list boundp nil] 2)
+#@109 A symbol representing the particular fink flavor of emacs running.
+Something like 'emacs20, 'xemacs20, etc.
+(defconst fink-emacs-flavor 'emacs21 (#$ . 9939))
 #@265 Add all subdirectories of current directory to `load-path'.
 More precisely, this uses only the subdirectories whose names
 start with letters or digits; it excludes any subdirectory named `RCS'
 or `CVS', and any subdirectory that contains a file named `.nosearch'.
-(defalias 'normal-top-level-add-subdirs-to-load-path #[nil "\306\211C	\203\203	@B	A@\307\f!\f\310=\205&\311\f!\211\2061\312\313\f!\233\211\235\204\nB
\203
@\314\235\204x\315\316
@\"\203x\315\317
@\"\204x\320
@!\203x\321
@!\322\321\323\"!\204w	C\244)
A\211\204C,\202\324\237A!+\207" [default-directory pending attrs dirs this-dir contents nil directory-files windows-nt untranslated-canonical-name 10 file-attributes ("." ".." "RCS" "CVS" "rcs" "cvs") string-match "\\`[[:alnum:]]" "\\.elc?\\'" file-directory-p expand-file-name file-exists-p ".nosearch" normal-top-level-add-to-load-path system-type canonicalized normal-top-level-add-subdirs-inode-list expanded] 5 (#$ . 9937)])
+(defalias 'normal-top-level-add-subdirs-to-load-path #[nil "\306\211C	\203\203	@B	A@\307\f!\f\310=\205&\311\f!\211\2061\312\313\f!\233\211\235\204\nB
\203
@\314\235\204x\315\316
@\"\203x\315\317
@\"\204x\320
@!\203x\321
@!\322\321\323\"!\204w	C\244)
A\211\204C,\202\324\237A!+\207" [default-directory pending attrs dirs this-dir contents nil directory-files windows-nt untranslated-canonical-name 10 file-attributes ("." ".." "RCS" "CVS" "rcs" "cvs") string-match "\\`[[:alnum:]]" "\\.elc?\\'" file-directory-p expand-file-name file-exists-p ".nosearch" normal-top-level-add-to-load-path system-type canonicalized normal-top-level-add-subdirs-inode-list expanded] 5 (#$ . 10104)])
 (defalias 'normal-top-level-add-to-load-path #[(dirs) "\306	!\211\203,A\203,\n@\232\204,\f\307>\203%\n\227@\227\232\204,A\211\204\n\205:\310\311\312
\"A\"\241*\207" [load-path default-directory thisdir tail system-type dirs directory-file-name (ms-dos windows-nt) append mapcar expand-file-name] 6])
 (defalias 'normal-top-level #[nil "\203\306\307!\207\310	\212\311\312!q\210\n*\313 \314\232\203\310\f\315\211\203@@
B\315\316\315\217\210\315\317\315\217\210A\211\204'*\320=\204p\321\322!\211;\203o\323\324!\325P!\323\324	!\325P!\232\204o\326\327P\")\330	!\315\331\216\332 *\207" [command-line-processed default-directory dir backup-by-copying-when-mismatch load-path new message "Back to top level." t get-buffer "*Messages*" user-uid 0 nil (byte-code "@\302\303\304@\"\305\211\211$\210)\302\207" [tail default-directory load expand-file-name "subdirs.el" t] 5) (byte-code "@\302\303\304@\"\305\211\211$\210)\302\207" [tail default-directory load expand-file-name "leim-list.el" t] 5) vax-vms getenv "PWD" file-attributes file-name-as-directory "." delete "PWD=" abbreviate-file-name ((byte-code "\306!	\204.\n\203.\307=\203#\310\311\n!\312\"\210\313\314\n!!\315P\202-\314\316\317\n\320 \321 $!\322\323!\210\f\203:\322\304!\210
\204O'\203O(\204O'\324=\203\245\325\326!\203X\326 \210\325\327!\203\245)\330 \331*+)'\204\237)\204\237\332+\333\"\204\237\332+\334\"\211,?\206\213,\335\235)\203\237\336\337!*\340\341*\"\203\237\342)\327\330 !\210+\325\343!\203\256\343 \210$\203\267\322\344!\210-\204\304\345 \203\304\346 \210\331\207" [default-directory auto-save-list-file-name auto-save-list-file-prefix system-type term-setup-hook frame-initial-frame abbreviate-file-name ms-dos make-directory file-name-directory t make-temp-name expand-file-name "~" format "%s%d-%s~" emacs-pid system-name run-hooks emacs-startup-hook pc fboundp frame-notice-user-settings frame-set-background-mode selected-frame nil frame-parameter reverse background-color (unspecified "unspecified-bg") getenv "TERM" string-match "^\\(xterm\\|rxvt\\|dtterm\\|eterm\\)" light font-menu-add-default window-setup-hook display-popup-menus-p precompute-menubar-bindings window-system noninteractive frame-background-mode term frame bg menubar-bindings-done] 7)) command-line tail system-type pwd process-environment menubar-bindings-done] 5])
 (defalias 'precompute-menubar-bindings #[nil "\304\305\"\211\203=	@:\2036	@@9\2036	@A\242;\2036\306	@AA!\2036\307\310	@AA\"\210\n\2036\311 \210	A\211\204	)\312\211\207" [global-map submap purify-flag define-key-rebound-commands lookup-key [menu-bar] keymapp x-popup-menu nil garbage-collect t] 4])
 (byte-code "\301B\302\301\207" [current-load-list tty-long-option-alist (("--name" . "-name") ("--title" . "-T") ("--reverse-video" . "-reverse") ("--foreground-color" . "-fg") ("--background-color" . "-bg"))] 2)
 #@45 Height in pixels of images in the tool bar.
-(defconst tool-bar-images-pixel-height 24 (#$ . 13873))
+(defconst tool-bar-images-pixel-height 24 (#$ . 14041))
 #@76 Non-nil if tool-bars are present before user and site init files are read.
-(defvar tool-bar-originally-present nil (#$ . 13979))
+(defvar tool-bar-originally-present nil (#$ . 14147))
 (defalias 'tty-handle-args #[(args) "\306\307\310	\"\210	\203	@\311\232\204	@\211\306\306	A\312\313\n\"\2032\n\314\225\306O\n\314\211\225SO\312\315\n\"\203p\316\n#\"\211\317=\203O\320\n#\"A\202p\f;\203l\320\f#\"\211$\204d\321\322\n\"\210$A)\202p\306\n\323\230\204|\n\324\230\203\221
\204\206	@	A\325
B%B%\202\n\326\230\204\235\n\327\230\203\262
\204\247	@	A\330
B%B%\202\n\331\230\204\276\n\332\230\203\371
\204\310	@	A\333
;\203\322
\202\360\317\306&'\334 \312\335
\"\211&\203\356
&\336I\210\202\333
*B%B%\202\n\337\230\204\n\340\230\204\n\341\230\203\342%B%\202\nB,\202\237)\207" [rest args this orig-this completion argval nil message "%s" "--" string-match "^--[^=]*=" 0 "^--" try-completion t assoc error "Option `%s' is ambiguous" "-fg" "-foreground" foreground-color "-bg" "-background" background-color "-T" "-name" title invocation-name "[.*]" 45 "-r" "-rv" "-reverse" (reverse . t) tty-long-option-alist elt default-frame-alist i case-fold-search] 5])
-(defalias 'command-line #[nil "\306\n\307>\203\310\311!\206N\310\312!\206N\310\313!\206N\314\202N\n\315>\203;\310\312!\206N\310\313!\206N\310\311!\206N\316\202N\310\312!\206N\310\313!\206N\310\311!\206N\317!\n\320=\205Y\310\312!\310\321!\211\322=\204\227
\323\230\204p
\324\230\203v\325@\202\227
\326\230\204\202
\327\230\203\210\322@\202\227
\330\230\204\224
\331\230\203\227\332@)\n\333>\203\247\334A\335B\202\255\336C\335B\337\340\341\217\210\342 \204\302D\204\302\343E!E\344\322!\210\322EAFGD?\205\326\345 \211H\203\347H\346 \230\203\347\347HG\204F\203\350F@\322IJK\351\352J\"\203\351\353J\"\203J\354\225\322OIJ\354\211\224OJJ\355\232\204c\356JK\"\211L\325=\203;J\357\322OJ\202bL;\203_\360LK\"\211M\204S\337\361J\"\210M@\357\322OJ)\202b\322I)J\362\230\204qJ\363\230\203|\322HFAF\202J\364\230\204\212J\365\230\203\247I\204\230FA\211F@IIH\322IFAF\202J\366\230\203\271\322NFAF\202J\367\230\203\313\325OFAF\202J\370\230\203\340\371PBPFAF\202J\372\230\204\365J\373\230\204\365J\374\230\203\375QBQFAF\202\325GI\203\337\376J\"\210+\202\347E\203 EF\241\210*\377\201r!\203.\201r \210D\204PR\201s>\203J\201t\201u \236A\354V\203P\201v\325!\210D\204m\342 \203m\201w\322\201Z\"\354V\203m\201x\357!\210D\204\220\n\320=\204\220R\201y>\203\220\201z\201{\325\"\210\201|\357!\210D\204\322\n\201}>\204\303R\201~>\203\265\377\201!\203\265\201 \204\303R\204\322S\201\200=\203\322\201z\201\201\325\"\210\201\202\357!\210D\204\363\342 \203\363\377\201\203!\203\363\201z\201\204\325\"\210\201\204\357!\210R\201\205>\204U\201\206 \203UR\201\207=\203T\202 \n\201\210=\203U\202 V\211W@XW\203O\201\211X@X\211YA@)X\211YAA)#\210WA\211W@X\202&\201\212 \210*\377\201\213!\203\203\201ZP\236\206l\201ZQ\236\211Z?\206ZA?\206ZA\354=?[)\\]^_`a\201\214\201\215!\210N\203\245\201\216N\325\211#\210\322b\322\211O\325=\203\267\201\217\202\271Ocdefge\201\220hiO\203\330h \210\202\341\337\201\221\201\222\217\210ie=\204\360\325fig*f\203\372gic\204dc=\204\201\223\201\224\201\225 \"\210\201\226j!\210,k\2041\345 \201\227l\206.\201\230 Qk\\a=\203I]`=\203I^_=\204N\201\212 \210+\201\214\201\231!\210\201\232\201\233!\203u\212\201\233q\210m\201\234=\203tn \210)o\203\301D\204\301R\204\301\310\201\235!\322p\211q\203\300\201\216oqP\325\211#\204\300\351\201\236q\"\211p\203\271q\354pO\211q\202\217\322\211q\204\222*\201\237EA!\210D\205\323\201\240\325!\207" [default-directory command-line-default-directory system-type temporary-file-directory small-temporary-file-directory vc file-name-as-directory (ms-dos windows-nt) getenv "TEMP" "TMPDIR" "TMP" "c:/temp" (vax-vms axp-vms) "SYS$SCRATCH:" "/tmp" ms-dos "VERSION_CONTROL" nil "t" "numbered" t "nil" "existing" "never" "simple" never (ms-dos windows-nt emx) "(Unix)" "(Mac)" "(DOS)" error (byte-code "\203	\204\303\n\304!\305Q\306\307#\210\306\207" [window-system noninteractive term-file-prefix load symbol-name "-win" nil t] 4) ((error (byte-code "\302@\300=\203\303\304A\"\2026\305@\306N>\203)\307\310A@\311\312AA\313##\2026\307\310@\314N\311\315A\313##\316\"\210\317\316!\210\320\321 \207" [error window-system princ apply concat file-error error-conditions format "%s: %s" mapconcat #[(obj) "\301\302\"\207" [obj prin1-to-string t] 3] ", " error-message #[(obj) "\301\302\"\207" [obj prin1-to-string t] 3] external-debugging-output terpri nil kill-emacs] 8))) display-graphic-p tty-handle-args set-locale-environment user-login-name user-real-login-name "" (("--no-init-file") ("--no-site-file") ("--user") ("--debug-init") ("--iconic") ("--icon-type")) string-match "\\`--" "=" 0 "--" try-completion 1 assoc "Option `%s' is ambiguous" "-q" "-no-init-file" "-u" "-user" "-no-site-file" "-debug-init" "-iconic" (visibility . icon) "-icon-type" "-i" "-itype" (icon-type . t) "Option `%s' doesn't allow an argument" fboundp version-control eol-mnemonic-unix eol-mnemonic-mac eol-mnemonic-dos noninteractive command-line-args args done init-file-user argval argi longopts completion elt site-run-file init-file-debug initial-frame-alist default-frame-alist window-system tty-erase-char msdos-color-values w32-tty-standard-colors tty-standard-colors colors color x tool-bar-lines tool-bar-originally-present scalable-fonts-allowed font-list-limit face-ignored-fonts old-face-ignored-fonts old-font-list-limit old-scalable-fonts-allowed inhibit-startup-message default-enable-multibyte-characters orig-enable-multibyte debug-on-error-initial debug-on-error-should-be-set debug-on-error-from-init-file inner debug-on-error current-language-environment user-mail-address mail-host-address major-mode initial-major-mode term-file-prefix hyphend term frame-initialize (x w32) menu-bar-lines frame-parameters menu-bar-mode frame-parameter tool-bar-mode (x w32) set-default blink-cursor blink-cursor-mode (ms-dos windows-nt) (x) x-backspace-delete-keys-p 8 normal-erase-is-backspace normal-erase-is-backspace-mode x-show-tip tooltip-mode (x w32) tty-display-color-p pc windows-nt tty-color-define clear-face-cache frame-notice-user-settings run-hooks before-init-hook load startup #[nil "\205\227	\306=\203\307\310Q\2025	\311=\203'\312\307\313\314#\203#\315\2025\316\2025	\317=\2031\320\2025\307\321Q\322\323\n\322\211#\210\322=\203F\313\203\210\324!\325\232\203\210\326!\211\327P\330
!\203d
\202o\330\f!\203n\f\202o\313\211\203\207\331\f\"\203\205\332\333\f#\210\334\335!\210\f*\206\226\313 \323\336\322\211#))\207" [init-file-user system-type user-init-file-1 user-init-file source alt ms-dos "~" "/_emacs" windows-nt directory-files nil "^\\.emacs\\(\\.elc?\\)?$" "~/.emacs" "~/_emacs" vax-vms "sys$login:.emacs" "/.emacs" t load file-name-extension "elc" file-name-sans-extension ".el" file-exists-p file-newer-than-file-p message "Warning: %s is newer than %s" sit-for 1 "default" inhibit-default-init inhibit-startup-message] 5] (byte-code " \210\302\302\207" [inner init-file-had-error nil] 1) ((error (byte-code "\304\212\305\306!q\210\307\310\311	\"\310\312\n@\313N\nA\203\314\202\315\316\317\nA\320#$\307\321\322\323\324\261\210)\325\326\n@\313N\nA\203<\314\202=\315\316\317\nA\320#$\210\327\306!\210\330)\304\207" [message-log-max user-init-file error init-file-had-error nil get-buffer-create "*Messages*" "\n\n" format "An error has occurred while loading `%s':\n\n" "%s%s%s" error-message ": " "" mapconcat prin1-to-string ", " "To ensure normal operation, you should investigate the cause\n" "of the error in your initialization file and remove it.  Start\n" "Emacs with the `--debug-init' option to view a complete error\n" "backtrace\n" message "Error in init file: %s%s%s" pop-to-buffer t] 10))) mapcar #[(buffer) "rq\210	\205\302\303!)\207" [buffer enable-multibyte-characters set-buffer-multibyte nil] 2] buffer-list set-language-environment "@" system-name after-init-hook get-buffer "*scratch*" fundamental-mode "TERM" "[-_][^-_]+$" command-line-1 kill-emacs] 5])
+(defalias 'command-line #[nil "\306\n\307>\203\310\311!\206N\310\312!\206N\310\313!\206N\314\202N\n\315>\203;\310\312!\206N\310\313!\206N\310\311!\206N\316\202N\310\312!\206N\310\313!\206N\310\311!\206N\317!\n\320=\205Y\310\312!\310\321!\211\322=\204\227
\323\230\204p
\324\230\203v\325@\202\227
\326\230\204\202
\327\230\203\210\322@\202\227
\330\230\204\224
\331\230\203\227\332@)\n\333>\203\247\334A\335B\202\255\336C\335B\337\340\341\217\210\342 \204\302D\204\302\343E!E\344\322!\210\322EAFGD?\205\326\345 \211H\203\347H\346 \230\203\347\347HG\204F\203\350F@\322IJK\351\352J\"\203\351\353J\"\203J\354\225\322OIJ\354\211\224OJJ\355\232\204c\356JK\"\211L\325=\203;J\357\322OJ\202bL;\203_\360LK\"\211M\204S\337\361J\"\210M@\357\322OJ)\202b\322I)J\362\230\204qJ\363\230\203|\322HFAF\202J\364\230\204\212J\365\230\203\247I\204\230FA\211F@IIH\322IFAF\202J\366\230\203\271\322NFAF\202J\367\230\203\313\325OFAF\202J\370\230\203\340\371PBPFAF\202J\372\230\204\365J\373\230\204\365J\374\230\203\375QBQFAF\202\325GI\203\337\376J\"\210+\202\347E\203 EF\241\210*\377\201s!\203.\201s \210D\204PR\201t>\203J\201u\201v \236A\354V\203P\201w\325!\210D\204m\342 \203m\201x\322\201Z\"\354V\203m\201y\357!\210D\204\220\n\320=\204\220R\201z>\203\220\201{\201|\325\"\210\201}\357!\210D\204\322\n\201~>\204\303R\201>\203\265\377\201\200!\203\265\201\200 \204\303R\204\322S\201\201=\203\322\201{\201\202\325\"\210\201\203\357!\210D\204\363\342 \203\363\377\201\204!\203\363\201{\201\205\325\"\210\201\205\357!\210R\201\206>\204U\201\207 \203UR\201\210=\203T\202 \n\201\211=\203U\202 V\211W@XW\203O\201\212X@X\211YA@)X\211YAA)#\210WA\211W@X\202&\201\213 \210*\377\201\214!\203\203\201ZP\236\206l\201ZQ\236\211Z?\206ZA?\206ZA\354=?[)\\]^_`a\201\215\201\216!\210N\203\272\201\217\201\220\325\211\322$\203\260\201\221b!\210\201\217N\325\211\322$\210\322c\322\211O\325=\203\314\201\222\202\316Odefghf\201\223ijO\203\355i \210\202\366\337\201\224\201\225\217\210jf=\204\325gjh*g\203hjd\204/ed=\204/\201\226\201\227\201\230 \"\210\201\231k!\210,l\204F\345 \201\232m\206C\201\233 Ql\\a=\203^]`=\203^^_=\204c\201\213 \210+\201\215\201\234!\210\201\235\201\236!\203\212\212\201\236q\210n\201\237=\203\211o \210)p\203\326D\204\326R\204\326\310\201\240!\322q\211r\203\325\201\217prP\325\211#\204\325\351\201\241r\"\211q\203\316r\354qO\211r\202\244\322\211r\204\247*\201\242EA!\210D\205\350\201\243\325!\207" [default-directory command-line-default-directory system-type temporary-file-directory small-temporary-file-directory vc file-name-as-directory (ms-dos windows-nt) getenv "TEMP" "TMPDIR" "TMP" "c:/temp" (vax-vms axp-vms) "SYS$SCRATCH:" "/tmp" ms-dos "VERSION_CONTROL" nil "t" "numbered" t "nil" "existing" "never" "simple" never (ms-dos windows-nt emx) "(Unix)" "(Mac)" "(DOS)" error (byte-code "\203	\204\303\n\304!\305Q\306\307#\210\306\207" [window-system noninteractive term-file-prefix load symbol-name "-win" nil t] 4) ((error (byte-code "\302@\300=\203\303\304A\"\2026\305@\306N>\203)\307\310A@\311\312AA\313##\2026\307\310@\314N\311\315A\313##\316\"\210\317\316!\210\320\321 \207" [error window-system princ apply concat file-error error-conditions format "%s: %s" mapconcat #[(obj) "\301\302\"\207" [obj prin1-to-string t] 3] ", " error-message #[(obj) "\301\302\"\207" [obj prin1-to-string t] 3] external-debugging-output terpri nil kill-emacs] 8))) display-graphic-p tty-handle-args set-locale-environment user-login-name user-real-login-name "" (("--no-init-file") ("--no-site-file") ("--user") ("--debug-init") ("--iconic") ("--icon-type")) string-match "\\`--" "=" 0 "--" try-completion 1 assoc "Option `%s' is ambiguous" "-q" "-no-init-file" "-u" "-user" "-no-site-file" "-debug-init" "-iconic" (visibility . icon) "-icon-type" "-i" "-itype" (icon-type . t) "Option `%s' doesn't allow an argument" fboundp version-control eol-mnemonic-unix eol-mnemonic-mac eol-mnemonic-dos noninteractive command-line-args args done init-file-user argval argi longopts completion elt site-run-file init-file-debug initial-frame-alist default-frame-alist window-system tty-erase-char msdos-color-values w32-tty-standard-colors tty-standard-colors colors color x tool-bar-lines tool-bar-originally-present scalable-fonts-allowed font-list-limit face-ignored-fonts old-face-ignored-fonts old-font-list-limit old-scalable-fonts-allowed fink-emacs-flavor inhibit-startup-message default-enable-multibyte-characters orig-enable-multibyte debug-on-error-initial debug-on-error-should-be-set debug-on-error-from-init-file inner debug-on-error current-language-environment user-mail-address mail-host-address major-mode initial-major-mode term-file-prefix hyphend term frame-initialize (x w32) menu-bar-lines frame-parameters menu-bar-mode frame-parameter tool-bar-mode (x w32) set-default blink-cursor blink-cursor-mode (ms-dos windows-nt) (x) x-backspace-delete-keys-p 8 normal-erase-is-backspace normal-erase-is-backspace-mode x-show-tip tooltip-mode (x w32) tty-display-color-p pc windows-nt tty-color-define clear-face-cache frame-notice-user-settings run-hooks before-init-hook load "fink-startup" fink-startup startup #[nil "\205\227	\306=\203\307\310Q\2025	\311=\203'\312\307\313\314#\203#\315\2025\316\2025	\317=\2031\320\2025\307\321Q\322\323\n\322\211#\210\322=\203F\313\203\210\324!\325\232\203\210\326!\211\327P\330
!\203d
\202o\330\f!\203n\f\202o\313\211\203\207\331\f\"\203\205\332\333\f#\210\334\335!\210\f*\206\226\313 \323\336\322\211#))\207" [init-file-user system-type user-init-file-1 user-init-file source alt ms-dos "~" "/_emacs" windows-nt directory-files nil "^\\.emacs\\(\\.elc?\\)?$" "~/.emacs" "~/_emacs" vax-vms "sys$login:.emacs" "/.emacs" t load file-name-extension "elc" file-name-sans-extension ".el" file-exists-p file-newer-than-file-p message "Warning: %s is newer than %s" sit-for 1 "default" inhibit-default-init inhibit-startup-message] 5] (byte-code " \210\302\302\207" [inner init-file-had-error nil] 1) ((error (byte-code "\304\212\305\306!q\210\307\310\311	\"\310\312\n@\313N\nA\203\314\202\315\316\317\nA\320#$\307\321\322\323\324\261\210)\325\326\n@\313N\nA\203<\314\202=\315\316\317\nA\320#$\210\327\306!\210\330)\304\207" [message-log-max user-init-file error init-file-had-error nil get-buffer-create "*Messages*" "\n\n" format "An error has occurred while loading `%s':\n\n" "%s%s%s" error-message ": " "" mapconcat prin1-to-string ", " "To ensure normal operation, you should investigate the cause\n" "of the error in your initialization file and remove it.  Start\n" "Emacs with the `--debug-init' option to view a complete error\n" "backtrace\n" message "Error in init file: %s%s%s" pop-to-buffer t] 10))) mapcar #[(buffer) "rq\210	\205\302\303!)\207" [buffer enable-multibyte-characters set-buffer-multibyte nil] 2] buffer-list set-language-environment "@" system-name after-init-hook get-buffer "*scratch*" fundamental-mode "TERM" "[-_][^-_]+$" command-line-1 kill-emacs] 6])
 #@105 Initial message displayed in *scratch* buffer at startup.
 If this is nil, no message will be displayed.
-(custom-declare-variable 'initial-scratch-message '(purecopy ";; This buffer is for notes you don't want to save, and for Lisp evaluation.\n;; If you want to create a file, visit that file with C-x C-f,\n;; then enter the text in that file's own buffer.\n\n") '(#$ . 22397) :type 'string)
+(custom-declare-variable 'initial-scratch-message '(purecopy ";; This buffer is for notes you don't want to save, and for Lisp evaluation.\n;; If you want to create a file, visit that file with C-x C-f,\n;; then enter the text in that file's own buffer.\n\n") '(#$ . 22677) :type 'string)
 #@180 A list of texts to show in the middle part of splash screens.
 Each element in the list should be a list of strings or pairs
 `:face FACE', like `fancy-splash-insert' accepts them.
-(defvar fancy-splash-text '((:face variable-pitch "You can do basic editing with the menu bar and scroll bar using the mouse.\n\n" :face (variable-pitch :weight bold) "Important Help menu items:\n" :face variable-pitch "Emacs Tutorial	Learn-by-doing tutorial for using Emacs efficiently\nEmacs FAQ	Frequently asked questions and answers\n(Non)Warranty	GNU Emacs comes with " :face (variable-pitch :slant oblique) "ABSOLUTELY NO WARRANTY\n" :face variable-pitch "Copying Conditions	Conditions for redistributing and changing Emacs\nOrdering Manuals	How to order Emacs manuals from the Free Software Foundation\n") (:face variable-pitch "You can do basic editing with the menu bar and scroll bar using the mouse.\n\n" :face (variable-pitch :weight bold) "Useful File menu items:\n" :face variable-pitch "Exit Emacs	(Or type Control-x followed by Control-c)\nRecover Session	Recover files you were editing before a crash\n\n\n\n")) (#$ . 22797))
+(defvar fancy-splash-text '((:face variable-pitch "You can do basic editing with the menu bar and scroll bar using the mouse.\n\n" :face (variable-pitch :weight bold) "Important Help menu items:\n" :face variable-pitch "Emacs Tutorial	Learn-by-doing tutorial for using Emacs efficiently\nEmacs FAQ	Frequently asked questions and answers\n(Non)Warranty	GNU Emacs comes with " :face (variable-pitch :slant oblique) "ABSOLUTELY NO WARRANTY\n" :face variable-pitch "Copying Conditions	Conditions for redistributing and changing Emacs\nOrdering Manuals	How to order Emacs manuals from the Free Software Foundation\n") (:face variable-pitch "You can do basic editing with the menu bar and scroll bar using the mouse.\n\n" :face (variable-pitch :weight bold) "Useful File menu items:\n" :face variable-pitch "Exit Emacs	(Or type Control-x followed by Control-c)\nRecover Session	Recover files you were editing before a crash\n\n\n\n")) (#$ . 23077))
 (custom-declare-group 'fancy-splash-screen nil "Fancy splash screen when Emacs starts." :version "21.1" :group 'initialization)
 #@43 *Delay in seconds between splash screens.
-(custom-declare-variable 'fancy-splash-delay '10 '(#$ . -24053) :group 'fancy-splash-screen :type 'integer)
+(custom-declare-variable 'fancy-splash-delay '10 '(#$ . -24333) :group 'fancy-splash-screen :type 'integer)
 #@99 *Show splash screens for at most this number of seconds.
 Values less than 60 seconds are ignored.
-(custom-declare-variable 'fancy-splash-max-time '60 '(#$ . -24209) :group 'fancy-splash-screen :type 'integer)
+(custom-declare-variable 'fancy-splash-max-time '60 '(#$ . -24489) :group 'fancy-splash-screen :type 'integer)
 #@64 *The image to show in the splash screens, or nil for defaults.
-(custom-declare-variable 'fancy-splash-image 'nil '(#$ . -24424) :group 'fancy-splash-screen :type '(choice (const :tag "Default" nil) (file :tag "File")))
+(custom-declare-variable 'fancy-splash-image 'nil '(#$ . -24704) :group 'fancy-splash-screen :type '(choice (const :tag "Default" nil) (file :tag "File")))
 (byte-code "\301B\304\301!\204\f\305\302B\304\302!\204\305\303B\304\303!\204$\305\305\207" [current-load-list fancy-current-text fancy-splash-help-echo fancy-splash-stop-time boundp nil] 2)
 #@206 Insert text into the current buffer, with faces.
 Arguments from ARGS should be either strings or pairs `:face FACE',
 where FACE is a valid face specification, as it can be used with
 `put-text-properties'.
-(defalias 'fancy-splash-insert #[(&rest args) "\303	\205(	@\304=\203	A\211@\202 \305	@\306\307\n%c\210	A\211\204\303)\207" [current-face args fancy-splash-help-echo nil :face propertize face help-echo] 7 (#$ . 24853)])
+(defalias 'fancy-splash-insert #[(&rest args) "\303	\205(	@\304=\203	A\211@\202 \305	@\306\307\n%c\210	A\211\204\303)\207" [current-face args fancy-splash-help-echo nil :face propertize face help-echo] 7 (#$ . 25133)])
 #@68 Insert the head part of the splash screen into the current buffer.
-(defalias 'fancy-splash-head #[nil ";\203	\202*\306 \203)\307\310!\203)\311\312!\203%\312 \313U\203%\314\202*\315\202*\316\317	!\211\2057\320\n!@\304\321 !\n\203\205\fV\203\205\fZ\322\245\323\324\325\326\327
E#c\210)\330 \331\",\332,\333\334#\210\332,\335\336#\210\332,\337\336#\210\340\n\323\341\342\"\343,%\"\210*\344c\210,-\345=\203\226\346\347\350\351#\210\202\234\346\347\352\353#\210\344c\207" [fancy-splash-image image-file img image-width window-width pos display-color-p image-type-available-p xpm fboundp x-display-planes 8 "splash8.xpm" "splash.xpm" "splash.pbm" create-image image-size selected-window 2 propertize " " display space :align-to make-sparse-keymap "mouse-2: browse http://www.gnu.org/" define-key [mouse-2] #[nil "\300\301!\210\302\303\304\"\207" [browse-url "http://www.gnu.org/" throw exit nil] 3 nil nil] [down-mouse-2] ignore [up-mouse-2] insert-image "xxx" help-echo keymap "\n" gnu/linux fancy-splash-insert :face (variable-pitch :foreground "red") "GNU Emacs is one component of a Linux-based GNU system." (variable-pitch :foreground "red") "GNU Emacs is one component of the GNU operating system." map system-type] 9 (#$ . 25294)])
+(defalias 'fancy-splash-head #[nil ";\203	\202*\306 \203)\307\310!\203)\311\312!\203%\312 \313U\203%\314\202*\315\202*\316\317	!\211\2057\320\n!@\304\321 !\n\203\205\fV\203\205\fZ\322\245\323\324\325\326\327
E#c\210)\330 \331\",\332,\333\334#\210\332,\335\336#\210\332,\337\336#\210\340\n\323\341\342\"\343,%\"\210*\344c\210,-\345=\203\226\346\347\350\351#\210\202\234\346\347\352\353#\210\344c\207" [fancy-splash-image image-file img image-width window-width pos display-color-p image-type-available-p xpm fboundp x-display-planes 8 "splash8.xpm" "splash.xpm" "splash.pbm" create-image image-size selected-window 2 propertize " " display space :align-to make-sparse-keymap "mouse-2: browse http://www.gnu.org/" define-key [mouse-2] #[nil "\300\301!\210\302\303\304\"\207" [browse-url "http://www.gnu.org/" throw exit nil] 3 nil nil] [down-mouse-2] ignore [up-mouse-2] insert-image "xxx" help-echo keymap "\n" gnu/linux fancy-splash-insert :face (variable-pitch :foreground "red") "GNU Emacs is one component of a Linux-based GNU system." (variable-pitch :foreground "red") "GNU Emacs is one component of the GNU operating system." map system-type] 9 (#$ . 25574)])
 #@68 Insert the tail part of the splash screen into the current buffer.
-(defalias 'fancy-splash-tail #[nil "\301\302\303\"\304=\203
\305\202\306\307\310\311\312E\313\314 \315\310\316\317&)\207" [fg frame-parameter nil background-mode dark "cyan" "darkblue" fancy-splash-insert :face variable-pitch :foreground "\nThis is " emacs-version "\n" (variable-pitch :height 0.5) "Copyright (C) 2001 Free Software Foundation, Inc."] 9 (#$ . 26563)])
+(defalias 'fancy-splash-tail #[nil "\301\302\303\"\304=\203
\305\202\306\307\310\311\312E\313\314 \315\310\316\317&)\207" [fg frame-parameter nil background-mode dark "cyan" "darkblue" fancy-splash-insert :face variable-pitch :foreground "\nThis is " emacs-version "\n" (variable-pitch :height 0.5) "Copyright (C) 2001 Free Software Foundation, Inc."] 9 (#$ . 26843)])
 #@44 Timer function displaying a splash screen.
-(defalias 'fancy-splash-screens-1 #[(buffer) "\306 V\203\f\307\310\311\"\210	\204\n	@\fq\210\312 \210\313 \210\314\315\"\210\316 \210\317 \204/\320
!\210\321\311!\210eb\210\322 \210	A\211)\207" [fancy-splash-stop-time fancy-current-text fancy-splash-text text buffer fancy-splash-help-echo float-time throw stop-splashing nil erase-buffer fancy-splash-head apply fancy-splash-insert fancy-splash-tail current-message message set-buffer-modified-p force-mode-line-update] 3 (#$ . 27011)])
+(defalias 'fancy-splash-screens-1 #[(buffer) "\306 V\203\f\307\310\311\"\210	\204\n	@\fq\210\312 \210\313 \210\314\315\"\210\316 \210\317 \204/\320
!\210\321\311!\210eb\210\322 \210	A\211)\207" [fancy-splash-stop-time fancy-current-text fancy-splash-text text buffer fancy-splash-help-echo float-time throw stop-splashing nil erase-buffer fancy-splash-head apply fancy-splash-insert fancy-splash-tail current-message message set-buffer-modified-p force-mode-line-update] 3 (#$ . 27291)])
 #@56 Default action for events in the splash screen buffer.
-(defalias 'fancy-splash-default-action #[nil "	B\302\303\304\"\207" [last-command-event unread-command-events throw exit nil] 3 (#$ . 27557) nil])
+(defalias 'fancy-splash-default-action #[nil "	B\302\303\304\"\207" [last-command-event unread-command-events throw exit nil] 3 (#$ . 27837) nil])
 #@49 Display fancy splash screens when Emacs starts.
-(defalias 'fancy-splash-screens #[nil "\306 \307\310!\210\311\np\312
\313\314\215,\207" [fancy-splash-help-echo tab-width display-hourglass minor-mode-map-alist timer old-minor-mode-map-alist startup-echo-area-message switch-to-buffer "GNU Emacs" 20 nil stop-splashing (byte-code "\306\216\307 \310!\210\311\312\313#\210\311\314\315#\210\311\316\315#\210\317\317\317\320\321\322\323\324#\325 \326]\\\327\330\331$\332 *\207" [map cursor-type display-hourglass minor-mode-map-alist buffer-undo-list mode-line-format ((byte-code "\306!\210	\307
!\207" [timer old-hourglass display-hourglass old-minor-mode-map-alist minor-mode-map-alist splash-buffer cancel-timer kill-buffer] 2)) make-sparse-keymap use-local-map define-key [t] fancy-splash-default-action [mouse-movement] ignore [mode-line t] nil t propertize "---- %b %-" face (:weight bold) float-time 60 run-with-timer 0 fancy-splash-screens-1 recursive-edit fancy-splash-max-time fancy-splash-stop-time fancy-splash-delay splash-buffer timer] 5) splash-buffer old-hourglass] 4 (#$ . 27767)])
+(defalias 'fancy-splash-screens #[nil "\306 \307\310!\210\311\np\312
\313\314\215,\207" [fancy-splash-help-echo tab-width display-hourglass minor-mode-map-alist timer old-minor-mode-map-alist startup-echo-area-message switch-to-buffer "GNU Emacs" 20 nil stop-splashing (byte-code "\306\216\307 \310!\210\311\312\313#\210\311\314\315#\210\311\316\315#\210\317\317\317\320\321\322\323\324#\325 \326]\\\327\330\331$\332 *\207" [map cursor-type display-hourglass minor-mode-map-alist buffer-undo-list mode-line-format ((byte-code "\306!\210	\307
!\207" [timer old-hourglass display-hourglass old-minor-mode-map-alist minor-mode-map-alist splash-buffer cancel-timer kill-buffer] 2)) make-sparse-keymap use-local-map define-key [t] fancy-splash-default-action [mouse-movement] ignore [mode-line t] nil t propertize "---- %b %-" face (:weight bold) float-time 60 run-with-timer 0 fancy-splash-screens-1 recursive-edit fancy-splash-max-time fancy-splash-stop-time fancy-splash-delay splash-buffer timer] 5) splash-buffer old-hourglass] 4 (#$ . 28047)])
 #@50 Return t if fancy splash screens should be used.
-(defalias 'use-fancy-splash-screens-p #[nil "\304 \203\305\306!\204\305\307!\205=\310\206&\304 \203%\305\306!\203%\311\202&\312!\211\2050\313	!A\303\314 !S\211\n\315\\V+\207" [fancy-splash-image img image-height window-height display-color-p image-type-available-p xpm pbm create-image "splash.xpm" "splash.pbm" image-size selected-window 15] 4 (#$ . 28898)])
+(defalias 'use-fancy-splash-screens-p #[nil "\304 \203\305\306!\204\305\307!\205=\310\206&\304 \203%\305\306!\203%\311\202&\312!\211\2050\313	!A\303\314 !S\211\n\315\\V+\207" [fancy-splash-image img image-height window-height display-color-p image-type-available-p xpm pbm create-image "splash.xpm" "splash.pbm" image-size selected-window 15] 4 (#$ . 29178)])
 (defalias 'startup-echo-area-message #[nil "\300\301!\302=\203\n\303\207\304\305!\207" [key-binding "" describe-project "For information about the GNU Project and its goals, type C-h C-p." substitute-command-keys "For information about the GNU Project and its goals, type \\[describe-project]."] 2])
 (defalias 'display-startup-echo-area-message #[nil "\301\302\303 !)\207" [resize-mini-windows t message startup-echo-area-message] 2])
 (defalias 'command-line-1 #[(command-line-args-left) "\204?\306 \204?	\204?\n\203<\203<\302\307N\203,\n\f\310\230\203'\311 \202(\f\232\204?\312\313!\314\315\316\217\317
!\210)\204?\320 \210@\204\342A?\205\341?\205\341\321 \322\230\205?\203_\323\324!\210\314\325\326!\203k\326 \210\203w\323\327!\210\314\330 \203\331 \210\332B\333 \334U\205\341\332\335\332CDE\336\216\306 ?\205\340db\210\337c\210F\340=\203\252\341c\210\342c\210\343\344 \236\203\317\345 \203\302\314C\346 \210\202\313\347c\210\350\351 \352\261\210\202\313\353\354!\355=\203\353\356!\357=\203\353\360!\361=\203\353\362!\363=\203\353\364!\365=\203\353\366!\367=\203\370c\210\202 \371\372\373\374\355\314\332#\211G\203\375G!\202\376)\"!c\210\353\377!\201`=\203>\353\201a!\201`=\203>\201bc\210\202E\371\201c!c\210\201d \203Q\201ec\210\201fc\210H\203\221\201g\201hH!!\203\221\201i\201hH!\314\201j\201k\201lH!!P\332$\203\221\201m\201n\201o\261\210\350\351 \352\261\210\353\201p!\201q=\203\304\353\201r!\201s=\203\304\353\201t!\201u=\203\304\201vc\210\202\313\371\201w!c\210eb\210\201x\314!\210C\205\340\201y\201z!,\207	\203\356\201y\201{!\210I\334\314\211\211\201|\201}\201~\201J\"\"\334\211KLMNOPQRS\211O\203?\201\200\201\201O@@\"\2036O@@CMBMOA\211O\204@\203\"@@\211TU\314V\314W\314XYZ@A@N\203i\310T\202\345\201\200\201\202T\"\203\206T\334\225\314OVT\334\211\225SOTT\201\203\232\203\225\314W\202\237\201\204TM\"WW\332=\203\262T\201\205\314OT\202\345W;\203\336\201\206WM\"\211[\204\320\201\207\201\210T\"\210[@\201\205\314OT)\202\345\314VUT\201\206TJ\"\211O\203V\203\nV@B@OAT!\210)\202OAT!\210\202T\201\211\230\204/T\201\212\230\204/T\201\213\230\203hV\203?\201\214V!O\202M\201\214@@!O@A@\201\215OK!\203a\201\216O!\210\202O \210\202T\201\217\230\204zT\201\220\230\203\236V\203\206VO\202\220@@O@A@\201\221\201\222O!!\210\202T\201\223\230\204\260T\201\224\230\203\347V\203\274VO\202\306@@O@A@\201\225O!O\201\226O!XBX\201|X\237Z\"Y\202T\201\227\230\204\371T\201\230\230\2039V\203VO\202@@O@A@\201\225O!\\\201\231\201\226\\!!\203,\201\226\\!\\\201\232\\\314\332#\210)\202T\201\233\230\203tV\203NVO\202X@@O@A@O;\204f\201\207\201\234!\210\201\235\201\225O!!\210\202T\201\236\230\203\206\201\237\332!\210\202\201\200\201\240T\"\203\235\201\241T!L\202\201\200\201\242T\"\203\312\201\241\201\243\201\205T\"!L\201\241\201\243\201{T\"!K\202\201\206TS\"\211O\203\344OA@@\233@\202T\201\244\230\204\377T\201\245\230\204\377T\201\246\230\203~V\203VO\202@@O@A@O;\204%\201\207\201\247T\"\210QTQ\201\226\201\225O!R\"\\Q\201\205U\203L\201\250\\!P\202S\201\251\\!\210)\201\252L!\204d\201\253L!\210\334LK\201\205W\204x\201\254KS!\210\334K\202T\201\203\232\203\215\332N\202]\314^\211_\203\253_@ \211^\204\253_A\211_\204\230^\204\201\200\201\255T\"\203\306\201\207\201\256T\"\210QTQ\201\226\201\225U!R\"\\Q\201\205U\203\355\201\250\\!P\202\364\201\251\\!\210)\201\252L!\204\201\253L!\210\334LK\201\205W\204\201\254KS!\210\334K*.\202?Q\201{V\205=?\205=\201\257P!\206=\201\260 .\207" [noninteractive init-file-had-error inhibit-startup-echo-area-message user-init-file init-file-user buffer input-pending-p saved-value "" user-login-name get-buffer-create " *temp*" nil (byte-code "\212q\210\303	!\210\304\305\306\307\310\n\311\230\203\312 \202\n!!\313R\314\315#)\207" [buffer user-init-file init-file-user insert-file-contents re-search-forward "([ 	\n]*setq[ 	\n]+" "inhibit-startup-echo-area-message[ 	\n]+" regexp-quote prin1-to-string "" user-login-name "[ 	\n]*)" nil t] 7) ((error)) kill-buffer display-startup-echo-area-message buffer-name "*scratch*" run-hooks term-setup-hook fboundp frame-notice-user-settings window-setup-hook display-popup-menus-p precompute-menubar-bindings t buffer-size 0 8 ((byte-code "r\301\302!q\210\303 \210\203c\210\304\305!\210)\305\207" [initial-scratch-message get-buffer "*scratch*" erase-buffer set-buffer-modified-p nil] 2)) "Welcome to GNU Emacs" gnu/linux ", one component of a Linux-based GNU system." "\n" display frame-parameters use-fancy-splash-screens-p fancy-splash-screens "You can do basic editing with the menu bar and scroll bar using the mouse.\n\nUseful File menu items:\nExit Emacs		(or type Control-x followed by Control-c)\nRecover Session		recover files you were editing before a crash\n\nImportant Help menu items:\nEmacs Tutorial		Learn-by-doing tutorial for using Emacs efficiently.\nEmacs FAQ		Frequently asked questions and answers\n(Non)Warranty		GNU Emacs comes with ABSOLUTELY NO WARRANTY\nCopying Conditions	Conditions for redistributing and changing Emacs.\nGetting New Versions	How to obtain the latest version of Emacs.\nOrdering Manuals	How to order manuals from the FSF.\n" "\n\n" emacs-version "\nCopyright (C) 2001 Free Software Foundation, Inc." key-binding "" help-command "u" advertised-undo "" save-buffers-kill-emacs "t" help-with-tutorial "i" info "" view-emacs-news "\nGet help	   C-h  (Hold down CTRL and press h)\nUndo changes	   C-x u       Exit Emacs		C-x C-c\nGet a tutorial	   C-h t       Use Info to read docs	C-h i\nOrdering manuals   C-h RET" substitute-command-keys format "\n\nGet help	   %s\nUndo changes	   \\[advertised-undo]\nExit Emacs	   \\[save-buffers-kill-emacs]\nGet a tutorial	   \\[help-with-tutorial]\nUse Info to read docs	\\[info]\nOrdering manuals   \\[view-order-manuals]" where-is-internal key-description "M-x help" "\340" command-line-args-left inhibit-startup-message menubar-bindings-done wait-for-input tab-width buffer-undo-list system-type where auto-save-list-file-prefix command-line-default-directory command-switch-alist column line longopts just-files tem first-file-buffer file-count dir command-line-x-option-alist argi orig-argi argval completion extra-load-path load-path initial-load-path elt file command-line-functions did-hook hooks tmm-menubar [f10] "\nActivate menubar   F10  or  ESC `  or   M-`" "\nActivate menubar     \\[tmm-menubar]" display-mouse-p "\nMode-specific menu   C-mouse-3 (third button, with CTRL)" "\n(`C-' means use the CTRL key.  `M-' means use the Meta (or Alt) key.\nIf you have no Meta key, you may instead type ESC followed by the character.)" file-directory-p file-name-directory directory-files "\\`" regexp-quote file-name-nondirectory "\n\nIf an Emacs session crashed recently, " "type M-x recover-session RET\nto recover" " the files you were editing." "" describe-copying "" describe-distribution "" describe-no-warranty "\n\nGNU Emacs comes with ABSOLUTELY NO WARRANTY; type C-h C-w for full details.\nEmacs is Free Software--Free as in Freedom--so you can redistribute copies\nof Emacs and modify it; type C-h C-c to see the conditions.\nType C-h C-d for information on getting the latest version." "\n\nGNU Emacs comes with ABSOLUTELY NO WARRANTY; type \\[describe-no-warranty] for full details.\nEmacs is Free Software--Free as in Freedom--so you can redistribute copies\nof Emacs and modify it; type \\[describe-copying] to see the conditions.\nType \\[describe-distribution] for information on getting the latest version." set-buffer-modified-p sit-for 120 2 append (("--funcall") ("--load") ("--insert") ("--kill") ("--directory") ("--eval") ("--execute") ("--find-file") ("--visit") ("--file")) mapcar #[(elt) "\301@PC\207" [elt "-"] 2] string-match "^--" "^--[^=]*=" "--" try-completion 1 assoc error "Option `%s' is ambiguous" "-f" "-funcall" "-e" intern arrayp command-execute "-eval" "-execute" eval read "-L" "-directory" command-line-normalize-file-name expand-file-name "-l" "-load" file-exists-p load "-insert" "File name omitted from `-insert' option" insert-file-contents "-kill" kill-emacs "^\\+[0-9]+\\'" string-to-int "^\\+\\([0-9]+\\):\\([0-9]+\\)\\'" match-string "-find-file" "-file" "-visit" "File name omitted from `%s' option" find-file find-file-other-window zerop goto-line move-to-column "\\`-" "Unknown option `%s'" get-buffer-window list-buffers] 11])
 #@67 Collapse multiple slashes to one, to handle non-Emacs file names.
-(defalias 'command-line-normalize-file-name #[(file) "\302 \303\216\304\305	\"\203\306\307\310\211	$\304\311	\312#\203%\306\307\310\211	$\202	*\207" [save-match-data-internal file match-data ((set-match-data save-match-data-internal)) string-match "^///+" replace-match "/" t "//+" 1] 5 (#$ . 38089)])
+(defalias 'command-line-normalize-file-name #[(file) "\302 \303\216\304\305	\"\203\306\307\310\211	$\304\311	\312#\203%\306\307\310\211	$\202	*\207" [save-match-data-internal file match-data ((set-match-data save-match-data-internal)) string-match "^///+" replace-match "/" t "//+" 1] 5 (#$ . 38369)])
diff -u -Naur emacs-21.2/man/Makefile.in emacs-f/man/Makefile.in
--- emacs-21.2/man/Makefile.in	Fri Dec 21 03:15:45 2001
+++ emacs-f/man/Makefile.in	Thu Oct 10 11:01:23 2002
@@ -31,7 +31,7 @@
 
 
 # The makeinfo program is part of the Texinfo distribution.
-MAKEINFO = makeinfo
+MAKEINFO = echo makeinfo
 INFO_TARGETS = ../info/emacs ../info/ccmode ../info/cl \
 	        ../info/dired-x ../info/ediff ../info/forms ../info/gnus \
 		../info/info ../info/message ../info/mh-e ../info/reftex \
diff -u -Naur emacs-21.2/mangle-info emacs-f/mangle-info
--- emacs-21.2/mangle-info	Wed Dec 31 19:00:00 1969
+++ emacs-f/mangle-info	Thu Oct 10 11:01:23 2002
@@ -0,0 +1,17 @@
+#!/usr/bin/perl -w -i
+
+use English;
+use strict;
+
+$RS = undef;
+
+my $prefix = "emacs-21";
+
+my $x = <>;
+if(!($x =~ m/^(\s*START-INFO-DIR-ENTRY\s+\*\s*[^:]+:\s*)\(([^\)]+)\)/mo)) {
+  die "Couldn't find START-INFO-DIR-ENTRY.";
+}
+   
+print ${PREMATCH};
+print "$1($prefix/$2)";
+print ${POSTMATCH};
diff -u -Naur emacs-21.2/src/Makefile.in emacs-f/src/Makefile.in
--- emacs-21.2/src/Makefile.in	Mon Dec 17 09:09:32 2001
+++ emacs-f/src/Makefile.in	Thu Oct 10 11:01:23 2002
@@ -324,7 +324,7 @@
 #if HAVE_XAW3D
 LIBW= -lXaw3d
 #else
-LIBW= -lXaw
+LIBW= -lXaw -lXpm
 #endif
 #endif
 #ifdef MOTIF
diff -u -Naur emacs-21.2/src/callproc.c emacs-f/src/callproc.c
--- emacs-21.2/src/callproc.c	Sun Nov 25 19:37:40 2001
+++ emacs-f/src/callproc.c	Thu Oct 10 11:01:23 2002
@@ -611,7 +611,11 @@
     pid = child_setup (filefd, fd1, fd_error, (char **) new_argv,
 		       0, current_dir);
 #else  /* not WINDOWSNT */
+#ifndef PUMA_VFORK_ISSUES_CLEARED_UP
+    pid = fork ();
+#else
     pid = vfork ();
+#endif
 
     if (pid == 0)
       {
diff -u -Naur emacs-21.2/src/emacs.c emacs-f/src/emacs.c
--- emacs-21.2/src/emacs.c	Mon Oct 29 06:31:07 2001
+++ emacs-f/src/emacs.c	Thu Oct 10 11:01:16 2002
@@ -779,15 +779,20 @@
     }
 #endif
 
-#ifdef NeXT
+#if defined(NeXT) || defined(RHAPSODY) || defined(DARWIN)
   {
     extern int malloc_cookie;
-    /* This helps out unexnext.c.  */
+    /* This helps out unexnext.c/unexdyld.c. */
     if (initialized)
-      if (malloc_jumpstart (malloc_cookie) != 0)
-	printf ("malloc jumpstart failed!\n");
+      {
+	if (malloc_jumpstart (malloc_cookie) != 0)
+	  {
+	    fprintf (stderr, "Fatal malloc_jumpstart() error\n");
+	    exit (1);
+	  }
+      }
   }
-#endif /* NeXT */
+#endif /* NeXT || RHAPSODY || DARWIN */
 
 #ifdef VMS
   /* If -map specified, map the data file in */
@@ -1466,7 +1471,7 @@
 #ifdef VMS
   init_vmsfns ();
 #endif /* VMS */
-  init_process ();
+  init_emacs_process ();
 #ifdef HAVE_SOUND
   init_sound ();
 #endif
diff -u -Naur emacs-21.2/src/floatfns.c emacs-f/src/floatfns.c
--- emacs-21.2/src/floatfns.c	Fri Feb 22 05:51:46 2002
+++ emacs-f/src/floatfns.c	Thu Oct 10 11:01:23 2002
@@ -978,6 +978,9 @@
 #endif /* FLOAT_CATCH_SIGILL */
 
 #ifdef HAVE_MATHERR
+#ifdef __APPLE_CC__
+__private_extern__
+#endif
 int 
 matherr (x)
      struct exception *x;
diff -u -Naur emacs-21.2/src/getloadavg.c emacs-f/src/getloadavg.c
--- emacs-21.2/src/getloadavg.c	Tue Jun 20 09:17:40 2000
+++ emacs-f/src/getloadavg.c	Thu Oct 10 11:01:23 2002
@@ -54,6 +54,8 @@
    hpux
    __MSDOS__			No-op for MSDOS.
    NeXT
+   RHAPSODY			Mac OS X Server
+   DARWIN			Darwin (Mac OS)
    sgi
    sequent			Sequent Dynix 3.x.x (BSD)
    _SEQUENT_			Sequent DYNIX/ptx 1.x.x (SYSV)
@@ -401,7 +403,7 @@
 #  define host_self mach_host_self
 # endif
 
-# ifdef NeXT
+# if defined(NeXT) || defined(RHAPSODY) || defined(DARWIN)
 #  ifdef HAVE_MACH_MACH_H
 #   include <mach/mach.h>
 #  else
@@ -449,7 +451,7 @@
 
 /* Avoid static vars inside a function since in HPUX they dump as pure.  */
 
-# ifdef NeXT
+# if defined(NeXT) || defined(RHAPSODY) || defined(DARWIN)
 static processor_set_t default_set;
 static int getloadavg_initialized;
 # endif /* NeXT */
@@ -486,6 +488,9 @@
    Return the number written (never more than 3, but may be less than NELEM),
    or -1 if an error occurred.  */
 
+#ifdef __APPLE_CC__
+__private_extern__
+#endif
 int
 getloadavg (loadavg, nelem)
      double loadavg[];
@@ -626,14 +631,10 @@
 
 # endif /* __NetBSD__ */
 
-# if !defined (LDAV_DONE) && defined (NeXT)
+# if !defined (LDAV_DONE) && (defined(NeXT) || defined(RHAPSODY) || defined(DARWIN))
 #  define LDAV_DONE
   /* The NeXT code was adapted from iscreen 3.2.  */
 
-  host_t host;
-  struct processor_set_basic_info info;
-  unsigned info_count;
-
   /* We only know how to get the 1-minute average for this system,
      so even if the caller asks for more than 1, we only return 1.  */
 
@@ -643,10 +644,19 @@
 	getloadavg_initialized = 1;
     }
 
+#ifndef DARWIN
+#define processor_set_load_info processor_set_basic_info
+#define PROCESSOR_SET_LOAD_INFO PROCESSOR_SET_BASIC_INFO
+#define PROCESSOR_SET_LOAD_INFO_COUNT PROCESSOR_SET_BASIC_INFO_COUNT
+#endif
+
   if (getloadavg_initialized)
     {
-      info_count = PROCESSOR_SET_BASIC_INFO_COUNT;
-      if (processor_set_info (default_set, PROCESSOR_SET_BASIC_INFO, &host,
+      struct processor_set_load_info info;
+      host_t host;
+      unsigned info_count = PROCESSOR_SET_LOAD_INFO_COUNT;
+
+      if (processor_set_info (default_set, PROCESSOR_SET_LOAD_INFO, &host,
 			      (processor_set_info_t) &info, &info_count)
 	  != KERN_SUCCESS)
 	getloadavg_initialized = 0;
diff -u -Naur emacs-21.2/src/lisp.h emacs-f/src/lisp.h
--- emacs-21.2/src/lisp.h	Fri Feb 22 05:51:46 2002
+++ emacs-f/src/lisp.h	Thu Oct 10 11:01:23 2002
@@ -2770,7 +2770,7 @@
 extern void close_process_descs P_ ((void));
 extern void status_notify P_ ((void));
 extern int read_process_output P_ ((Lisp_Object, int));
-extern void init_process P_ ((void));
+extern void init_emacs_process P_ ((void));
 extern void syms_of_process P_ ((void));
 
 /* defined in callproc.c */
diff -u -Naur emacs-21.2/src/m/powermacintosh.h emacs-f/src/m/powermacintosh.h
--- emacs-21.2/src/m/powermacintosh.h	Wed Dec 31 19:00:00 1969
+++ emacs-f/src/m/powermacintosh.h	Thu Oct 10 11:01:23 2002
@@ -0,0 +1,45 @@
+/* Apple Power Macintosh machine/system dependent defines
+   Copyright (C) 1997 Free Software Foundation, Inc.
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+
+/* The following line tells the configuration script what sort of 
+   operating system this machine is likely to run.
+   USUAL-OPSYS="darwin"  */
+
+/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+   is the most significant byte.  */
+
+#define WORDS_BIG_ENDIAN
+
+/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
+ * group of arguments and treat it as an array of the arguments.  */
+
+#define NO_ARG_ARRAY
+
+/* Use type int rather than a union, to represent Lisp_Object */
+/* This is desirable for most machines.	 */
+
+#define NO_UNION_TYPE
+
+/* Define addresses, macros, change some setup for dump */
+
+#define NO_REMAP
+
+#define DATA_SEG_BITS 0
diff -u -Naur emacs-21.2/src/process.c emacs-f/src/process.c
--- emacs-21.2/src/process.c	Mon Jan  7 16:21:08 2002
+++ emacs-f/src/process.c	Thu Oct 10 11:01:23 2002
@@ -1482,7 +1482,11 @@
     current_dir = ENCODE_FILE (current_dir);
 
 #ifndef WINDOWSNT
+#ifndef PUMA_VFORK_ISSUES_CLEARED_UP
+    pid = fork ();
+#else
     pid = vfork ();
+#endif
     if (pid == 0)
 #endif /* not WINDOWSNT */
       {
@@ -4604,7 +4608,7 @@
 }
 
 void
-init_process ()
+init_emacs_process ()
 {
   register int i;
 
@@ -5003,7 +5007,7 @@
 }
 
 void
-init_process ()
+init_emacs_process ()
 {
 }
 
diff -u -Naur emacs-21.2/src/puresize.h emacs-f/src/puresize.h
--- emacs-21.2/src/puresize.h	Fri Feb 22 06:20:08 2002
+++ emacs-f/src/puresize.h	Thu Oct 10 11:01:23 2002
@@ -38,7 +38,7 @@
 #endif
 
 #ifndef SITELOAD_PURESIZE_EXTRA
-#define SITELOAD_PURESIZE_EXTRA 0
+#define SITELOAD_PURESIZE_EXTRA 100000
 #endif
 
 #ifndef BASE_PURESIZE
diff -u -Naur emacs-21.2/src/regex.c emacs-f/src/regex.c
--- emacs-21.2/src/regex.c	Fri Nov  2 11:10:25 2001
+++ emacs-f/src/regex.c	Thu Oct 10 11:01:23 2002
@@ -5831,6 +5831,9 @@
    It returns 0 if it succeeds, nonzero if it doesn't.  (See regex.h for
    the return codes and their meanings.)  */
 
+#ifdef __APPLE_CC__
+__private_extern__
+#endif
 int
 regcomp (preg, pattern, cflags)
     regex_t *__restrict preg;
@@ -5916,6 +5919,9 @@
 
    We return 0 if we find a match and REG_NOMATCH if not.  */
 
+#ifdef __APPLE_CC__
+__private_extern__
+#endif
 int
 regexec (preg, string, nmatch, pmatch, eflags)
     const regex_t *__restrict preg;
@@ -6030,6 +6036,9 @@
 
 /* Free dynamically allocated space used by PREG.  */
 
+#ifdef __APPLE_CC__
+__private_extern__
+#endif
 void
 regfree (preg)
     regex_t *preg;
diff -u -Naur emacs-21.2/src/s/darwin.h emacs-f/src/s/darwin.h
--- emacs-21.2/src/s/darwin.h	Wed Dec 31 19:00:00 1969
+++ emacs-f/src/s/darwin.h	Thu Oct 10 11:01:23 2002
@@ -0,0 +1,104 @@
+/* Configuration file for Darwin OS.
+   Copyright (C) 1997 Free Software Foundation, Inc.
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* We give these symbols the numeric values found in <sys/param.h> to
+   avoid warnings about redefined macros.  */
+#define BSD 199506
+#define BSD4_3 1
+#define BSD4_4 1
+
+#include "bsd4-3.h"
+
+/* SYSTEM_TYPE should indicate the kind of system you are using.
+   It sets the Lisp variable system-type.  We'll need to undo the bsd one. */
+
+#undef SYSTEM_TYPE
+#define SYSTEM_TYPE "darwin"
+
+#ifndef DARWIN
+#define DARWIN
+#endif
+
+#undef KERNEL_FILE
+#define KERNEL_FILE "/mach_kernel"
+
+#define HAVE_ALLOCA
+
+#define HAVE_MACH_MACH_H
+
+#define SYSTEM_MALLOC
+
+#define WAIT_USE_INT
+
+#define SOCKLEN_TYPE int
+
+#define GETPGRP_NO_ARG
+
+#ifdef HAVE_LIBNCURSES
+#define TERMINFO
+#define LIBS_TERMCAP -lncurses
+#else
+#define TERMCAP_FILE "/usr/share/misc/termcap" 
+#endif
+
+#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
+
+#define A_OUT_H_FILE <sys/exec.h>
+
+/* Data type of load average, as read out of kmem.  */
+#define LOAD_AVE_TYPE long
+
+#define ABORT_RETURN_TYPE __private_extern__ void
+
+/* Convert that into an integer that is 100 for a load average of 1.0  */
+#define LOAD_AVE_CVT(x) (int) (((double)(x)) * 100.0 / FSCALE)
+
+#define UNEXEC unexdyld.o
+
+/* Definitions for how to compile & link.  */
+
+/* Link this program just by running cc.  */
+#define ORDINARY_LINK
+
+/* #define C_SWITCH_SYSTEM */
+
+/* We don't have a g library, so override the -lg LIBS_DEBUG switch */
+#define LIBS_DEBUG
+
+/* Adding -lm confuses the dynamic linker, so omit it. */
+#define LIB_MATH
+
+/* Definitions for how to dump.  */
+
+#define START_FILES pre-crt0.o
+
+/* start_of_text isn't actually used, so make it compile without error.  */
+#define TEXT_START (0)
+
+/* This seems to be right for end_of_text, but it may not be used anyway.  */
+#define TEXT_END get_etext()
+
+/* This seems to be right for end_of_data, but it may not be used anyway.  */
+#define DATA_END get_edata()
+
+/* Don't close pty in process.c to make it a controlling terminal.  It is
+ * already the controlling terminal of the subprocess, because we did ioctl
+ * TIOCSCTTY.  */
+#define DONT_REOPEN_PTY
diff -u -Naur emacs-21.2/src/s/rhapsody.h emacs-f/src/s/rhapsody.h
--- emacs-21.2/src/s/rhapsody.h	Wed Dec 31 19:00:00 1969
+++ emacs-f/src/s/rhapsody.h	Thu Oct 10 11:01:23 2002
@@ -0,0 +1,89 @@
+/* Configuration file for Mac OS X Server.
+   Copyright (C) 1997 Free Software Foundation, Inc.
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* We give these symbols the numeric values found in <sys/param.h> to
+   avoid warnings about redefined macros.  */
+#define BSD 199506
+#define BSD4_3 1
+#define BSD4_4 1
+
+#include "bsd4-3.h"
+
+/* SYSTEM_TYPE should indicate the kind of system you are using.
+   It sets the Lisp variable system-type.  We'll need to undo the bsd one. */
+
+#undef SYSTEM_TYPE
+#define SYSTEM_TYPE "apple-rhapsody"
+
+#ifndef RHAPSODY
+#define RHAPSODY
+#endif
+
+#define HAVE_ALLOCA
+
+#define HAVE_MACH_MACH_H
+
+#define SYSTEM_MALLOC
+
+#define WAIT_USE_INT
+
+#define SOCKLEN_TYPE int
+
+#define GETPGRP_NO_ARG
+
+#define TERMCAP_FILE "/usr/share/misc/termcap"
+
+#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
+
+#define A_OUT_H_FILE <sys/exec.h>
+
+/* Data type of load average, as read out of kmem.  */
+#define LOAD_AVE_TYPE long
+
+/* Convert that into an integer that is 100 for a load average of 1.0  */
+#define LOAD_AVE_CVT(x) (int) (((double)(x)) * 100.0 / FSCALE)
+
+#define UNEXEC unexdyld.o
+
+/* Definitions for how to compile & link.  */
+
+/* Link this program just by running cc.  */
+#define ORDINARY_LINK
+
+/* #define C_SWITCH_SYSTEM */
+
+/* We don't have a g library, so override the -lg LIBS_DEBUG switch */
+#define LIBS_DEBUG
+
+/* Adding -lm confuses the dynamic linker, so omit it. */
+#define LIB_MATH
+
+/* Definitions for how to dump.  */
+
+#define START_FILES pre-crt0.o
+
+/* start_of_text isn't actually used, so make it compile without error.  */
+#define TEXT_START (0)
+
+/* This seems to be right for end_of_text, but it may not be used anyway.  */
+#define TEXT_END get_etext()
+
+/* This seems to be right for end_of_data, but it may not be used anyway.  */
+#define DATA_END get_edata()
diff -u -Naur emacs-21.2/src/sysdep.c emacs-f/src/sysdep.c
--- emacs-21.2/src/sysdep.c	Mon Nov 19 09:48:11 2001
+++ emacs-f/src/sysdep.c	Thu Oct 10 11:01:23 2002
@@ -813,7 +813,11 @@
   synch_process_alive = 1;
 #endif /* __DJGPP__ > 1 */
 #else  
+#ifndef PUMA_VFORK_ISSUES_CLEARED_UP
+  pid = fork ();
+#else
   pid = vfork ();
+#endif
   if (pid == -1)
     error ("Can't spawn subshell");
 #endif
diff -u -Naur emacs-21.2/src/termcap.c emacs-f/src/termcap.c
--- emacs-21.2/src/termcap.c	Mon May 28 07:58:27 2001
+++ emacs-f/src/termcap.c	Thu Oct 10 11:01:23 2002
@@ -144,6 +144,9 @@
   return NULL;
 }
 
+#ifdef __APPLE_CC__
+__private_extern__
+#endif
 int
 tgetnum (cap)
      char *cap;
@@ -154,6 +157,9 @@
   return atoi (ptr);
 }
 
+#ifdef __APPLE_CC__
+__private_extern__
+#endif
 int
 tgetflag (cap)
      char *cap;
@@ -167,6 +173,9 @@
    to store the string.  That pointer is advanced over the space used.
    If AREA is null, space is allocated with `malloc'.  */
 
+#ifdef __APPLE_CC__
+__private_extern__
+#endif
 char *
 tgetstr (cap, area)
      char *cap;
@@ -291,6 +300,9 @@
 
 /* If OSPEED is 0, we use this as the actual baud rate.  */
 int tputs_baud_rate;
+#ifdef __APPLE_CC__
+__private_extern__
+#endif
 char PC;
 
 #if 0 /* Doesn't seem to be used anymore.  */
@@ -311,6 +323,9 @@
 
 #endif /* 0  */
 
+#ifdef __APPLE_CC__
+__private_extern__
+#endif
 void
 tputs (str, nlines, outfun)
      register char *str;
@@ -436,6 +451,9 @@
    0 if the data base is accessible but the type NAME is not defined
    in it, and some other value otherwise.  */
 
+#ifdef __APPLE_CC__
+__private_extern__
+#endif
 int
 tgetent (bp, name)
      char *bp, *name;
diff -u -Naur emacs-21.2/src/tparam.c emacs-f/src/tparam.c
--- emacs-21.2/src/tparam.c	Fri Dec  8 04:58:48 2000
+++ emacs-f/src/tparam.c	Thu Oct 10 11:01:23 2002
@@ -110,6 +110,9 @@
 
 static char tgoto_buf[50];
 
+#ifdef __APPLE_CC__
+__private_extern__
+#endif
 char *
 tgoto (cm, hpos, vpos)
      char *cm;
diff -u -Naur emacs-21.2/src/unexdyld.c emacs-f/src/unexdyld.c
--- emacs-21.2/src/unexdyld.c	Wed Dec 31 19:00:00 1969
+++ emacs-f/src/unexdyld.c	Thu Oct 10 11:06:05 2002
@@ -0,0 +1,996 @@
+/* Dump Emacs in macho format.
+   Copyright (C) 1990, 1993 Free Software Foundation, Inc.
+   Derived from unexnext.c by Bradley Taylor (btaylor@next.com).
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#include "config.h"
+#include <stdio.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <libc.h>
+#include <mach-o/nlist.h>
+#include <mach/mach.h>
+#ifndef NeXT
+#include <mach/machine/vm_param.h>
+#endif
+#include <mach-o/ldsyms.h>
+#include <mach-o/loader.h>
+#include <mach-o/reloc.h>
+
+extern int malloc_freezedry (void);
+
+int malloc_cookie;
+
+#define VERBOSE
+
+#ifdef VERBOSE
+#define SHOW_MCOPY_WRITES
+#define SHOW_MCOPY_READS
+#endif
+
+typedef struct region_t
+{
+  struct region_t *next;
+  vm_address_t address;
+  vm_size_t size;
+  vm_prot_t protection;
+  vm_prot_t max_protection;
+
+  /* And some info about where it was written to disk. */
+  unsigned long file_offset;
+  unsigned long file_size;
+} region_t;
+
+typedef struct section_list_t
+{
+  struct section_list_t *next;
+  struct section section;
+} section_list_t;
+
+static void fatal_unexec (char *format, ...)
+{
+  va_list ap;
+   
+  va_start (ap, format);
+  fprintf (stderr, "unexec: ");
+  vfprintf (stderr, format, ap);
+  fprintf (stderr, "\n");
+  va_end (ap);
+  exit (1);
+}
+
+static void print_region (struct region_t *region)
+{
+  printf ("0x%8lx - 0x%8lx, length: 0x%8lx, protection: %c%c%c, max_protection: %c%c%c\n",
+	  region->address, region->address + region->size, region->size,
+	  (region->protection & VM_PROT_READ) ? 'r' : '-',
+	  (region->protection & VM_PROT_WRITE) ? 'w' : '-',
+	  (region->protection & VM_PROT_EXECUTE) ? 'x' : '-',
+	  (region->max_protection & VM_PROT_READ) ? 'r' : '-',
+	  (region->max_protection & VM_PROT_WRITE) ? 'w' : '-',
+	  (region->max_protection & VM_PROT_EXECUTE) ? 'x' : '-');
+}
+
+static void print_regions (struct region_t *regions)
+{
+  while (regions != NULL)
+    {
+      print_region (regions);
+      regions = regions->next;
+    }
+}
+
+static void print_section (struct section *section)
+{
+  printf ("0x%8lx - 0x%8lx, length: 0x%8lx, offset: 0x%8lx\n",
+	  section->addr, section->addr + section->size, section->size, section->offset);
+}
+
+static void print_sections (section_list_t *sections)
+{
+  while (sections != NULL)
+    {
+      print_section (&(sections->section));
+      sections = sections->next;
+    }
+}
+
+static section_list_t *create_new_section_list(struct section *section_pointer)
+{
+    section_list_t *section_list;
+
+    section_list = malloc (sizeof (section_list_t));
+    section_list->next = NULL;
+    section_list->section = *section_pointer;
+
+    return section_list;
+}
+
+static void append_section_list(section_list_t **first_list, section_list_t *last_list)
+{
+    section_list_t *current;
+
+    if (*first_list == NULL) {
+        *first_list = last_list;
+        return;
+    }
+
+    current = *first_list;
+    while (current->next != NULL)
+        current = current->next;
+
+    current->next = last_list;
+}
+
+static void free_section_list(section_list_t *section_list)
+{
+    section_list_t *next;
+
+    while (section_list != NULL)
+    {
+        next = section_list->next;
+        free(section_list);
+        section_list = next;
+    }
+}
+
+static void add_sections_from_segment(section_list_t **all_sections, struct segment_command *segment)
+{
+    struct section *section_pointer;
+    int index;
+
+    section_pointer = (struct section *)(segment + 1);
+    for (index = 0; index < segment->nsects; index++) {
+        append_section_list (all_sections, create_new_section_list (section_pointer));
+        section_pointer++;
+    }
+}
+
+static int section_with_address (section_list_t *sections, unsigned long address)
+{
+    int current_section, found_section;
+
+    found_section = 0;
+    current_section = 1;
+    while (sections != NULL)
+    {
+        if (address >= sections->section.addr && address < sections->section.addr + sections->section.size) {
+            found_section = current_section;
+            break;
+        }
+        sections = sections->next;
+        current_section++;
+    }
+
+    return found_section;
+}
+
+/*
+ * Copy len bytes from ffd@fpos to tfd@tpos.
+ * If both file descriptors are -1, copy in memory (handles overlapping copies).
+ * If either ffd or tfd are -1, either read or write len bytes.
+ */
+
+static void mcopy (int ffd, int tfd,
+                   unsigned long fpos, unsigned long tpos, unsigned long len, char *reason)
+{
+  if ((ffd == -1) && (tfd == -1))
+    {
+      char *f, *t, *e;
+      if (fpos > tpos)
+        {
+	  f = (char *)fpos;
+	  t = (char *)tpos;
+	  e = (char *)(fpos + len);
+	  while (f < e) *t++ = *f++;
+        }
+      else if (tpos > fpos)
+        {
+	  f = (char *)(fpos + len);
+	  t = (char *)(tpos + len);
+	  e = (char *)fpos;
+	  while (f > e) *--t = *--f;         
+        }   
+#ifdef SHOW_MCOPY_READS
+      printf ("read: %10lu - %10lu, length: %10lu [from MEM]  (%s)\n", tpos, tpos+len, len, reason);
+#endif
+    }
+  else if (ffd == -1)
+    {
+      if (lseek (tfd, tpos, L_SET) < 0)
+	fatal_unexec ("cannot seek target");
+      if (write (tfd, (void *)fpos, len) != len)
+	fatal_unexec ("cannot write target");
+#ifdef SHOW_MCOPY_WRITES
+      printf ("write: %10lu - %10lu, length: %10lu [from MEM]  (%s)\n", tpos, tpos+len, len, reason);
+#endif
+    }
+  else if (tfd == -1)
+    {
+      if (lseek (ffd, fpos, L_SET) < 0)
+	fatal_unexec ("cannot seek source");
+      if (read (ffd, (void *)tpos, len) != len)
+	fatal_unexec ("cannot read source");
+#ifdef SHOW_MCOPY_READS
+      printf ("read: %10lu - %10lu, length: %10lu [from DISK] (%s)\n", tpos, tpos+len, len, reason);
+#endif
+    }
+  else
+    {
+      int bread;
+      char *buf = alloca (1 << 16);
+
+#ifdef SHOW_MCOPY_WRITES
+      printf ("write: %10lu - %10lu, length: %10lu [from DISK] (%s)\n", tpos, tpos+len, len, reason);
+#endif
+
+      if (lseek (ffd, fpos, L_SET) < 0)
+	fatal_unexec ("cannot seek source");
+      
+      if (lseek (tfd, tpos, L_SET) < 0)
+	fatal_unexec ("cannot seek target");
+      
+      while((len > 0) && (bread = read (ffd, buf, MIN(1 << 16, len))) > 0)
+        {
+	  if (bread < 0)
+	    fatal_unexec ("cannot read source");
+	  if (write (tfd, buf, bread) != bread)
+	    fatal_unexec ("cannot write target");
+	  len -= bread;
+        }
+    }
+}
+
+/*
+ * The process of dumping (or unexecing) is the opposite of exec().
+ * It takes the original executable and parts of memory that have been
+ * loaded with data, and creates a new executable.  This allows
+ * standard lisp files to be loaded "instantly", because they are part
+ * of the executable.
+ *
+ * This involves using vm_region() to build a list of allocated memory
+ * regions, combining adjacent "similar" regions to reduce their
+ * number, skipping read-only regions and parts of regions covered by
+ * non-data segment load commands, and finally replacing the (usually
+ * one) data segment with a new segment for each region.
+ *
+ * File offsets in load commands that follow the data segment must be
+ * adjusted by the change in size of the data segment.  The size of
+ * the load commands can increase without affecting file offsets --
+ * see the note below.
+ *
+ * Data associated with the LC_SYMTAB and LC_DYSYMTAB is found in the
+ * __LINKEDIT segment -- there is no extra data to be written for
+ * these load commands.
+ *
+ * Relocatable symbols from the data segment, which we took from
+ * memory, need to be unrelocated.  The relocatable address is found
+ * in the new mach-o file and then zeroed out.  Failure to do this
+ * typically results in a segmentation fault, with the offending
+ * address being double what it is at the same point in temacs, since
+ * it has been relocated twice.
+ *
+ * Be sure to study the loader.h file if you want to understand this.
+ * otool -lv shows the load commands of the file, and is very useful
+ * when debugging this code.  Also, 'size -m -x -l' gives a short
+ * list of the sections, and 'nm -maxp' and 'nm -map' are useful
+ * for the symbol table stuff.
+ *
+ * Note: This is not obvious, but the __TEXT section usually has a
+ *       file offset of 0, and so when it is written it will overwrite
+ *       any mach headers or load commands that have already been
+ *       written...  How much room is there before critial parts are
+ *       overwritten when we add load commands?
+ *
+ *    -- Steve Nygard
+ */
+
+static void unexec_doit(int infd,int outfd)
+{
+  int i, j, l, header_position, output_position;
+  region_t *regions = NULL, *cregion, **pregions;
+  struct mach_header mach_header;
+  struct load_command *load_command, *original_load_commands;
+  struct segment_command *segment_pointer;
+  struct symtab_command *symtab_pointer;
+  struct section *section_pointer;
+  section_list_t *all_sections = NULL;
+
+  unsigned long delta = 0;
+#if defined(NS_TARGET) || !defined(NeXT)
+  struct dysymtab_command *dysymtab;
+  struct twolevel_hints_command *hinttab;
+  unsigned long extreloff = 0;
+  unsigned long nextrel = 0;
+  unsigned long locreloff = 0;
+  unsigned long nlocrel = 0;
+  struct relocation_info reloc_info;
+  unsigned long fixed_reloc_count = 0;
+#endif
+
+  struct segment_command new_data_segment;
+  section_list_t *original_sections, *new_sections, **sect_ptr, *section_item;
+
+  malloc_cookie = malloc_freezedry();
+#ifdef VERBOSE
+  printf ("malloc_cookie: %lx\n", malloc_cookie);
+#endif
+  if (malloc_cookie == 0)
+    {
+      fprintf(stderr, "Error in malloc_freezedry()\n");
+      abort();
+    }
+
+  {
+    vm_address_t address;
+    vm_size_t size;
+    mach_port_t object_name;
+#ifdef DARWIN
+    task_t task = mach_task_self();
+    struct vm_region_basic_info info;
+    mach_msg_type_number_t info_count = VM_REGION_BASIC_INFO_COUNT;
+#else
+    task_t task = task_self();
+    vm_prot_t protection, max_protection;
+    vm_inherit_t inheritance;
+    boolean_t shared;
+    vm_offset_t offset;
+#endif
+
+    for (address = VM_MIN_ADDRESS, pregions = &regions;
+#ifdef DARWIN
+	 vm_region(task, &address, &size, VM_REGION_BASIC_INFO, 
+		   (vm_region_info_t)&info, &info_count, &object_name) == KERN_SUCCESS;
+#else
+	 vm_region(task, &address, &size, &protection, &max_protection,
+		   &inheritance, &shared, &object_name, &offset) == KERN_SUCCESS;
+#endif
+	 address += size)
+      {
+	(*pregions) = alloca (sizeof(region_t));
+	(*pregions)->address = address;
+	(*pregions)->size = size;
+#ifdef DARWIN
+	(*pregions)->protection = info.protection;
+	(*pregions)->max_protection = info.max_protection;
+#else
+	(*pregions)->protection = protection;
+	(*pregions)->max_protection = max_protection;
+#endif
+	(*pregions)->file_offset = 0;
+	(*pregions)->file_size = 0;
+	(*pregions)->next = 0;
+	pregions = &((*pregions)->next);
+#ifdef DARWIN
+	if (object_name != MACH_PORT_NULL)
+	  mach_port_deallocate(mach_task_self(), object_name);
+	info_count = VM_REGION_BASIC_INFO_COUNT;
+#endif
+      }
+  }
+#ifdef VERBOSE   
+  printf ("Regions.\n");
+  print_regions (regions);
+  printf ("----------------------------------------------------------------------\n");
+#endif
+   
+  /*
+   * Concatenate regions that are adjacent in memory and share the same
+   * protection attributes.
+   */
+
+  for (cregion = regions; cregion; cregion = cregion->next)
+    {
+      while ((cregion->next) &&
+	     (cregion->next->address == cregion->address + cregion->size) &&
+	     (cregion->next->protection == cregion->protection) &&
+	     (cregion->next->max_protection == cregion->max_protection))
+        {
+	  cregion->size += cregion->next->size;
+	  cregion->next = cregion->next->next;
+        }
+    }
+#ifdef VERBOSE   
+  printf ("Concatenated regions.\n");
+  print_regions (regions);
+  printf ("----------------------------------------------------------------------\n");
+#endif
+
+  /*
+   * Remove read-only regions, and regions above a fixed limit.
+   * Could have been done before allocating, but this way we can show
+   * the regions before and after while debugging.
+   */
+
+  for (pregions = &regions; *pregions != NULL;)
+    {
+      if ( !((*pregions)->protection & VM_PROT_WRITE)
+	   || ((*pregions)->address >= 0x3000000))
+        {
+	  *pregions = (*pregions)->next;
+        }
+      else
+        {
+	  pregions = &((*pregions)->next);
+        }
+    }
+#ifdef VERBOSE
+  printf ("Skipped regions.\n");
+  print_regions (regions);
+  printf ("----------------------------------------------------------------------\n");
+#endif
+  /*
+     * Read original mach header and load commands.
+     */
+
+  mcopy (infd, -1, 0, (unsigned long) &mach_header, sizeof(mach_header), "read original mach header");
+  original_load_commands = alloca (mach_header.sizeofcmds);
+  mcopy (infd, -1, sizeof(mach_header), (unsigned long) original_load_commands, mach_header.sizeofcmds,
+         "read original load comands");
+
+  /*
+     * Skip (or adjust) regions that intersect memory represented by non-data
+     * segments from the original load commands.
+     */
+
+  for (pregions = &regions; *pregions;)
+    {
+      for (load_command = original_load_commands, i = 0;
+	   i < mach_header.ncmds;
+	   i++, load_command = (struct load_command *)(((void *)load_command) + load_command->cmdsize))
+        {
+	  unsigned long ob, oe;
+	  segment_pointer = (struct segment_command *)load_command;
+	  if (segment_pointer->cmd != LC_SEGMENT || (strcmp (segment_pointer->segname, SEG_DATA) == 0)) continue;
+	  ob = MAX((*pregions)->address, segment_pointer->vmaddr);
+	  oe = MIN((*pregions)->address + (*pregions)->size, segment_pointer->vmaddr + segment_pointer->vmsize);
+	  if (ob >= oe) continue;
+	  if (ob == (*pregions)->address)
+            {
+	      if (oe == (*pregions)->address + (*pregions)->size)
+                {
+		  goto skip_region;
+                }
+	      else
+                {
+		  (*pregions)->address = oe;
+		  (*pregions)->size -= (oe - ob);
+                }
+            }
+	  else
+            {
+	      if (oe == (*pregions)->address + (*pregions)->size)
+                {
+		  (*pregions)->size -= (oe - ob);
+                }
+	      else
+                {
+		  cregion = alloca (sizeof(*cregion));
+		  cregion->address = oe;
+		  cregion->size = ((*pregions)->address + (*pregions)->size) - oe;
+		  cregion->protection = (*pregions)->protection;
+		  cregion->max_protection = (*pregions)->max_protection;
+		  cregion->file_offset = 0;
+		  cregion->file_size = 0;
+		  cregion->next = (*pregions)->next;
+		  (*pregions)->size = ob - (*pregions)->address;
+		  (*pregions)->next = cregion;
+                }
+            }
+        }
+
+      pregions = &((*pregions)->next);
+      continue;
+
+    skip_region:
+      *pregions = (*pregions)->next;
+    }
+#ifdef VERBOSE
+  printf ("Munged regions (1).\n");
+  print_regions (regions);
+  printf ("----------------------------------------------------------------------\n");
+#endif
+
+  for (load_command = original_load_commands, i = mach_header.ncmds, header_position = sizeof(mach_header), output_position = 0;
+       i > 0;
+       i--, load_command = (struct load_command *)(((void *)load_command) + load_command->cmdsize))
+    {
+      switch (load_command->cmd)
+        {
+	case LC_SEGMENT:
+	  segment_pointer = (struct segment_command *)load_command;
+
+	  if (strcmp (segment_pointer->segname, SEG_DATA) == 0)
+	    {
+#if 1
+	      unsigned long current_address;
+
+	      original_sections = NULL;
+	      new_sections = NULL;
+	      sect_ptr = &original_sections;
+
+	      section_pointer = (struct section *)(segment_pointer + 1);
+	      for (l = 0; l < segment_pointer->nsects; l++)
+		{
+		  if (!strncmp (section_pointer->sectname, "__la_symbol_ptr", 16))
+		    {
+		      section_item = alloca (sizeof (section_list_t));
+		      section_item->next = *sect_ptr;
+		      section_item->section = *section_pointer;
+		      *sect_ptr = section_item;
+		      sect_ptr = &(section_item->next);
+		    }
+		  else if (!strncmp (section_pointer->sectname, "__nl_symbol_ptr", 16))
+		    {
+		      section_item = alloca (sizeof (section_list_t));
+		      section_item->next = *sect_ptr;
+		      section_item->section = *section_pointer;
+		      *sect_ptr = section_item;
+		      sect_ptr = &(section_item->next);
+		    }
+		  else if (!strncmp (section_pointer->sectname, "__dyld", 16))
+		    {
+		      section_item = alloca (sizeof (section_list_t));
+		      section_item->next = *sect_ptr;
+		      section_item->section = *section_pointer;
+		      *sect_ptr = section_item;
+		      sect_ptr = &(section_item->next);
+		    }
+
+		  section_pointer++;
+		}
+
+	      cregion = regions;
+	      /* new_data_segment */
+	      new_data_segment.cmd = LC_SEGMENT;
+	      strncpy (new_data_segment.segname, SEG_DATA, 16);
+	      new_data_segment.vmaddr = cregion->address;
+	      new_data_segment.vmsize = 0;
+	      new_data_segment.fileoff = 0;
+	      new_data_segment.filesize = 0;
+	      new_data_segment.maxprot = cregion->max_protection;
+	      new_data_segment.initprot = cregion->protection;
+	      new_data_segment.flags = segment_pointer->flags;
+	      new_data_segment.nsects = 0;
+	      new_data_segment.cmdsize = sizeof (struct segment_command);
+#ifdef VERBOSE
+	      printf ("Original sections:\n");
+	      print_sections (original_sections);
+	      printf ("----------------------------------------------------------------------\n");
+#endif
+	      /* Create list of new segments */
+	      sect_ptr = &new_sections;
+	      current_address = new_data_segment.vmaddr;
+	      while (original_sections != NULL)
+		{
+		  if (current_address < original_sections->section.addr)
+		    {
+		      /* Create new section for this. */
+		      section_item = alloca (sizeof (section_list_t));
+		      section_item->next = *sect_ptr;
+
+		      section_pointer = &(section_item->section);
+		      strncpy (section_pointer->sectname, "__data", 16);
+		      strncpy (section_pointer->segname, SEG_DATA, 16);
+		      section_pointer->addr = current_address;
+		      section_pointer->size = original_sections->section.addr - current_address;
+		      section_pointer->offset = 0;
+		      section_pointer->align = 2; /* Yuck. */
+		      section_pointer->reloff = 0;
+		      section_pointer->nreloc = 0;
+		      section_pointer->flags = 0; /* S_REGULAR? */
+		      section_pointer->reserved1 = 0;
+		      section_pointer->reserved2 = 0;
+
+		      *sect_ptr = section_item;
+		      sect_ptr = &(section_item->next);
+		      current_address = original_sections->section.addr;
+		    }
+
+		  /* Put/copy this section into new list */
+		  section_item = original_sections;
+		  original_sections = original_sections->next;
+		  section_item->next = *sect_ptr; /* Should be NULL... */
+		  *sect_ptr = section_item;
+		  sect_ptr = &(section_item->next);
+
+		  /* increase current address */
+		  current_address += section_item->section.size;
+		}
+	      /* if current address < end of region, add final section. */
+	      if (current_address < cregion->address + cregion->size)
+		{
+		  /* Create new section for this. */
+		  section_item = alloca (sizeof (section_list_t));
+		  section_item->next = *sect_ptr;
+
+		  section_pointer = &(section_item->section);
+		  strncpy (section_pointer->sectname, "__data", 16);
+		  strncpy (section_pointer->segname, SEG_DATA, 16);
+		  section_pointer->addr = current_address;
+		  section_pointer->size = cregion->address + cregion->size - current_address;
+		  section_pointer->offset = 0;
+		  section_pointer->align = 2; /* Yuck. */
+		  section_pointer->reloff = 0;
+		  section_pointer->nreloc = 0;
+		  section_pointer->flags = 0; /* S_REGULAR? */
+		  section_pointer->reserved1 = 0;
+		  section_pointer->reserved2 = 0;
+
+		  *sect_ptr = section_item;
+		  sect_ptr = &(section_item->next);
+
+		}
+#ifdef VERBOSE
+	      printf ("New sections:\n");
+	      print_sections (new_sections);
+	      printf ("----------------------------------------------------------------------\n");
+#endif
+	      /**
+	       * Go through new list of sections
+	       *  - write section to disk, either from memory or original file
+	       *  - say, if offset == 0, take from memory, otherwise from original file at that offset
+	       *  - set offset of section
+	       *  - set fileoff of segment to be that of the first section
+	       *  - increase output position
+	       **/
+
+	      sect_ptr = &new_sections;
+	      while (*sect_ptr != NULL)
+		{
+		  section_pointer = &((*sect_ptr)->section);
+		  if (new_data_segment.fileoff == 0)
+		    new_data_segment.fileoff = output_position;
+		  new_data_segment.vmsize += section_pointer->size;
+		  new_data_segment.filesize += section_pointer->size;
+		  new_data_segment.nsects++;
+		  new_data_segment.cmdsize += sizeof (struct section);
+                  printf ("section is '%s'\n", section_pointer->sectname);
+		  if (section_pointer->offset == 0)
+		    {
+		      mcopy (-1, outfd, (unsigned long) section_pointer->addr, output_position, section_pointer->size,
+                             "SEG_DATA: write section data from memory");
+		    }
+		  else
+		    {
+		      mcopy (infd, outfd, (unsigned long) section_pointer->offset, output_position, section_pointer->size,
+                             "SEG_DATA: write section data from original file");
+		    }
+		  section_pointer->offset = output_position;
+		  output_position += section_pointer->size;
+
+		  sect_ptr = &((*sect_ptr)->next);
+		}
+
+	      /* Write data segment and sections, increasing the header position */
+	      mcopy (-1, outfd, (unsigned long) &new_data_segment, header_position, sizeof (struct segment_command),
+                     "SEG_DATA: write segment command");
+	      header_position += sizeof (struct segment_command);
+	      while (new_sections != NULL)
+		{
+		  mcopy (-1, outfd, (unsigned long) &(new_sections->section), header_position, sizeof (struct section),
+                         "SEG_DATA: write section command");
+                  // Need to add this section to a list of all the sections
+		  header_position += sizeof (struct section);
+                  append_section_list (&all_sections, create_new_section_list (&(new_sections->section)));
+		  new_sections = new_sections->next;
+		}
+	      mach_header.ncmds++;
+
+	      /* Finally, skip first data segment. */
+	      regions = regions->next;
+#endif
+
+#if 1
+	      /* Write remainder of regions as data segments */
+	      mach_header.ncmds--;
+	      j = segment_pointer->cmdsize; /* Save original command size for loop. */
+	      for (cregion = regions; cregion != NULL; cregion = cregion->next)
+		{
+		  mcopy (-1, outfd, cregion->address, output_position, cregion->size,
+                         "SEG_DATA: write remainder data");
+		  segment_pointer->cmd = LC_SEGMENT;
+		  segment_pointer->cmdsize = sizeof(*segment_pointer);
+		  strncpy (segment_pointer->segname, SEG_DATA, sizeof(segment_pointer->segname));
+		  segment_pointer->vmaddr = cregion->address;
+		  segment_pointer->vmsize = cregion->size;
+		  segment_pointer->filesize = cregion->size;
+		  segment_pointer->maxprot = cregion->max_protection;
+		  segment_pointer->initprot = cregion->protection;
+		  segment_pointer->nsects = 0;
+		  segment_pointer->flags = 0;
+		  segment_pointer->fileoff = output_position;
+		  output_position += segment_pointer->filesize;
+		  mcopy (-1, outfd, (unsigned long)segment_pointer, header_position, segment_pointer->cmdsize,
+                         "SEG_DATA: write segment command for remainder data");
+		  header_position += segment_pointer->cmdsize;
+		  mach_header.ncmds++;
+
+		  cregion->file_offset = segment_pointer->fileoff;
+		  cregion->file_size = segment_pointer->filesize;
+		}
+	      segment_pointer->cmdsize = j;
+
+#endif
+	    }
+	  else
+	    {
+#ifdef VERBOSE
+              printf ("segment is '%s':\n", segment_pointer->segname);
+#endif
+	      mcopy (infd, outfd, segment_pointer->fileoff, output_position, segment_pointer->filesize,
+                     "SEG_OTHER: write segment data");
+	      section_pointer = (struct section *) (((void *)segment_pointer)+sizeof(*segment_pointer));
+	      for(j = 0; j < segment_pointer->nsects; j++)
+		{
+		  if (section_pointer[j].offset != 0)
+		    section_pointer[j].offset = (section_pointer[j].offset - segment_pointer->fileoff) + output_position;
+		  if (section_pointer[j].reloff != 0)
+		    section_pointer[j].reloff = (section_pointer[j].reloff - segment_pointer->fileoff) + output_position;
+		}
+
+	      if (strcmp (segment_pointer->segname, SEG_LINKEDIT) == 0)
+		{
+		  delta = output_position - segment_pointer->fileoff;
+		}
+
+	      segment_pointer->fileoff = output_position;
+	      output_position += segment_pointer->filesize;
+
+	      mcopy (-1, outfd, (unsigned long)load_command, header_position, load_command->cmdsize,
+                     "SEG_OTHER: write segment command and its sections");
+	      header_position += load_command->cmdsize;
+
+              // Now, scan the segments for sections, so we have a list of all the sections to use to fix up
+              // the symbol table entries.
+              add_sections_from_segment(&all_sections, segment_pointer);
+	    }
+	  break;
+
+	case LC_SYMTAB:
+        {
+            struct nlist *symtab;
+
+            symtab_pointer = (struct symtab_command *)load_command;
+
+            symtab = malloc(symtab_pointer->nsyms * sizeof(struct nlist));
+            mcopy(infd, -1, symtab_pointer->symoff, (unsigned long)symtab, symtab_pointer->nsyms * sizeof(struct nlist),
+                  "Read old symbol table into memory");
+
+            symtab_pointer->symoff += delta;
+            symtab_pointer->stroff += delta;
+            mcopy (-1, outfd, (unsigned long)load_command, header_position, load_command->cmdsize,
+                   "write symtab command");
+            header_position += load_command->cmdsize;
+            printf ("LC_SYMTAB: symoff = %ld, nsyms = %ld, stroff = %ld, strsize = %ld\n",
+                    symtab_pointer->symoff, symtab_pointer->nsyms, symtab_pointer->stroff, symtab_pointer->strsize);
+
+            // We've already written out the symbol table, but we're going to read it back in, adjust the
+            // symbol table entries, and write out the result again.
+
+            if (all_sections != NULL)
+            {
+                int index;
+                struct nlist *nlist_pointer;
+                section_list_t *section;
+                int section_index;
+                int changed_symtabs;
+
+                printf ("All sections:\n");
+                print_sections (all_sections);
+
+                changed_symtabs = 0;
+                nlist_pointer = symtab;
+
+                for (index = 0; index < symtab_pointer->nsyms; index++) {
+                    if ((nlist_pointer->n_type & N_TYPE) == N_SECT) {
+                        section_index = section_with_address(all_sections, nlist_pointer->n_value);
+#if 0
+                        printf ("%5d: 0x%08lx 0x%02x 0x%02x (0x%02x) 0x%04x 0x%08lx\n",
+                                index, nlist_pointer->n_un.n_strx, nlist_pointer->n_type & 0xff, nlist_pointer->n_sect & 0xff,
+                                section_index,
+                                nlist_pointer->n_desc & 0xffff, nlist_pointer->n_value);
+#endif
+                        if (nlist_pointer->n_sect != section_index) {
+                            nlist_pointer->n_sect = section_index;
+                            changed_symtabs++;
+                        }
+                    }
+                    nlist_pointer++;
+                }
+
+                printf ("Adjusted n_sect for %d symbol table entries.\n", changed_symtabs);
+                mcopy(-1, outfd, (unsigned long)symtab, symtab_pointer->symoff, symtab_pointer->nsyms * sizeof(struct nlist),
+                      "write updated symbol table");
+
+                free_section_list(all_sections);
+            }
+
+            free(symtab);
+        }
+        break;
+#if defined(NS_TARGET) || !defined(NeXT)
+	case LC_DYSYMTAB:
+	  dysymtab = (struct dysymtab_command *)load_command;
+	  extreloff = dysymtab->extreloff;
+	  nextrel = dysymtab->nextrel;
+
+	  locreloff = dysymtab->locreloff;
+	  nlocrel = dysymtab->nlocrel;
+
+	  if (dysymtab->nindirectsyms > 0) {
+	    dysymtab->indirectsymoff += delta;
+	  }
+	  if (nextrel > 0) {
+	    dysymtab->extreloff += delta;
+	  }
+
+	  if (nlocrel > 0) {
+	    dysymtab->locreloff += delta;
+	  }
+	  mcopy (-1, outfd, (unsigned long)load_command, header_position, load_command->cmdsize,
+                 "write dysymtab command");
+	  header_position += load_command->cmdsize;
+
+	  break;
+
+       case LC_TWOLEVEL_HINTS: 
+          hinttab = (struct twolevel_hints_command *)load_command;
+          hinttab->offset += delta;
+          
+          mcopy (-1, outfd, (unsigned long)load_command, header_position, load_command->cmdsize,
+                 "write two-level hint command");
+          header_position += load_command->cmdsize;
+
+          break;
+#endif
+	default:
+	  {
+	    char *reason, *cmdstr;
+
+	    /* Create a string that tells what load command is being left
+	     * alone. */
+	    switch (load_command->cmd)
+	      {
+	      case LC_UNIXTHREAD:
+		cmdstr = "LC_UNIXTHREAD";
+		break;
+	      case LC_LOAD_DYLIB:
+		cmdstr = "LC_LOAD_DYLIB";
+		break;
+	      case LC_LOAD_DYLINKER:
+		cmdstr = "LC_LOAD_DYLINKER";
+		break;
+	      default:
+		cmdstr = NULL;
+	      }
+	    if (cmdstr != NULL)
+	      {
+		asprintf(&reason, "write other load command (%s)", cmdstr);
+	      }
+	    else
+	      {
+		asprintf(&reason, "write other load command (0x%x)", load_command->cmd);
+	      }
+
+	    mcopy (-1, outfd, (unsigned long)load_command, header_position, load_command->cmdsize,
+		   reason);
+	    free(reason);
+	    header_position += load_command->cmdsize;
+	  }
+        }
+    }
+
+  mach_header.sizeofcmds = header_position - sizeof(mach_header);
+  mcopy (-1, outfd, (unsigned long) &mach_header, 0, sizeof(mach_header), "write mach header");
+
+#if defined(NS_TARGET) || !defined(NeXT)
+  if (mach_header.flags & MH_PREBOUND) {
+    /* Don't mess with prebound executables */
+    return;
+  }
+
+  /*
+     * Fix up relocation entries in the data segment(s).
+     */
+  if (lseek (infd, locreloff, L_SET) < 0)
+    fatal_unexec ("cannot seek input file");
+
+  fixed_reloc_count = 0;
+  for (i = 0; i < nlocrel; i++)
+    {
+      long zeroval = 0;
+      struct scattered_relocation_info *si;
+
+      if (read (infd, &reloc_info, sizeof(reloc_info)) != sizeof(reloc_info))
+	fatal_unexec ("cannot read input file");
+
+#if 1
+#ifdef VERBOSE
+      printf ("%2d: reloc: %lx, start: %lx, end: %lx\n", i, reloc_info.r_address,
+	      new_data_segment.vmaddr, new_data_segment.vmaddr + new_data_segment.filesize);
+#endif
+      if (reloc_info.r_address >= new_data_segment.vmaddr
+	  && reloc_info.r_address < new_data_segment.vmaddr + new_data_segment.filesize)
+        {
+	  fixed_reloc_count++;
+	  mcopy (-1, outfd, (unsigned long) &zeroval,
+		 new_data_segment.fileoff + reloc_info.r_address - new_data_segment.vmaddr,
+		 1 << reloc_info.r_length, "fix local relocation entry");
+        }
+#endif
+    }
+  printf ("Fixed %lu/%lu local relocation entries in data segment(s).\n", fixed_reloc_count, nlocrel);
+
+  if (lseek (infd, extreloff, L_SET) < 0)
+    fatal_unexec ("cannot seek input file");
+
+  for (i = 0; i < nextrel; i++)
+    {
+      long zeroval = 0;
+
+      if (read (infd, &reloc_info, sizeof(reloc_info)) != sizeof(reloc_info))
+	fatal_unexec ("cannot read input file");
+
+#if 1
+#ifdef VERBOSE
+      printf ("%2d: reloc: %lx, start: %lx, end: %lx\n", i, reloc_info.r_address,
+	      new_data_segment.vmaddr, new_data_segment.vmaddr + new_data_segment.filesize);
+#endif
+      if (reloc_info.r_address >= new_data_segment.vmaddr
+	  && reloc_info.r_address < new_data_segment.vmaddr + new_data_segment.filesize)
+        {
+	  fixed_reloc_count++;
+	  mcopy (-1, outfd, (unsigned long) &zeroval,
+		 new_data_segment.fileoff + reloc_info.r_address - new_data_segment.vmaddr,
+		 1 << reloc_info.r_length, "fix external relocation entry");
+        }
+#endif
+    }
+
+  printf ("Fixed %lu/%lu external relocation entries in data segment(s).\n", fixed_reloc_count, nextrel);
+
+#endif
+}
+
+void unexec (char *outfile, char *infile)
+{
+  char tmpfile[MAXPATHLEN + 1];
+  int infd, outfd;
+   
+  if ((infd = open (infile, O_RDONLY, 0)) < 0)
+    fatal_unexec ("cannot open input file `%s'", infile);
+
+  strcpy (tmpfile, outfile);
+  strcat (tmpfile, "-temp");
+   
+  if ((outfd = open (tmpfile, O_RDWR|O_TRUNC|O_CREAT, 0755)) < 0)
+    fatal_unexec ("cannot open temporary output file `%s'", tmpfile);
+
+  unexec_doit (infd, outfd);
+
+  close (infd);
+  close (outfd);
+  if (rename (tmpfile, outfile) < 0)
+    {
+      unlink (tmpfile);
+      fatal_unexec ("cannot rename `%s' to `%s'", tmpfile, outfile);
+    }  
+}
