-
Notifications
You must be signed in to change notification settings - Fork 36
/
write-lispbox-el.sh
56 lines (45 loc) · 1.39 KB
/
write-lispbox-el.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/sh
cat <<EOF
(require 'cl)
(defun lispbox-list-to-filename (list)
(apply
#'concat
(maplist
#'(lambda (cons)
(if (cdr cons) (file-name-as-directory (car cons)) (car cons)))
list)))
(defun lispbox-file (rest)
(concat
(file-name-as-directory
(expand-file-name
(or (getenv "LISPBOX_HOME")
(file-name-directory load-file-name))))
rest))
(defun lispbox-find-lisps ()
(dolist (file (file-expand-wildcards (lispbox-file "*/lispbox-register.el")))
(load file)))
(defun lispbox-install-lisp-license (license-path lisp-name)
(let ((license (concat (file-name-directory load-file-name) (lispbox-list-to-filename license-path))))
(if (not (file-exists-p license))
(let* ((prompt (format "Need to install license for %s . Please enter name of file where you saved it: " lisp-name))
(to-install (read-file-name prompt)))
(copy-file (expand-file-name to-install) license)))))
(global-font-lock-mode t)
(setq load-path (cons (lispbox-file "${SLIME_DIR}") load-path))
EOF
if [ ! -z "${SBCL_DIR}" ]; then
cat <<EOF
(setenv "SBCL_HOME" (lispbox-file "${SBCL_DIR}/lib/sbcl"))
EOF
fi
if [ ! -z "${CLOZURECL_DIR}" ]; then
cat <<EOF
(setenv "CCL_DEFAULT_DIRECTORY" (lispbox-file "${CLOZURECL_DIR}"))
EOF
fi
cat <<EOF
(require 'slime)
(slime-setup '(slime-fancy slime-asdf slime-banner))
(lispbox-find-lisps)
(provide 'lispbox)
EOF