[Openmcl-devel] init-file suggestion (with patch)

bryan o'connor bryan-openmcl at lunch.org
Sun Dec 26 17:00:04 PST 2004


i wanted to use HOME:.openmclrc as my init-file instead of
HOME:openmcl-init.lisp.  i readily admit upfront that it's
purely out of an obsessive need to keep my home directory clean.

to ensure backwards-compatibility, i changed startup-ccl to
accept either an atom or list for the init-file arg.  if a list,
it'll load only the first one that exists.

i then changed the default application-init-file to the list:
	HOME:openmcl-init.lisp		; current
	HOME:.openmclrc			; unix-like
	CCL:openmcl-init.lisp		; system-wide default

to avoid confusion, perhaps the startup message should say which
file (if any) was loaded as the init-file.

then there should probably be a command-line option to specify
the init-file.  i'm leaning towards -i/--user-init.

bugs, suggestions, criticisms, code critique?

				...bryan

-------------- next part --------------
Index: level-1/l1-boot-lds.lisp
===================================================================
RCS file: /usr/local/tmpcvs/ccl-0.14-dev/ccl/level-1/l1-boot-lds.lisp,v
retrieving revision 1.4
diff -c -r1.4 l1-boot-lds.lisp
*** level-1/l1-boot-lds.lisp	22 Mar 2004 17:32:51 -0000	1.4
--- level-1/l1-boot-lds.lisp	27 Dec 2004 00:25:38 -0000
***************
*** 26,36 ****
  (defun command-line-arguments ()
    *command-line-argument-list*)
  
! (defun startup-ccl (&optional init-file)
    (with-simple-restart (abort "Abort startup.")
!     (when init-file
!       (with-simple-restart (continue "Skip loading init file.")
! 	(load init-file :if-does-not-exist nil :verbose nil)))
      (flet ((eval-string (s)
  	     (with-simple-restart (continue "Skip evaluation of ~a" s)
  	       (eval (read-from-string s))))
--- 26,41 ----
  (defun command-line-arguments ()
    *command-line-argument-list*)
  
! (defun startup-ccl (&optional init-file-or-files)
    (with-simple-restart (abort "Abort startup.")
!     (let ((init-files (if (atom init-file-or-files)
!                           (list init-file-or-files)
!                           init-file-or-files)))
!       (dolist (f init-files)
!         (with-simple-restart (continue "Skip loading init file.")
!           (and f
!                (load f :if-does-not-exist nil :verbose nil)
!                (return f)))))
      (flet ((eval-string (s)
  	     (with-simple-restart (continue "Skip evaluation of ~a" s)
  	       (eval (read-from-string s))))
Index: level-1/l1-application.lisp
===================================================================
RCS file: /usr/local/tmpcvs/ccl-0.14-dev/ccl/level-1/l1-application.lisp,v
retrieving revision 1.1
diff -c -r1.1 l1-application.lisp
*** level-1/l1-application.lisp	22 Mar 2004 17:32:33 -0000	1.1
--- level-1/l1-application.lisp	27 Dec 2004 00:25:38 -0000
***************
*** 257,264 ****
  
  
  (defmethod application-init-file ((app lisp-development-system))
!   "home:openmcl-init")
! 
  
  ; redefined by hide-listener-support
  (defmethod application-error ((a application) condition error-pointer)
--- 257,266 ----
  
  
  (defmethod application-init-file ((app lisp-development-system))
!   (list
!    (make-pathname :host "HOME" :name "openmcl-init" :type "lisp")
!    (make-pathname :host "HOME" :name ".openmclrc" :type nil)
!    (make-pathname :host "CCL" :name "openmcl-init" :type "lisp")))
  
  ; redefined by hide-listener-support
  (defmethod application-error ((a application) condition error-pointer)
-------------- next part --------------



More information about the Openmcl-devel mailing list