X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-aclrepl%2Frepl.lisp;h=0b16d891709f6fcb0ea700d1f2a9d32144f2f6c3;hb=4b57a4917b61299ac074fa385e9a0c62a716655b;hp=17c2ad05ce7c1d8a43857431a8839af205dbbb51;hpb=e8f691fc1ba5e3aebc74fd8723c7cc550a4f1e35;p=sbcl.git diff --git a/contrib/sb-aclrepl/repl.lisp b/contrib/sb-aclrepl/repl.lisp index 17c2ad0..0b16d89 100644 --- a/contrib/sb-aclrepl/repl.lisp +++ b/contrib/sb-aclrepl/repl.lisp @@ -86,21 +86,24 @@ (defun read-cmd (input-stream) ;; Reads a command from the user and returns a user-cmd object - (let ((next-char (peek-char-non-whitespace input-stream))) - (cond - ((eql *command-char* next-char) - (dispatch-command-line input-stream)) - ((eql #\newline next-char) - (read-char input-stream) - *null-cmd*) - ((eql :eof next-char) - *eof-cmd*) - (t - (let* ((eof (cons nil *eof-marker*)) - (form (read input-stream nil eof))) - (if (eq form eof) - *eof-cmd* - (make-user-cmd :input form :func nil :hnum *cmd-number*))))))) + (let* ((next-char (peek-char-non-whitespace input-stream)) + (cmd (cond + ((eql *command-char* next-char) + (dispatch-command-line input-stream)) + ((eql #\newline next-char) + (read-char input-stream) + *null-cmd*) + ((eql :eof next-char) + *eof-cmd*) + (t + (let* ((eof (cons nil *eof-marker*)) + (form (read input-stream nil eof))) + (if (eq form eof) + *eof-cmd* + (make-user-cmd :input form :func nil :hnum *cmd-number*))))))) + (if (and (eq cmd *eof-cmd*) (typep input-stream 'string-stream)) + (throw 'repl-catcher cmd) + cmd))) (defun dispatch-command-line (input-stream) "Processes an input line that starts with *command-char*" @@ -488,7 +491,7 @@ (defun pushd-cmd (string-arg) (push string-arg *dir-stack*) - (cd-cmd *output* string-arg) + (cd-cmd string-arg) (values)) (defun popd-cmd ()