On Sat, Dec 12, 2009 at 12:04 AM, Tobias C. Rittweiler tcr@freebits.de wrote:
Matthias Koeppe mkoeppe+slime@mail.math.uni-magdeburg.de writes:
I'd love to have a version of slime-eval-last-expression that works as well as the REPL for long-running computations, asynchronously inserting the output of the process into the buffer at this point. This would make slime-scratch much more useful. It could look like this over the course of the computation:
(long-computation) C-x C-e
(long-computation) #<still-computing...>
(long-computation) Some output #<still-computing...>
(long-computation) Some output More output #<still-computing...>
(long-computation) Some output More output Result
Of course, several computations (maybe even in different Lisp processes) would be allowed to be active at the same time in different parts of the buffer. And it should work with presentations.
Sure, would be nice. Would even be nicer if slime-repl gets cleaned up on the way.
A way that better matches existing infrastructure would be to have a function (SWANK:EMACS-BUFFER-STREAM "*FOOF*") which returns a stream that sends output into an emacs buffer. IIRC, you can almost have that today.
Yes, that's what the target argument in :write-string and the hash table slime-output-target-to-marker are for. slime-redirect-trace-output is implemented like this.
So to implement what I describe one basically just needs to put markers at the right places in the buffer and create corresponding streams (for output & result) with make-output-stream-for-target.
Matthias