user797257
user797257

Reputation:

SLIME: How to use the result from the repl as plain text?

After slime prints a Lisp form in REPL it puts some properties on it, that make it later able to introspect / expand it etc. Some times it is very useful, but other times I'd like to re-use the result as just text.

What is the quick way to remove this special property from a form?

Upvotes: 2

Views: 226

Answers (2)

danlei
danlei

Reputation: 14291

You can just right click on the presentation and choose Pretty-print, or move point to the presentation and invoke M-x slime-pretty-print-representation-at-point. This will pretty print the presentation in another buffer.

Upvotes: 1

Rainer Joswig
Rainer Joswig

Reputation: 139411

Just print the last output to a string:

(princ-to-string *)

To expand a bit: SLIME implements something like presentations, which were introduced by Symbolics for its Dynamic Windows user interface. Presentations of Lisp objects can be in various forms: textual and graphical. They always remember the original objects - which makes them clickable/active. With Dynamic Windows you could also select a textual presentation and copy the output as a text to the editor killring. I would guess that SLIME/Emacs can do something similar.

Upvotes: 1

Related Questions