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

Inits Manager



;;;; Init.lisp
;;;; Author: Daniel Ranson (ranson@lannion.cnet.fr) (AppleLink: RANSON)
;;;; This is a quick and dirty Init Manager for MCL2.0.
;;;;
;;;; Loads the files in directory named "inits" inside MCL directory, in
;;;; alphabetical order
;;;; If the Option key is held down while this file loads, a window with the
;;;; list of init files pops up, and it is possible to select which files
;;;; will be loaded this time.
;;;; This code has been tested with MCL2.0b3. For b1, change the two
;;;; occurrences of "ccl:inits;*" to "ccl;inits:*"
;;;;
;;;; Use this code any way you want, and take responsibility for any damage
;;;; it may cause.
(in-package :ccl)

(defun get-init-files ()
  (let ((l1 (directory "ccl:inits;*"))
        (l2 t))
    (cond ((option-key-p)
           (catch-cancel
             (setq l2 (select-item-from-list l1
                          :window-title "Select init files to load"
                          :selection-type :disjoint)))
           (if (eq l2 t)
             (setq l2 l1)
             (setq l2 (sort l2 #'(lambda (x y) (member y (member x l1)))))))
          (t
           (setq l2 l1)))))

(when (probe-file "ccl:inits;")
  (dolist (f (get-init-files))
    (load f :verbose nil :print nil)))

     Daniel.