chiark / gitweb /
el/dot-emacs.el (mdw-fontify-rust): Fix integer literal syntax.
[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 (sb-ext:set-sbcl-source-location #p"/usr/share/sbcl-source/")
26
27 ;; Tell some Lisps about my home directory.
28 #+(and unix (or sbcl clisp))
29 (let* ((#1=#:homestring (or #+sbcl (sb-ext:posix-getenv "HOME")
30                             #+clisp (ext:getenv "HOME")
31                             #+cmu (unix:unix-getenv "HOME")
32                             "/home/mdw"))
33        (#2=#:home (pathname (concatenate 'string #1# "/"))))
34   (setf (logical-pathname-translations "HOME")
35         `(("HOME:**;*.*.*" ,(merge-pathnames "**/*.*" #2# nil)))
36         (logical-pathname-translations "CL")
37         '(("CL:SOURCE;**;*.*.*" #p"/usr/share/common-lisp/source/**/*.*")
38           ("CL:SYSTEMS;**;*.*.*" #p"/usr/share/common-lisp/systems/**/*.*"))))
39
40 ;; Various fixings.
41 #+clisp (setf custom:*parse-namestring-ansi* t)
42
43 ;; Shebang.
44 (set-dispatch-macro-character
45  #\# #\!
46  (lambda (#1=#:stream . #2=(#:char #:arg))
47    (declare (ignore . #2#))
48    (values (read-line #1#))))
49
50 ;; Start up swank.
51 (defun mdw-hacks:crank-swank (&rest #1=#:args)
52   (let ((#2=#:swank #3=(find-package "SWANK")))
53     (unless #2#
54       (load "/usr/share/common-lisp/source/slime/swank-loader.lisp")
55       (setf #2# #3#))
56     (set (find-symbol "*GLOBAL-DEBUGGER*" #2#) nil)
57     (apply (find-symbol "CREATE-SERVER" #2#) #1#)))
58
59 #+asdf (setf asdf:*compile-file-failure-behaviour* :warn)
60
61 ;; Done.
62 (pushnew :mdw *features*)
63 ;;#+(and cmu mp) (mp::startup-idle-and-top-level-loops)