diff -u -Naur emacs-20.7/Makefile.in emacs-20.7.fink/Makefile.in --- emacs-20.7/Makefile.in Fri Apr 9 15:16:24 1999 +++ emacs-20.7.fink/Makefile.in Tue Oct 1 12:09:44 2002 @@ -418,7 +418,7 @@ ### Build Emacs and install it, stripping binaries while installing them. install-strip: - $(MAKE) INSTALL_STRIP=-s + $(MAKE) INSTALL_STRIP=-s install ### Build all the directories we're going to install Emacs in. Since ### we may be creating several layers of directories (for example, diff -u -Naur emacs-20.7/configure emacs-20.7.fink/configure --- emacs-20.7/configure Mon Jun 12 16:05:56 2000 +++ emacs-20.7.fink/configure Tue Oct 1 12:09:45 2002 @@ -534,8 +534,8 @@ lispdir='${datadir}/emacs/${version}/lisp' -locallisppath='${datadir}/emacs/${version}/site-lisp:'\ -'${datadir}/emacs/site-lisp:${datadir}/emacs/${version}/leim' +locallisppath='@PREFIX@/etc/emacs20:@PREFIX@/etc/emacs:@PREFIX@/etc/lisp/emacs/20.7/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}' @@ -1055,6 +1055,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-20.7/configure.in emacs-20.7.fink/configure.in --- emacs-20.7/configure.in Mon Jun 5 11:42:49 2000 +++ emacs-20.7.fink/configure.in Tue Oct 1 12:09:45 2002 @@ -27,8 +27,8 @@ 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/emacs20:@PREFIX@/etc/emacs:/usr/local/share/emacs/20.7/site-lisp:'\ +'/usr/local/share/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}' @@ -495,6 +495,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-20.7/fix-info emacs-20.7.fink/fix-info --- emacs-20.7/fix-info Wed Dec 31 19:00:00 1969 +++ emacs-20.7.fink/fix-info Tue Oct 1 12:09:45 2002 @@ -0,0 +1,9 @@ +#!/bin/sh + +THE_INFO_PREFIX=$1 + +for file in ccmode cl dired-x ediff emacs forms gnus info message mh-e \ + reftex sc vip viper widget +do + ./mangle-info ${THE_INFO_PREFIX}/${file} +done diff -u -Naur emacs-20.7/lisp/startup.el emacs-20.7.fink/lisp/startup.el --- emacs-20.7/lisp/startup.el Sun Aug 1 21:12:00 1999 +++ emacs-20.7.fink/lisp/startup.el Tue Oct 1 12:09:45 2002 @@ -351,6 +351,10 @@ (defvar normal-top-level-add-subdirs-inode-list nil) +(defconst fink-emacs-flavor 'emacs20 + "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 @@ -686,9 +690,19 @@ ;; 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))) + ;; Register available input methods by loading LEIM list file. (load "leim-list.el" 'noerror 'nomessage 'nosuffix) diff -u -Naur emacs-20.7/lisp/startup.elc emacs-20.7.fink/lisp/startup.elc --- emacs-20.7/lisp/startup.elc Mon Jun 12 15:37:29 2000 +++ emacs-20.7.fink/lisp/startup.elc Tue Oct 1 12:09:45 2002 @@ -1,8 +1,8 @@ ;ELC -;;; Compiled by gerd@gerd.segv.de on Mon Jun 12 21:37:28 2000 -;;; from file /u2/emacs-20.7/lisp/startup.el +;;; Compiled by root@moth.ccs.brandeis.edu on Thu Dec 13 10:37:50 2001 +;;; from file /Users/cds/projects/local/home/emacs-20.7/lisp/startup.el ;;; in Emacs version 20.7.1 -;;; with bytecomp version 2.56 +;;; with bytecomp version 1.1.1.2 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. @@ -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 (#$ . 659)) +(defvar command-line-processed nil (#$ . 698)) (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 '(#$ . -845) :type 'boolean :group 'initialization) +(custom-declare-variable 'inhibit-startup-message 'nil '(#$ . -884) :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 '(#$ . -1114) :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 '(#$ . -1153) :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 '(#$ . -1834) :type 'boolean :group 'initialization) +(custom-declare-variable 'inhibit-default-init 'nil '(#$ . -1873) :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 (#$ . 1995)) +(defvar command-switch-alist nil (#$ . 2034)) #@46 List of command-line args not yet processed. -(defvar command-line-args-left nil (#$ . 2259)) +(defvar command-line-args-left nil (#$ . 2298)) #@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 (#$ . 2359)) +(defvar command-line-functions nil (#$ . 2398)) #@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 (#$ . 2811)) +(defvar command-line-default-directory nil (#$ . 2850)) #@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). -(defvar 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) ("-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) ("--border-color" 1 x-handle-switch border-width)) (#$ . 2995)) +(defvar 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) ("-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) ("--border-color" 1 x-handle-switch border-width)) (#$ . 3034)) #@78 Normal hook run after handling urgent options but before loading init files. -(defvar before-init-hook nil (#$ . 5361)) +(defvar before-init-hook nil (#$ . 5400)) #@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 (#$ . 5487)) +(defvar after-init-hook nil (#$ . 5526)) #@73 Normal hook run after loading init files and handling the command line. -(defvar emacs-startup-hook nil (#$ . 5798)) +(defvar emacs-startup-hook nil (#$ . 5837)) #@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 (#$ . 5921)) +(defvar term-setup-hook nil (#$ . 5960)) #@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 (#$ . 6211)) +(defvar keyboard-type nil (#$ . 6250)) #@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 (#$ . 6448)) +(defvar window-setup-hook nil (#$ . 6487)) #@68 Major mode command symbol to use for the initial *scratch* buffer. -(custom-declare-variable 'initial-major-mode ''lisp-interaction-mode '(#$ . 6649) :type 'function :group 'initialization) +(custom-declare-variable 'initial-major-mode ''lisp-interaction-mode '(#$ . 6688) :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 '(#$ . 6845) :type '(choice (const :tag "none" nil) string) :group 'initialization) +(custom-declare-variable 'init-file-user 'nil '(#$ . 6884) :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,7 +114,7 @@ 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" '(#$ . 7603) :type '(choice (const :tag "none" nil) string) :group 'initialization) +(custom-declare-variable 'site-run-file '"site-start" '(#$ . 7642) :type '(choice (const :tag "none" nil) string) :group 'initialization) #@437 Regexp that specifies when to enable an ISO 8859-N character set. We do that if this regexp matches the locale name specified by one of the environment variables LC_ALL, LC_CTYPE, or LANG. @@ -122,35 +122,38 @@ set number, N. Currently only Latin-[12345] are supported. (Note that Latin-5 is ISO 8859-9, because 8859-[678] are non-Latin alphabets; hence, supported values of N are [12349].) -(defconst iso-8859-n-locale-regexp "8859[-_]?\\([1-49]\\)\\>" (#$ . 8492)) +(defconst iso-8859-n-locale-regexp "8859[-_]?\\([1-49]\\)\\>" (#$ . 8531)) #@54 *Name of this machine, for purposes of naming users. -(custom-declare-variable 'mail-host-address 'nil '(#$ . -9009) :type '(choice (const nil) string) :group 'mail) +(custom-declare-variable 'mail-host-address 'nil '(#$ . -9048) :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 '(#$ . -9181) :type 'string :group 'mail) +(custom-declare-variable 'user-mail-address 'nil '(#$ . -9220) :type 'string :group 'mail) #@340 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, if you have not already set `auto-save-list-file-name' yourself. 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 '(if (eq system-type 'ms-dos) "~/_s" "~/.saves-") '(#$ . 9432) :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 '(if (eq system-type 'ms-dos) "~/_s" "~/.saves-") '(#$ . 9471) :type '(choice (const :tag "Don't record a session's auto save list" nil) string) :group 'auto-save) #@74 *File name for the system's file of locale-name aliases, or nil if none. -(defvar locale-translation-file-name (byte-code "\301\302@!\204A\211\204@)\207" [files ("/usr/lib/X11/locale/locale.alias" "/usr/X11R6/lib/X11/locale/locale.alias" "/usr/openwin/lib/locale/locale.alias" "/usr/share/locale/locale.alias") file-exists-p] 3) (#$ . -9994)) +(defvar locale-translation-file-name (byte-code "\301\302@!\204A\211\204@)\207" [files ("/usr/lib/X11/locale/locale.alias" "/usr/X11R6/lib/X11/locale/locale.alias" "/usr/openwin/lib/locale/locale.alias" "/usr/share/locale/locale.alias") file-exists-p] 3) (#$ . -10033)) (byte-code "\304\300!\204\305\300 B\304\302!\204\305\302 B\304\303!\204 \305\303 B\305\207" [init-file-debug current-load-list 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 'emacs20 (#$ . 10605)) #@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 \203p @ B A\307\310 @!\233\311 @! @\n \235\204l\n B\f\203l\f@\312\235\204e\313\314\f@\"\203e\313\315\f@\"\204e\316\f@!\203e\317\f@!\320\317\321\"!\204d C\244)\fA\211\2040*\202\322 \237A!+\207" [default-directory pending attrs dirs contents normal-top-level-add-subdirs-inode-list nil 10 file-attributes directory-files ("." ".." "RCS" "CVS") string-match "\\`[a-zA-Z0-9]" "\\.elc?\\'" file-directory-p expand-file-name file-exists-p ".nosearch" normal-top-level-add-to-load-path expanded] 5 (#$ . 10565)]) +(defalias 'normal-top-level-add-subdirs-to-load-path #[nil "\306\211C \203p @ B A\307\310 @!\233\311 @! @\n \235\204l\n B\f\203l\f@\312\235\204e\313\314\f@\"\203e\313\315\f@\"\204e\316\f@!\203e\317\f@!\320\317\321\"!\204d C\244)\fA\211\2040*\202\322 \237A!+\207" [default-directory pending attrs dirs contents normal-top-level-add-subdirs-inode-list nil 10 file-attributes directory-files ("." ".." "RCS" "CVS") string-match "\\`[a-zA-Z0-9]" "\\.elc?\\'" file-directory-p expand-file-name file-exists-p ".nosearch" normal-top-level-add-to-load-path expanded] 5 (#$ . 10771)]) (defalias 'normal-top-level-add-to-load-path #[(dirs) "\306 !\211\203'\n @\232\204'\f\307>\203 \n\227 @\227\232\204' A\211\204\n \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\203G@ B@\316\317\320@\"\310\211\211$\210)A\211\204'*\321=\204w\322\323!\211;\203v\324\325!\326P!\324\325 !\326P!\232\204v\327\330P\")\331 !\315 \332\216\333 *\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 load expand-file-name "subdirs.el" 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!!\312P\202&\311\313\314\n\315 \316 $!\317\320!\210\f\2033\317\304!\210\321\322!\203<\322 \210\321\323!\203E\323 \210 \203M\317\305!\210\204\\\324>\203\\\325 \210\306\207" [default-directory auto-save-list-file-name auto-save-list-file-prefix system-type term-setup-hook window-setup-hook abbreviate-file-name ms-dos make-temp-name expand-file-name "~" format "%s%d-%s~" emacs-pid system-name run-hooks emacs-startup-hook fboundp frame-notice-user-settings font-menu-add-default (x w32) precompute-menubar-bindings menubar-bindings-done window-system] 6)) command-line tail system-type pwd process-environment menubar-bindings-done] 6]) (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]) -(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!\310\320!\211\321=\204\212\f\322\230\204f\f\323\230\203k\324\202\212\f\325\230\204w\f\326\230\203|\321\202\212\f\327\230\204\210\f\330\230\203\212\331)\310\332!\211@\333\232?\205\231@)\206\276\310\334!\211@\333\232?\205\253@)\206\276\310\335!\211@\333\232?\205\275@)\211A\203\374B\203\374\336CA\"\204\374\337\340\341!!D\342\216rDq\210\343B!\210\344\345\346A!\347Q\321\324#\203\373`\321\210`{A+A\203N\336CA\"\203N\321\350\351A\"EFE\352\232\203\353E\354EPF\336\355F\"\203M\356F!\210G\204JH\357=\204JI\203J\360\361F\227!!\210\362 \210*)\n\363>\203^\364J\365K\202d\366L\365K\367\370\371\217\210\321MANOG?\205y\372 \211P\203\212P\373 \230\203\212\333PO\204\332N\203\332\374N@\321QRS\336\375R\"\203\277\336\376R\"\203\277R\377\225\321OQR\377\211\224ORR\201i\232\204\201jRS\"\211T\324=\203\342R\351\321OR\202 T;\203\n\201kTS\"\211U\204\376\367\201lR\"\210U@\351\321OR)\202 \321Q)R\201m\230\204 R\201n\230\203+\321PNAN\202\311R\201o\230\204=R\201p\230\203ZQ\204KNA\211N@QQP\321QNAN\202\311R\201q\230\203n\321VNAN\202\311R\201r\230\203\202\324WNAN\202\311R\201s\230\203\233\201tXBXNAN\202\311R\201u\230\204\266R\201v\230\204\266R\201w\230\203\306\201xYBYNAN\202\311\324OQ\203\326\367\201yR\"\210+\202\212M\203\345MN\241\210*\201z\201{!\203\365\201{ \210H\201|>\203\f\201}\201~ \236A\377V\203\201\324!\210\201\200\201\201!\210V\203(\201\202V\324\211#\210\201\202\201\203\201\204\201\205\201\206$\210\321Z\321\211W\324=\203K\201\207\202MWI[\\]^\\\201\210_`W\203l_ \210\202u\367\201\211\201\212\217\210`\\=\204\204\324]`^*]\203\216^`I\204\254[I=\204\254\201\213\201\214\201\215 \"\210\356a!\210,b\204\303\372 \201\216c\206\300\201\217 Qb\201\200\201\220!\210\201\221\201\222!\203\351\212\201\222q\210d\201\223=\203\350e \210)f\2035G\2045H\2045\310\201\224!\321g\211h\2034\201\202fhP\324\211#\2044\336\201\225h\"\211g\203-h\377gO\211h\202\321\211h\204*\201\226MA!\210G\205G\201\227\324!\207" [default-directory command-line-default-directory system-type temporary-file-directory vc version-control file-name-as-directory (ms-dos windows-nt) getenv "TEMP" "TMPDIR" "TMP" "c:/temp" (vax-vms axp-vms) "SYS$SCRATCH:" "/tmp" "VERSION_CONTROL" nil "t" "numbered" t "nil" "existing" "never" "simple" never "LC_ALL" "" "LC_CTYPE" "LANG" string-match get-buffer-create generate-new-buffer-name " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#1=#:temp-buffer buffer-name kill-buffer] 2)) insert-file-contents re-search-forward "^" regexp-quote ":?[ ]+" match-string 1 "9" "5" "latin-" "latin-[12345]" set-language-environment x set-terminal-coding-system intern standard-display-european-internal (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\320 \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 nil kill-emacs] 8))) user-login-name user-real-login-name (("--no-init-file") ("--no-site-file") ("--user") ("--debug-init") ("--iconic") ("--icon-type")) "\\`--" "=" 0 string ctype locale-translation-file-name iso-8859-n-locale-regexp #1# which charset noninteractive window-system default-enable-multibyte-characters eol-mnemonic-unix eol-mnemonic-mac eol-mnemonic-dos 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 inhibit-startup-message 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 "--" try-completion 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 frame-initialize (x w32) menu-bar-lines frame-parameters menu-bar-mode run-hooks before-init-hook load "leim-list.el" noerror nomessage nosuffix startup #[nil "\205S \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\f\206R\313\323\324\322\211#))\207" [init-file-user system-type user-init-file-1 user-init-file inhibit-default-init inhibit-startup-message ms-dos "~" "/_emacs" windows-nt directory-files nil "^\\.emacs\\(\\.elc?\\)?$" "~/.emacs" "~/_emacs" vax-vms "sys$login:.emacs" "/.emacs" t load "default"] 4] (byte-code " \210\302\302\207" [inner init-file-had-error nil] 1) ((error (byte-code "\302\303@\304NA\203\305\202\306\307\310A\311#$\210\312\302\207" [error init-file-had-error message "Error in init file: %s%s%s" error-message ": " "" mapconcat prin1-to-string ", " t] 8))) mapcar #[(buffer) "rq\210 \205 \302\303!)\207" [buffer enable-multibyte-characters set-buffer-multibyte nil] 2] buffer-list "@" system-name after-init-hook get-buffer "*scratch*" fundamental-mode "TERM" "[-_][^-_]+$" command-line-1 kill-emacs] 6]) +(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!\310\320!\211\321=\204\212\f\322\230\204f\f\323\230\203k\324\202\212\f\325\230\204w\f\326\230\203|\321\202\212\f\327\230\204\210\f\330\230\203\212\331)\310\332!\211@\333\232?\205\231@)\206\276\310\334!\211@\333\232?\205\253@)\206\276\310\335!\211@\333\232?\205\275@)\211A\203\374B\203\374\336CA\"\204\374\337\340\341!!D\342\216rDq\210\343B!\210\344\345\346A!\347Q\321\324#\203\373`\321\210`{A+A\203N\336CA\"\203N\321\350\351A\"EFE\352\232\203\353E\354EPF\336\355F\"\203M\356F!\210G\204JH\357=\204JI\203J\360\361F\227!!\210\362 \210*)\n\363>\203^\364J\365K\202d\366L\365K\367\370\371\217\210\321MANOG?\205y\372 \211P\203\212P\373 \230\203\212\333PO\204\332N\203\332\374N@\321QRS\336\375R\"\203\277\336\376R\"\203\277R\377\225\321OQR\377\211\224ORR\201j\232\204\201kRS\"\211T\324=\203\342R\351\321OR\202 T;\203\n\201lTS\"\211U\204\376\367\201mR\"\210U@\351\321OR)\202 \321Q)R\201n\230\204 R\201o\230\203+\321PNAN\202\311R\201p\230\204=R\201q\230\203ZQ\204KNA\211N@QQP\321QNAN\202\311R\201r\230\203n\321VNAN\202\311R\201s\230\203\202\324WNAN\202\311R\201t\230\203\233\201uXBXNAN\202\311R\201v\230\204\266R\201w\230\204\266R\201x\230\203\306\201yYBYNAN\202\311\324OQ\203\326\367\201zR\"\210+\202\212M\203\345MN\241\210*\201{\201|!\203\365\201| \210H\201}>\203\f\201~\201 \236A\377V\203\201\200\324!\210\201\201\201\202!\210V\203=\201\203\201\204\324\211\321$\2033\201\205Z!\210\201\203V\324\211\321$\210\201\203\201\206\201\207\201\210\201\211$\210\321[\321\211W\324=\203`\201\212\202bWI\\]^_]\201\213`aW\203\201` \210\202\212\367\201\214\201\215\217\210a]=\204\231\324^a_*^\203\243_aI\204\301\\I=\204\301\201\216\201\217\201\220 \"\210\356b!\210,c\204\330\372 \201\221d\206\325\201\222 Qc\201\201\201\223!\210\201\224\201\225!\203\376\212\201\225q\210e\201\226=\203\375f \210)g\203JG\204JH\204J\310\201\227!\321h\211i\203I\201\203giP\324\211#\204I\336\201\230i\"\211h\203Bi\377hO\211i\202\321\211i\204*\201\231MA!\210G\205\\\201\232\324!\207" [default-directory command-line-default-directory system-type temporary-file-directory vc version-control file-name-as-directory (ms-dos windows-nt) getenv "TEMP" "TMPDIR" "TMP" "c:/temp" (vax-vms axp-vms) "SYS$SCRATCH:" "/tmp" "VERSION_CONTROL" nil "t" "numbered" t "nil" "existing" "never" "simple" never "LC_ALL" "" "LC_CTYPE" "LANG" string-match get-buffer-create generate-new-buffer-name " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#1=#:temp-buffer buffer-name kill-buffer] 2)) insert-file-contents re-search-forward "^" regexp-quote ":?[ ]+" match-string 1 "9" "5" "latin-" "latin-[12345]" set-language-environment x set-terminal-coding-system intern standard-display-european-internal (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\320 \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 nil kill-emacs] 8))) user-login-name user-real-login-name (("--no-init-file") ("--no-site-file") ("--user") ("--debug-init") ("--iconic") ("--icon-type")) "\\`--" "=" 0 string ctype locale-translation-file-name iso-8859-n-locale-regexp #1# which charset noninteractive window-system default-enable-multibyte-characters eol-mnemonic-unix eol-mnemonic-mac eol-mnemonic-dos 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 fink-emacs-flavor inhibit-startup-message 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 "--" try-completion 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 frame-initialize (x w32) menu-bar-lines frame-parameters menu-bar-mode run-hooks before-init-hook load "fink-startup" fink-startup "leim-list.el" noerror nomessage nosuffix startup #[nil "\205S \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\f\206R\313\323\324\322\211#))\207" [init-file-user system-type user-init-file-1 user-init-file inhibit-default-init inhibit-startup-message ms-dos "~" "/_emacs" windows-nt directory-files nil "^\\.emacs\\(\\.elc?\\)?$" "~/.emacs" "~/_emacs" vax-vms "sys$login:.emacs" "/.emacs" t load "default"] 4] (byte-code " \210\302\302\207" [inner init-file-had-error nil] 1) ((error (byte-code "\302\303@\304NA\203\305\202\306\307\310A\311#$\210\312\302\207" [error init-file-had-error message "Error in init file: %s%s%s" error-message ": " "" mapconcat prin1-to-string ", " t] 8))) mapcar #[(buffer) "rq\210 \205 \302\303!)\207" [buffer enable-multibyte-characters set-buffer-multibyte nil] 2] buffer-list "@" 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 '"This buffer is for notes you don't want to save, and for Lisp evaluation.\nIf you want to create a file, visit that file with C-x C-f,\nthen enter the text in that file's own buffer.\n\n" '(#$ . 19291) :type 'string) +(custom-declare-variable 'initial-scratch-message '"This buffer is for notes you don't want to save, and for Lisp evaluation.\nIf you want to create a file, visit that file with C-x C-f,\nthen enter the text in that file's own buffer.\n\n" '(#$ . 19609) :type 'string) (defalias 'command-line-1 #[(command-line-args-left) "\204N\306 \204N \204N\n\203< \203<\302\307N\203,\n\f\310\230\203'\311 \202(\f\232\204N\312\313!\314\315\316\217\317 !\210)\204N\320\321\322!\323=\203I\324\202L\325\326!!\210@\204\315A?\205\314?\205\314\327 \330\230\205\242\203n\331\332!\210\314\333\334!\203z\334 \210\203\203\331\335!\210\314B\336>\203\220\337 \210\340C\341 \342U\205\314\340D\343\216\306 ?\205\313db\210\344c\210E\345=\203\265\346c\210\347c\210\350\351 \236\203\314\352c\210\353\354 \355\261\210\202\273\321\356!\357=\203\321\360!\361=\203\321\362!\363=\203\321\364!\365=\203\321\366!\367=\203\321\370!\371=\203\372c\210\202\325\373\374\375\357\314\340#\211F\203\376F!\202\377)\"!c\210\321\201^!\201_=\203=\321\201`!\201_=\203=\201ac\210\202D\325\201b!c\210B\203N\201cc\210\201dc\210G\203\201\201e\201fG!\314\201g\201h\201iG!!P\340$\203\201\201j\201k\201l\261\210\353\354 \355\261\210\321\201m!\201n=\203\264\321\201o!\201p=\203\264\321\201q!\201r=\203\264\201sc\210\202\273\325\201t!c\210eb\210\201u\314!\210\201v\201w!*\207 \203\331\201v\201x!\210H\342\314\211\211\201y\201z\201{\201|I\"\"\342JKLMNOPQ\211M\203'\201}\201~M@@\"\203M@@CKBKMA\211M\204@\203}@@\211RS\314T\314U\314VWX@A@L\203Q\310R\202\315\201}\201R\"\203nR\342\225\314OTR\342\211\225SORR\201\200\232\203}\314U\202\207\201\201RK\"UU\340=\203\232R\201\202\314OR\202\315U;\203\306\201\203UK\"\211Y\204\270\201\204\201\205R\"\210Y@\201\202\314OR)\202\315\314TSR\201\203RI\"\211M\203\374T\203\362T@B@MAR!\210)\202xMAR!\210\202xR\201\206\230\204R\201\207\230\204R\201\210\230\203PT\203'\201\211T!M\2025\201\211@@!M@A@\201\212MK!\203I\201\213M!\210\202xM \210\202xR\201\214\230\203}T\203eTM\202o@@M@A@\201\215\201\216M!!\210\202xR\201\217\230\204\217R\201\220\230\203\306T\203\233TM\202\245@@M@A@\201\221M!M\201\222M!VBV\201yV\237X\"W\202xR\201\223\230\204\330R\201\224\230\203T\203\344TM\202\356@@M@A@\201\221M!Z\201\225\201\222Z!!\203 \201\222Z!Z\201\226Z\314\340#\210)\202xR\201\227\230\203ST\203-TM\2027@@M@A@M;\204E\201\204\201\230!\210\201\231\201\221M!!\210\202xR\201\232\230\203e\201\233\340!\210\202x\201}\201\234R\"\203|\201\235R!J\202x\201\203RQ\"\211M\203\226MA@@\233@\202xR\201\236\230\204\250R\201\237\230\203\355OTO\201\222\201\221S!P\"ZO\201\202U\203\317\201\240Z!N\202\326\201\241Z!\210)\201\242J!\204\347\201\243J!\210\342J\202xR\201\200\232\203\374\340L\202x[\314\\\211]\203]@ \211\\\204]A\211]\204\\\204w\201}\201\244R\"\2035\201\204\201\245R\"\210OTO\201\222\201\221S!P\"ZO\201\202U\203\\\201\240Z!N\202c\201\241Z!\210)\201\242J!\204t\201\243J!\210\342J*.\202'O\201xV\205\240?\205\240\201\246N!\206\240\201\247\201\202!\210\201\250 .\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 message 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]." buffer-name "*scratch*" run-hooks term-setup-hook fboundp frame-notice-user-settings window-setup-hook (x w32) precompute-menubar-bindings t buffer-size 0 ((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 "The menu bar and scroll bar are sufficient for basic editing with the mouse.\n\nUseful Files 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.\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.\n" "\n\n" emacs-version "\nCopyright (C) 1999 Free Software Foundation, Inc." "" 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" 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]" where-is-internal key-description "M-x help" command-line-args-left inhibit-startup-message window-system menubar-bindings-done buffer-undo-list system-type where auto-save-list-file-prefix command-line-default-directory command-switch-alist 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 "\340" tmm-menubar [f10] "\nActivate menubar F10 or ESC ` or M-`" "\nActivate menubar \\[tmm-menubar]" "\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.)" directory-files file-name-directory "\\`" 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") ("--find-file") ("--visit")) 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" 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 "-find-file" "-visit" find-file find-file-other-window zerop goto-line "\\`-" "Unknown option `%s'" get-buffer-window other-window buffer-menu] 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 (#$ . 27374)]) +(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 (#$ . 27692)]) diff -u -Naur emacs-20.7/mangle-info emacs-20.7.fink/mangle-info --- emacs-20.7/mangle-info Wed Dec 31 19:00:00 1969 +++ emacs-20.7.fink/mangle-info Tue Oct 1 12:09:45 2002 @@ -0,0 +1,17 @@ +#!/usr/bin/perl -w -i + +use English; +use strict; + +$RS = undef; + +my $prefix = "emacs-20"; + +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-20.7/src/Makefile.in emacs-20.7.fink/src/Makefile.in --- emacs-20.7/src/Makefile.in Mon Apr 26 01:19:42 1999 +++ emacs-20.7.fink/src/Makefile.in Tue Oct 1 12:09:45 2002 @@ -329,7 +329,7 @@ #ifdef USE_X_TOOLKIT #define @X_TOOLKIT_TYPE@ #if defined (LUCID) || defined (ATHENA) -LIBW= -lXaw +LIBW= -lXaw -lXpm #endif #ifdef MOTIF #if defined (HAVE_MOTIF_2_1) && defined (HAVE_LIBXP) diff -u -Naur emacs-20.7/src/emacs.c emacs-20.7.fink/src/emacs.c --- emacs-20.7/src/emacs.c Wed May 24 09:58:54 2000 +++ emacs-20.7.fink/src/emacs.c Tue Oct 1 12:09:45 2002 @@ -275,6 +275,9 @@ so that GDB can return from a breakpoint here. MSDOS has its own definition on msdos.c */ +#ifdef __APPLE_CC__ +__private_extern__ +#endif #if ! defined (DOS_NT) && ! defined (NO_ABORT) void abort () @@ -602,7 +605,6 @@ char stack_bottom_variable; int skip_args = 0; extern int errno; - extern int sys_nerr; #ifdef HAVE_SETRLIMIT struct rlimit rlim; #endif @@ -662,15 +664,15 @@ } #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"); } -#endif /* NeXT */ +#endif /* NeXT || RHAPSODY || DARWIN */ #ifdef VMS /* If -map specified, map the data file in */ @@ -1286,7 +1288,7 @@ #ifdef VMS init_vmsfns (); #endif /* VMS */ - init_process (); + init_emacs_process (); if (!initialized) { diff -u -Naur emacs-20.7/src/floatfns.c emacs-20.7.fink/src/floatfns.c --- emacs-20.7/src/floatfns.c Tue Apr 14 08:29:27 1998 +++ emacs-20.7.fink/src/floatfns.c Tue Oct 1 12:09:45 2002 @@ -981,6 +981,9 @@ #endif /* FLOAT_CATCH_SIGILL */ #ifdef HAVE_MATHERR +#ifdef __APPLE_CC__ +__private_extern__ +#endif int matherr (x) struct exception *x; diff -u -Naur emacs-20.7/src/getloadavg.c emacs-20.7.fink/src/getloadavg.c --- emacs-20.7/src/getloadavg.c Sat Oct 3 01:40:15 1998 +++ emacs-20.7.fink/src/getloadavg.c Tue Oct 1 12:09:45 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) @@ -462,7 +464,7 @@ # define host_self mach_host_self # endif -# ifdef NeXT +# if defined(NeXT) || defined(RHAPSODY) || defined(DARWIN) # ifdef HAVE_MACH_MACH_H # include # else @@ -510,7 +512,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 */ @@ -547,6 +549,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[]; @@ -687,14 +692,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. */ @@ -704,10 +705,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-20.7/src/lisp.h emacs-20.7.fink/src/lisp.h --- emacs-20.7/src/lisp.h Sun Jan 3 11:31:23 1999 +++ emacs-20.7.fink/src/lisp.h Tue Oct 1 12:09:45 2002 @@ -2340,7 +2340,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-20.7/src/m/powermacintosh.h emacs-20.7.fink/src/m/powermacintosh.h --- emacs-20.7/src/m/powermacintosh.h Wed Dec 31 19:00:00 1969 +++ emacs-20.7.fink/src/m/powermacintosh.h Tue Oct 1 12:09:45 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-20.7/src/process.c emacs-20.7.fink/src/process.c --- emacs-20.7/src/process.c Tue May 23 15:10:16 2000 +++ emacs-20.7.fink/src/process.c Tue Oct 1 12:09:45 2002 @@ -4509,7 +4509,7 @@ } void -init_process () +init_emacs_process () { register int i; @@ -4912,7 +4912,7 @@ } void -init_process () +init_emacs_process () { } diff -u -Naur emacs-20.7/src/regex.c emacs-20.7.fink/src/regex.c --- emacs-20.7/src/regex.c Sat Jan 16 04:22:21 1999 +++ emacs-20.7.fink/src/regex.c Tue Oct 1 12:09:45 2002 @@ -6160,6 +6160,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 *preg; @@ -6238,6 +6241,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 *preg; @@ -6342,6 +6348,9 @@ /* Free dynamically allocated space used by PREG. */ +#ifdef __APPLE_CC__ +__private_extern__ +#endif void regfree (preg) regex_t *preg; diff -u -Naur emacs-20.7/src/s/darwin.h emacs-20.7.fink/src/s/darwin.h --- emacs-20.7/src/s/darwin.h Wed Dec 31 19:00:00 1969 +++ emacs-20.7.fink/src/s/darwin.h Tue Oct 1 12:11:21 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 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 + +/* 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-20.7/src/s/rhapsody.h emacs-20.7.fink/src/s/rhapsody.h --- emacs-20.7/src/s/rhapsody.h Wed Dec 31 19:00:00 1969 +++ emacs-20.7.fink/src/s/rhapsody.h Tue Oct 1 12:09:45 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 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 + +/* 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-20.7/src/termcap.c emacs-20.7.fink/src/termcap.c --- emacs-20.7/src/termcap.c Sun Aug 16 04:55:43 1998 +++ emacs-20.7.fink/src/termcap.c Tue Oct 1 12:09:45 2002 @@ -139,6 +139,9 @@ return NULL; } +#ifdef __APPLE_CC__ +__private_extern__ +#endif int tgetnum (cap) char *cap; @@ -149,6 +152,9 @@ return atoi (ptr); } +#ifdef __APPLE_CC__ +__private_extern__ +#endif int tgetflag (cap) char *cap; @@ -162,6 +168,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; @@ -287,6 +296,9 @@ short ospeed; /* If OSPEED is 0, we use this as the actual baud rate. */ int tputs_baud_rate; +#ifdef __APPLE_CC__ +__private_extern__ +#endif char PC; /* Actual baud rate if positive; @@ -303,6 +315,9 @@ #endif /* not VMS */ }; +#ifdef __APPLE_CC__ +__private_extern__ +#endif void tputs (str, nlines, outfun) register char *str; @@ -437,6 +452,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-20.7/src/tparam.c emacs-20.7.fink/src/tparam.c --- emacs-20.7/src/tparam.c Tue Apr 9 18:14:20 1996 +++ emacs-20.7.fink/src/tparam.c Tue Oct 1 12:09:45 2002 @@ -103,11 +103,20 @@ return tparam1 (string, outstring, len, NULL, NULL, arg); } +#ifdef __APPLE_CC__ +__private_extern__ +#endif char *BC; +#ifdef __APPLE_CC__ +__private_extern__ +#endif char *UP; static char tgoto_buf[50]; +#ifdef __APPLE_CC__ +__private_extern__ +#endif char * tgoto (cm, hpos, vpos) char *cm; diff -u -Naur emacs-20.7/src/unexdyld.c emacs-20.7.fink/src/unexdyld.c --- emacs-20.7/src/unexdyld.c Wed Dec 31 19:00:00 1969 +++ emacs-20.7.fink/src/unexdyld.c Tue Oct 1 12:09:45 2002 @@ -0,0 +1,887 @@ +/* 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 +#ifdef HAVE_UNISTD_H +#include +#endif +#include +#include +#include +#ifndef NeXT +#include +#endif +#include +#include +#include + +extern int malloc_freezedry (void); + +int malloc_cookie; + +#define VERBOSE + +#ifdef VERBOSE +#define SHOW_MCOPY_WRITES +#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; + } +} + +/* + * 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) +{ + 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; + } + } + 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\n", tpos, tpos+len, len); +#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"); + } + else + { + int bread; + char *buf = alloca (1 << 16); + +#ifdef SHOW_MCOPY_WRITES + printf ("write: %10lu - %10lu, length: %10lu\n", tpos, tpos+len, len); +#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. + * + * 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; + + unsigned long delta = 0; +#if defined(NS_TARGET) || !defined(NeXT) + struct dysymtab_command *dysymtab; + 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; + int found_la_symbol_ptr = 0, found_nl_symbol_ptr = 0, found_dyld = 0; + + malloc_cookie = malloc_freezedry(); +#ifdef VERBOSE + printf ("malloc_cookie: %lx\n", malloc_cookie); +#endif + + { + 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 = ®ions; +#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 = ®ions; *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)); + original_load_commands = alloca (mach_header.sizeofcmds); + mcopy (infd, -1, sizeof(mach_header), (unsigned long) original_load_commands, mach_header.sizeofcmds); + + /* + * Skip (or adjust) regions that intersect memory represented by non-data + * segments from the original load commands. + */ + + for (pregions = ®ions; *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)) + { + found_la_symbol_ptr = 1; + 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)) + { + found_nl_symbol_ptr = 1; + 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)) + { + found_dyld = 1; + 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++; + } +#ifdef VERBOSE + printf ("la: %d, nl: %d, dyld: %d\n", found_la_symbol_ptr, found_nl_symbol_ptr, found_dyld); +#endif + /** + * Assumption - the special sections we want to handle are in the first segment. + * Special sections: + * - __DATA:__data - leave at beginning, take from memory + * - __DATA:__la_symbol_ptr - keep S_LAZY_SYMBOL_POINTERS flag and reserved1, take from original file + * - __DATA:__nl_symbol_ptr - keep S_NON_LAZY_SYMBOL_POINTERS flag and reserved1, take from original file + * - __DATA:__dyld - take from original file + * - remaining - take from memory, throw in __DATA:__data2 section? + * + * - Get range of first region + * - get original __la_symbol_ptr, __symbol_ptr and __dyld sections + * - make sure they are within the first region + * + * - Create new __DATA segment, size=0, nsects=0 + * - create section for data up to __la_symbol_ptr + * - create section for data up to __nl_symbol_ptr + * - create section for data up to __dyld + * - create section for remaining data + **/ +#if 0 + cregion = regions; + if (cregion != NULL) + { + unsigned long start, end; + + start = cregion->address; + end = start + cregion->size; + + if (found_la_symbol_ptr == 1) + { + if (la_symbol_ptr_section.addr < start && la_symbol_ptr_section.addr + la_symbol_ptr_section.size >= end) + fatal_unexec ("la_symbol_ptr section lies outside of segment."); + } + else + fatal_unexec ("Couldn't find la_symbol_ptr section."); + + if (found_nl_symbol_ptr == 1) + { + if (nl_symbol_ptr_section.addr < start && nl_symbol_ptr_section.addr + nl_symbol_ptr_section.size >= end) + fatal_unexec ("nl_symbol_ptr section lies outside of segment."); + } + else + fatal_unexec ("Couldn't find nl_symbol_ptr section."); + + if (found_dyld == 1) + { + if (dyld_section.addr < start && dyld_section.addr + dyld_section.size >= end) + fatal_unexec ("dyld section lies outside of segment."); + } + else + fatal_unexec ("Couldn't find dyld section."); + } + else + { + fatal_unexec ("No data regions."); + } +#endif + 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); + current_address = original_sections->section.addr; + } +#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); + if (section_pointer->offset == 0) + { + mcopy (-1, outfd, (unsigned long) section_pointer->addr, output_position, section_pointer->size); + } + else + { + mcopy (infd, outfd, (unsigned long) section_pointer->offset, output_position, section_pointer->size); + } + 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)); + header_position += sizeof (struct segment_command); + while (new_sections != NULL) + { + mcopy (-1, outfd, (unsigned long) &(new_sections->section), header_position, sizeof (struct section)); + header_position += sizeof (struct 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); + 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); + 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 + { + mcopy (infd, outfd, segment_pointer->fileoff, output_position, segment_pointer->filesize); + 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); + header_position += load_command->cmdsize; + } + break; + + case LC_SYMTAB: + symtab_pointer = (struct symtab_command *)load_command; + + symtab_pointer->symoff += delta; + symtab_pointer->stroff += delta; + mcopy (-1, outfd, (unsigned long)load_command, header_position, load_command->cmdsize); + header_position += load_command->cmdsize; + + 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); + header_position += load_command->cmdsize; + + break; +#endif + default: + mcopy (-1, outfd, (unsigned long)load_command, header_position, load_command->cmdsize); + header_position += load_command->cmdsize; + } + } + + mach_header.sizeofcmds = header_position - sizeof(mach_header); + mcopy (-1, outfd, (unsigned long) &mach_header, 0, sizeof(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); + } +#endif +#if 0 + for (cregion = regions; cregion != NULL; cregion = cregion->next) + { + if (reloc_info.r_address >= cregion->address + && reloc_info.r_address < cregion->address + cregion->file_size) + { + fixed_reloc_count++; + mcopy (-1, outfd, (unsigned long) &zeroval, + cregion->file_offset + reloc_info.r_address - cregion->address, + 1 << reloc_info.r_length); + break; + } + } +#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); + } +#endif +#if 0 + for (cregion = regions; cregion != NULL; cregion = cregion->next) + { + if (reloc_info.r_address >= cregion->address + && reloc_info.r_address < cregion->address + cregion->file_size) + { + fixed_reloc_count++; + mcopy (-1, outfd, (unsigned long) &zeroval, + cregion->file_offset + reloc_info.r_address - cregion->address, + 1 << reloc_info.r_length); + break; + } + } +#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); + } +}