comparison lisp/loadup.el @ 398:74fd4e045ea6 r21-2-29

Import from CVS: tag r21-2-29
author cvs
date Mon, 13 Aug 2007 11:13:30 +0200
parents aabb7f5b1c81
children 5a2589c672dc
comparison
equal deleted inserted replaced
397:f4aeb21a5bad 398:74fd4e045ea6
40 (defvar running-xemacs t 40 (defvar running-xemacs t
41 "Non-nil when the current emacs is XEmacs.") 41 "Non-nil when the current emacs is XEmacs.")
42 (defvar preloaded-file-list nil 42 (defvar preloaded-file-list nil
43 "List of files preloaded into the XEmacs binary image.") 43 "List of files preloaded into the XEmacs binary image.")
44 44
45 (defvar Installation-string nil
46 "Description of XEmacs installation.")
45 47
46 (let ((gc-cons-threshold 30000)) 48 (let ((gc-cons-threshold 30000))
47 49
48 ;; This is awfully damn early to be getting an error, right? 50 ;; This is awfully damn early to be getting an error, right?
49 (call-with-condition-handler 'really-early-error-handler 51 (call-with-condition-handler 'really-early-error-handler
50 #'(lambda () 52 #'(lambda ()
51 ;; message not defined yet ... 53
54 ;; Initialize Installation-string. We do it before loading
55 ;; anything so that dumped code can make use of its value.
56 (setq Installation-string
57 (save-current-buffer
58 (set-buffer (get-buffer-create (generate-new-buffer-name
59 " *temp*")))
60 ;; insert-file-contents-internal bogusly calls
61 ;; format-decode without checking if it's defined.
62 (fset 'format-decode #'(lambda (f l &optional v) l))
63 (insert-file-contents-internal "../Installation")
64 (fmakunbound 'format-decode)
65 (prog1 (buffer-substring)
66 (kill-buffer (current-buffer)))))
67
52 (setq load-path (split-path (getenv "EMACSBOOTSTRAPLOADPATH"))) 68 (setq load-path (split-path (getenv "EMACSBOOTSTRAPLOADPATH")))
53 (setq module-load-path (split-path (getenv "EMACSBOOTSTRAPMODULEPATH"))) 69 (setq module-load-path (split-path (getenv "EMACSBOOTSTRAPMODULEPATH")))
54 70
71 ;; message not defined yet ...
55 (external-debugging-output (format "\nUsing load-path %s" load-path)) 72 (external-debugging-output (format "\nUsing load-path %s" load-path))
56 (external-debugging-output (format "\nUsing module-load-path %s" module-load-path)) 73 (external-debugging-output (format "\nUsing module-load-path %s"
74 module-load-path))
57 75
58 ;; We don't want to have any undo records in the dumped XEmacs. 76 ;; We don't want to have any undo records in the dumped XEmacs.
59 (buffer-disable-undo (get-buffer "*scratch*")) 77 (buffer-disable-undo (get-buffer "*scratch*"))
60 78
61 ;; Load our first bootstrap support 79 ;; Load our first bootstrap support
84 ;; there will be lots of extra space in the data segment filled 102 ;; there will be lots of extra space in the data segment filled
85 ;; with garbage-collected junk) 103 ;; with garbage-collected junk)
86 (defun pureload (file) 104 (defun pureload (file)
87 (let ((full-path 105 (let ((full-path
88 (locate-file file load-path 106 (locate-file file load-path
89 (if load-ignore-elc-files ".el:" ".elc:.el:")))) 107 (if load-ignore-elc-files
108 '(".el" "") '(".elc" ".el" "")))))
90 (if full-path 109 (if full-path
91 (prog1 110 (prog1
92 (load full-path) 111 (load full-path)
93 (garbage-collect)) 112 (garbage-collect))
94 (external-debugging-output (format "\nLoad file %s: not found\n" 113 (external-debugging-output (format "\nLoad file %s: not found\n"
96 ;; Uncomment in case of trouble 115 ;; Uncomment in case of trouble
97 ;;(print (format "late-packages: %S" late-packages)) 116 ;;(print (format "late-packages: %S" late-packages))
98 ;;(print (format "guessed-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name))) 117 ;;(print (format "guessed-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name)))
99 nil))) 118 nil)))
100 119
101 (load (concat default-directory "../lisp/dumped-lisp.el")) 120 (load (expand-file-name "../lisp/dumped-lisp.el"))
102 121
103 (let ((files preloaded-file-list) 122 (let ((files preloaded-file-list)
104 file) 123 file)
105 (while (setq file (car files)) 124 (while (setq file (car files))
106 (unless (pureload file) 125 (unless (pureload file)
143 ;; (precompute-menubar-bindings)) 162 ;; (precompute-menubar-bindings))
144 ;;; Turn on recording of which commands get rebound, 163 ;;; Turn on recording of which commands get rebound,
145 ;;; for the sake of the next call to precompute-menubar-bindings. 164 ;;; for the sake of the next call to precompute-menubar-bindings.
146 ;(setq define-key-rebound-commands nil) 165 ;(setq define-key-rebound-commands nil)
147 166
148
149 ;; Note: all compiled Lisp files loaded above this point 167 ;; Note: all compiled Lisp files loaded above this point
150 ;; must be among the ones parsed by make-docfile 168 ;; must be among the ones parsed by make-docfile
151 ;; to construct DOC. Any that are not processed 169 ;; to construct DOC. Any that are not processed
152 ;; for DOC will not have doc strings in the dumped XEmacs. 170 ;; for DOC will not have doc strings in the dumped XEmacs.
153 171