[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Overriding the startup greeting

>At 6:15 PM 11/29/94, Tom Bonura wrote:
> >Is there a simple way of overriding the default lisp listener startup
> >greeting "Welcome to MCL..."?
This is in the MCL sources :CCL 2.0:level-1:l1-boot.lisp"
which is included on the MCL CDs in the "Additional MCL Source Code" 

>(defun startup-ccl (&optional init-file)
>  (let ((file-list (finder-parameters)) 
>        loaded)
>    (with-simple-restart (abort "Abort startup.")
>      (when 
>        (and (eq (car file-list) :open)
>             (dolist (f (cdr file-list) loaded)
>               (let ((type (mac-file-type f)))
>                 (when (eq type :fasl)  ;(eq type :text))
>                   (with-simple-restart (continue "Skip loading finder-selected file.")
>                     (load f)
>                     (setq loaded t))))))
>        (setq init-file nil)))
>    (when *arglist-on-space*
>      (when (open-doc-string-file nil nil)
>        (maybe-load-help-map)))
>    (when init-file
>      (with-simple-restart (continue "Skip loading init file.")
>        (load init-file :if-does-not-exist nil)))
>    (unless *inhibit-greeting* 
>      (format t "~&Welcome to ~A ~A!~%"
>              (lisp-implementation-type) (lisp-implementation-version)))
>    (when (eq (car file-list) :open)
>      (dolist (f (cdr file-list))
>        (when (eq (mac-file-type f) :text)
>          (ed f))))))

Please note that *inhibit-greeting* is not documented or exported so it may
disappear in future versions of MCL. In general, the default startup is not
very well documented. The important code is the default value for the
startup-function parameter to save-application. In English, the default is
to use the current toplevel function, but call startup-ccl with the
init-file first. 

(defun save-application (filename 
                         (init-file nil)
                          (let ((tl (%set-toplevel)))
                            #'(lambda ()
                                (%set-toplevel tl)
                                (startup-ccl init-file))))
                         (creator :ccl2)
                         (excise-compiler nil)
                         (clear-clos-caches t)