[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Overriding the startup greeting
- To: bonura@taurus.apple.com (Tom Bonura), info-mcl@cambridge.apple.com
- Subject: Re: Overriding the startup greeting
- From: straz@cambridge.apple.com (Steve Strassmann)
- Date: Thu, 1 Dec 1994 01:18:31 -0500
- Sender: owner-info-mcl@digitool.com
>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"
folder.
>(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
&key
(init-file nil)
(toplevel-function
(let ((tl (%set-toplevel)))
#'(lambda ()
(%set-toplevel tl)
(startup-ccl init-file))))
(creator :ccl2)
(excise-compiler nil)
size
resources
(clear-clos-caches t)
memory-options)
...)