[slime-devel] REPL buffer transcripts [PATCH]

Richard M Kreuter kreuter at progn.net
Sat Jun 18 23:46:41 UTC 2005


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> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: slime-repl-transcript.diff
Type: text/x-patch
Size: 10895 bytes
Desc: REPL transcript generating routines
URL: <https://mailman.common-lisp.net/pipermail/slime-devel/attachments/20050618/8f218af3/attachment.bin>


More information about the slime-devel mailing list