Print from nrepl.el to repl-y or vice versa

Given the following scenario -

  • From a lein repl ( repl-y ) terminal emulator session:

    (def reply-out *out*)

  • Then from the nrepl.el section in Emacs:

    (def nrepl-out *out*)

Both vars will have different meanings, as they will work for different purposes.

But now, if I run in Emacs:

 (binding [*out* reply-out] (println :foo)) 

the value will be printed on Emacs and not on the terminal emulator as expected / expected. The opposite doesn't work either.

How to print values ​​from one replacement to another?

Update : Using Emacs 24 in the Llinux field, tested with xterm and gnome-terminal. I also tried using the println method for each PrintWriter object.

+4
source share
1 answer

This will print for repl, which runs the basic Clojure process:

  (binding [*out* (clojure.java.io/writer System/out)] (println :bar)) 

This is not a flexible solution, so a real answer to my question would be very welcome.

0
source

All Articles