Changeset 11301


Ignore:
Timestamp:
Nov 5, 2008, 9:03:46 PM (11 years ago)
Author:
gb
Message:

Since we documented the :TOPLEVEL-FUNCTION option to SAVE-APPLICATION,
might as well make it actually do something (without requiring that
the user know how to do low-level lisp initialization.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lib/dumplisp.lisp

    r11132 r11301  
    113113                                       application-class)))
    114114    (setq *application* (make-instance application-class)))
    115   (when (not toplevel-function)
     115  (if (not toplevel-function)
    116116    (setq toplevel-function
    117117          #'(lambda ()
     
    119119                                 (if init-file-p
    120120                                   init-file
    121                                    (application-init-file *application*))))))
     121                                   (application-init-file *application*)))))
     122        (let* ((user-toplevel-function (coerce-to-function toplevel-function)))
     123      (setq toplevel-function
     124            (lambda ()
     125              (restore-lisp-pointers)
     126              ;; Shouldn't be necessary post 1.2
     127              ;;(initialize-interactive-streams)
     128              (process-run-function "toplevel" (lambda ()
     129                                                 (funcall user-toplevel-function)
     130                                                 (quit)))
     131              (%set-toplevel #'housekeeping-loop)
     132              (toplevel)))))
    122133  (when error-handler
    123134    (make-application-error-handler *application* error-handler))
Note: See TracChangeset for help on using the changeset viewer.