HI All
Just something I thought you might find useful if you have mutiple
servers and ssh into them and use RAW sbcl without emacs to run lisp on
them, this changes the prompt from just * to
machine-name:package> e.g. pauls-laptop:CL-USER>
We just find it useful because we ssh in to our 3 servers from the
outside and if we get the wrong one and load the wrong file then we
could get into quite a mess!
(defvar *last-package* nil)
(defvar *cached-prompt* nil)
(defun package-prompt (stream)
(unless (eq *last-package* *package*)
(setf *cached-prompt*
(concatenate 'string (machine-instance)
":"
(or (first (package-nicknames
*package*))
(package-name *package*))
"> "))
(setf *last-package* *package*))
(terpri)
(princ *cached-prompt* stream))
(setf sb-int:*repl-prompt-fun* #'package-prompt)
Paul
http://www.hyperstring.net
hyperstring.net ltd wrote:
> HI All
>
> Just something I thought you might find useful if you have mutiple
> servers and ssh into them and use RAW sbcl without emacs to run lisp on
> them, this changes the prompt from just * to
>
> machine-name:package> e.g. pauls-laptop:CL-USER>
>
> We just find it useful because we ssh in to our 3 servers from the
> outside and if we get the wrong one and load the wrong file then we
> could get into quite a mess!
>
>
> (defvar *last-package* nil)
> (defvar *cached-prompt* nil)
>
> (defun package-prompt (stream)
> (unless (eq *last-package* *package*)
> (setf *cached-prompt*
> (concatenate 'string (machine-instance)
> ":"
> (or (first (package-nicknames
> *package*))
> (package-name *package*))
> "> "))
> (setf *last-package* *package*))
> (terpri)
> (princ *cached-prompt* stream))
>
>
> (setf sb-int:*repl-prompt-fun* #'package-prompt)
>
> Paul
> http://www.hyperstring.net
Paul,
this is an extremely cool piece of code,
K