dot/lisp-init.lisp: Oh, wait, I made it work in CLisp after all.
[profile] / dot / lisp-init.lisp
1 (defpackage #:mdw-hacks
2 (:use #:cl)
3 (:export #:crank-swank))
4 (use-package '#:mdw-hacks)
5
6 ;; Obtain ASDF from somewhere.
7 #+sbcl (require :asdf)
8 #+clisp (let ((*compile-verbose* nil)
9 (*load-verbose* nil))
10 (handler-bind ((warning (lambda (cond)
11 (declare (ignore cond))
12 (muffle-warning))))
13 (load "/usr/share/common-lisp/source/cl-asdf/asdf.lisp"
14 :verbose nil)
15 (funcall (find-symbol "LOAD-SYSTEM" :asdf) :asdf
16 :verbose nil)))
17
18 ;; Shut up.
19 (setf *load-verbose* nil)
20 (setf *compile-verbose* nil)
21 #+cmu (setf *gc-verbose* nil)
22
23 ;; Tell SBCL where to find its source source.
24 #+sbcl
25 (let ((#1=#:sbcl-src #p"/usr/share/sbcl-source/"))
26 (flet ((#2=#:sbcl-dir (#3=#:p)
27 (merge-pathnames #3# #1#)))
28 (setf (logical-pathname-translations "SYS")
29 `(("SYS:SRC;**;*.*.*" ,(#2# "src/**/*.*"))
30 ("SYS:CONTRIB;**;*.*.*" ,(#2# "contrib/**/*.*"))))))
31
32 ;; Tell some Lisps about my home directory.
33 #+sbcl (require :sb-posix)
34 #+cmu (ext:clear-search-list "HOME")
35 #+(and unix (or sbcl clisp cmu))
36 (let ((#1=#:home (pathname (concatenate 'string
37 (or #+sbcl (sb-posix:getenv "HOME")
38 #+clisp (ext:getenv "HOME")
39 #+cmu (unix:unix-getenv "HOME")
40 "/home/mdw")
41 "/"))))
42 (setf (logical-pathname-translations "HOME")
43 `(("HOME:**;*.*.*" ,(merge-pathnames "**/*.*" #1# nil)))))
44
45 ;; Various fixings.
46 #+clisp (setf custom:*parse-namestring-ansi* t)
47
48 ;; Shebang.
49 (set-dispatch-macro-character
50 #\# #\!
51 (lambda (#1=#:stream . #2=(#:char #:arg))
52 (declare (ignore . #2#))
53 (values (read-line #1#))))
54
55 ;; Start up swank.
56 (defun mdw-hacks:crank-swank (&rest #1=#:args)
57 (let ((#2=#:swank #3=(find-package "SWANK")))
58 (unless #2#
59 (load "/usr/share/common-lisp/source/slime/swank-loader.lisp")
60 (setf #2# #3#))
61 (set (find-symbol "*GLOBAL-DEBUGGER*" #2#) nil)
62 (apply (find-symbol "CREATE-SERVER" #2#) #1#)))
63
64 #+asdf (setf asdf:*compile-file-failure-behaviour* :warn)
65
66 ;; Done.
67 (pushnew :mdw *features*)
68 ;;#+(and cmu mp) (mp::startup-idle-and-top-level-loops)