Hello,
I fairly often copy text from the REPL buffer into text files and emails, and then spend a lot of time adding text to the beginnings of lines to indicate which text was input, output, error messages, or return values. But with a little tweaking, slime can do this stuff for me. I've attached a patch against today's anonymous cvs, with which I've made the following transcript.
If people think this feature is worth including but that the code needs changes, please let me know what has to be done.
-- Richard
; SLIME 2005-06-13 CL-USER> 1 1 CL-USER> ,transcript ; REPL transcript printing activated CL-USER> 1 => 1 CL-USER> (read) <- "asdf" => "asdf" CL-USER> (error "Foo.") !! Foo. !! [Condition of type SIMPLE-ERROR] ; Evaluation aborted CL-USER> (loop for input = (read) until (not (numberp input)) do (format t "~A~%~%~A~%" input (sqrt input)) finally (return input)) <- 1 -| 1 -| -| 1.0 <- 4 -| 4 -| -| 2.0 <- q => Q CL-USER> (values 5 "foo") => 5 => "foo" CL-USER> (macroexpand '(with-open-file (*standard-output* "foo") (read-line))) => (LET ((*STANDARD-OUTPUT* (OPEN "foo")) (#:G3835 T)) (UNWIND-PROTECT (MULTIPLE-VALUE-PROG1 (PROGN (READ-LINE)) (SETQ #:G3835 NIL)) (WHEN *STANDARD-OUTPUT* (CLOSE *STANDARD-OUTPUT* :ABORT #:G3835)))) => T CL-USER> ,transcript ; REPL transcript printing deactivated CL-USER> 1 1 CL-USER> (read) "asdf" "asdf" CL-USER> (error "Foo.") ; Evaluation aborted CL-USER>