Search code examples
emacscommon-lispslime

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?


Solution

  • 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.