735d4fc86bc8

Unfuck the lisp shell script wrapper hairball
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Sun, 10 Apr 2016 22:14:09 +0000
parents 0ab8b4c9ac2a
children c9adf65c83ff
branches/tags (none)
files bin/ccl bin/ccl-nrepl bin/ccl-rlwrap bin/nrepl-ccl bin/nrepl-sbcl bin/regen-sbcl-completions bin/rlwrap-sbcl bin/sbcl-nrepl bin/sbcl-rlwrap sbclrc

Changes

--- a/bin/ccl	Sun Apr 10 21:54:52 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-rlwrap ccl64 "$@"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bin/ccl-nrepl	Sun Apr 10 22:14:09 2016 +0000
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+
+set -e
+
+ccl-rlwrap --eval "(ql:quickload 'nrepl)" --eval "(nrepl:start-server)" "$@"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bin/ccl-rlwrap	Sun Apr 10 22:14:09 2016 +0000
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+
+rlwrap ros -L ccl-bin run -l ~/.ccl-init.lisp "$@"
--- a/bin/nrepl-ccl	Sun Apr 10 21:54:52 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-ccl --eval "(ql:quickload 'nrepl)" --eval "(nrepl:start-server)" "$@"
--- a/bin/nrepl-sbcl	Sun Apr 10 21:54:52 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-rlwrap sbcl --eval "(ql:quickload 'nrepl)" --eval "(nrepl:start-server)" "$@"
--- a/bin/regen-sbcl-completions	Sun Apr 10 21:54:52 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-#!/usr/bin/env sbcl --script
-(let (symbols)
-  (do-all-symbols (sym)
-    (let ((package (symbol-package sym)))
-      (cond
-        ((not (fboundp sym)))
-        ((or (eql #.(find-package :cl) package)
-             (eql #.(find-package :cl-user) package))
-         (pushnew (symbol-name sym) symbols))
-        ((eql #.(find-package :keyword) package)
-         (pushnew (concatenate 'string ":" (symbol-name sym)) symbols))
-        (package
-          (pushnew (concatenate 'string (package-name package)
-                               ":"
-                               (symbol-name sym))
-                  symbols)))))
-  (with-open-file (output #.(concatenate 'string (posix-getenv "HOME")
-                                         "/.sbcl_completions")
-                          :direction :output :if-exists :overwrite
-                          :if-does-not-exist :create)
-    (format output "~{~(~A~)~%~}" (sort symbols #'string<))))
--- a/bin/rlwrap-sbcl	Sun Apr 10 21:54:52 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-#!/bin/sh
-BREAK_CHARS="(){}[],^%$#@\"\";''|\\"
-RLWRAP=
-if [ $TERM == "dumb" ]; then  # slime
-  RLWRAP=
-else
-  RLWRAP="rlwrap --remember --history-filename=$HOME/.sbcl_history --histsize=1000000 -c -b $BREAK_CHARS -f $HOME/.sbcl_completions"
-fi
-if [ $# -eq 0 ]; then
-  exec $RLWRAP sbcl
-else # permits #!/usr/bin/env sbcl , but breaks sbcl --help, etc.
-  exec sbcl --script $*
-fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bin/sbcl-nrepl	Sun Apr 10 22:14:09 2016 +0000
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+
+set -e
+
+sbcl-rlwrap --eval "(ql:quickload 'nrepl)" --eval "(nrepl:start-server)" "$@"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bin/sbcl-rlwrap	Sun Apr 10 22:14:09 2016 +0000
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+
+rlwrap ros -L sbcl run -l ~/.sbclrc "$@"
--- a/sbclrc	Sun Apr 10 21:54:52 2016 +0000
+++ b/sbclrc	Sun Apr 10 22:14:09 2016 +0000
@@ -1,17 +1,12 @@
 ;;; The following lines added by ql:add-to-init-file:
-#-quicklisp
-(let ((quicklisp-init (merge-pathnames ".quicklisp/setup.lisp"
-                                       (user-homedir-pathname))))
-  (when (probe-file quicklisp-init)
-    (load quicklisp-init)))
+; #-quicklisp
+; (let ((quicklisp-init (merge-pathnames ".quicklisp/setup.lisp"
+;                                        (user-homedir-pathname))))
+;   (when (probe-file quicklisp-init)
+;     (load quicklisp-init)))
 ;;;
 
-(pushnew "~/lib/asdf/" asdf:*central-registry* :test #'equal)
-
-; (require 'sb-int)
-; (setf sb-int:*repl-prompt-function*
-;       (lambda (stream)
-;         (format stream "~&~A> " *package*)))
+; (pushnew "~/lib/asdf/" asdf:*central-registry* :test #'equal)
 
 (defvar *last-package* nil)
 (defvar *cached-prompt* nil)