dot/lisp-init.lisp, dot/shell-rc: Suppress Lisp heralds; use `rlwrap'.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 1 Jul 2020 18:39:01 +0000 (19:39 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 9 Aug 2020 03:34:42 +0000 (04:34 +0100)
Add shell aliases -- and, in one case, some awful Lisp-level hacking --
to suppress Lisp system heralds.

The hacking for ECL is unusually terrible, because it breaks
`*standard-output*' until the prompt is ready to appear, so inhibit it
if there are any command-line arguments which might, for example, want
to print something.

dot/lisp-init.lisp
dot/shell-rc

index da50a6f..8b0e3f9 100644 (file)
 (setf ext:*gc-verbose* nil
       ext:*require-verbose* nil)
 
+#+ecl
+(let ((old-output *standard-output*)
+      (old-prompt si:*tpl-prompt-hook*))
+  ;; There doesn't seem to be a good way to do this, so we do it the bad
+  ;; way.  Since the herald is printed to `*standard-outout*', we set (not
+  ;; bind!) that to a bit bucket, and then arrange to restore it just before
+  ;; the first REPL prompt is written.
+  ;;
+  ;; One more awful part is that, having intercepted the prompt hook, I need
+  ;; to restore and invoke the old version, and there isn't a clean way to do
+  ;; this.
+  (when (<= (ext:argc) 1)
+    (setf *standard-output* (make-broadcast-stream)
+         si:*tpl-prompt-hook* (lambda ()
+                                (setf *standard-output* old-output
+                                      si:*tpl-prompt-hook* old-prompt)
+                                (si::tpl-prompt)))))
+
 ;; Obtain ASDF from somewhere.
 (require "asdf")
 
index 7313cee..ea4f575 100644 (file)
@@ -221,6 +221,12 @@ alias make="nice make"
 alias cross-run="nice cross-run"
 alias gdb="gdb -q"
 
+## Shut up Lisp interpreters.
+alias clisp="clisp -q -q"
+alias cmucl="rlwrap cmucl -quiet"
+alias ecl="rlwrap ecl"
+alias sbcl="rlwrap sbcl --noinform"
+
 ###--------------------------------------------------------------------------
 ### Colour output.