| 1 | (cl:defpackage #:mdw-hacks |
| 2 | (:use #:cl)) |
| 3 | (cl:defparameter mdw-hacks::*previous-package* cl:*package*) |
| 4 | (cl:in-package #:mdw-hacks) |
| 5 | |
| 6 | ;; Shut up. |
| 7 | (setf *load-verbose* nil) |
| 8 | (setf *compile-verbose* nil) |
| 9 | |
| 10 | #+cmu |
| 11 | (setf *gc-verbose* nil) |
| 12 | |
| 13 | ;; Obtain ASDF from somewhere. |
| 14 | (require "asdf") |
| 15 | |
| 16 | ;; Tell SBCL where to find its source source. |
| 17 | #+sbcl |
| 18 | (sb-ext:set-sbcl-source-location #p"/usr/share/sbcl-source/") |
| 19 | |
| 20 | ;; Tell some Lisps about my home directory. |
| 21 | #+(and unix (or sbcl clisp)) |
| 22 | (let* ((homestring (or #+sbcl (sb-ext:posix-getenv "HOME") |
| 23 | #+clisp (ext:getenv "HOME") |
| 24 | #+cmu (unix:unix-getenv "HOME") |
| 25 | "/home/mdw")) |
| 26 | (home (pathname (concatenate 'string homestring "/")))) |
| 27 | (setf (logical-pathname-translations "HOME") |
| 28 | `(("HOME:**;*.*.*" ,(merge-pathnames "**/*.*" home nil))) |
| 29 | (logical-pathname-translations "CL") |
| 30 | '(("CL:SOURCE;**;*.*.*" #p"/usr/share/common-lisp/source/**/*.*") |
| 31 | ("CL:SYSTEMS;**;*.*.*" #p"/usr/share/common-lisp/systems/**/*.*")))) |
| 32 | |
| 33 | ;; Various fixings. |
| 34 | #+clisp |
| 35 | (setf custom:*parse-namestring-ansi* t) |
| 36 | |
| 37 | ;; Shebang. |
| 38 | (set-dispatch-macro-character |
| 39 | #\# #\! |
| 40 | (lambda (stream char arg) |
| 41 | (declare (ignore char arg)) |
| 42 | (values (read-line stream)))) |
| 43 | |
| 44 | ;; Start up swank. |
| 45 | (export 'crank-swank) |
| 46 | (defun crank-swank (&rest args) |
| 47 | (let ((swank (find-package "SWANK"))) |
| 48 | (unless swank |
| 49 | (load "/usr/share/common-lisp/source/slime/swank-loader.lisp") |
| 50 | (funcall (find-symbol "INIT" (find-package "SWANK-LOADER"))) |
| 51 | (setf swank (find-package "SWANK"))) |
| 52 | (set (find-symbol "*GLOBAL-DEBUGGER*" swank) nil) |
| 53 | (apply (find-symbol "CREATE-SERVER" swank) args))) |
| 54 | |
| 55 | #+asdf |
| 56 | (setf asdf:*compile-file-failure-behaviour* :warn) |
| 57 | |
| 58 | ;; Done. |
| 59 | (pushnew :mdw *features*) |
| 60 | ;;#+(and cmu mp) (mp::startup-idle-and-top-level-loops) |
| 61 | (setf *package* *previous-package*) |