Permalink
Browse files

make make-output-redirection public and add support for slime-target

This is useful in allowing slime to redirect clj *out* to particular buffers/markers.
  • Loading branch information...
1 parent e8c262b commit 83546c0899e28410eb201d6effd722c0b33b182d @tavisrudd committed Jan 19, 2012
Showing with 8 additions and 5 deletions.
  1. +8 −5 src/swank/core/server.clj
View
13 src/swank/core/server.clj
@@ -31,11 +31,14 @@
(with-open [secret (BufferedReader. (FileReader. slime-secret-file))]
(.readLine secret)))))))
-(defn- make-output-redirection
- ([conn]
- (call-on-flush-stream
- #(with-connection conn
- (send-to-emacs `(:write-string ~%)))))
+(defn make-output-redirection
+ ([conn & slime-output-target]
+ (let [slime-output-target (if slime-output-target
+ (first slime-output-target))]
+ (call-on-flush-stream
+ #(with-connection conn
+ (send-to-emacs `(:write-string ~% ~slime-output-target)))))
+ )
{:tag java.io.StringWriter})
;; rename to authenticate-socket, takes in a connection

0 comments on commit 83546c0

Please sign in to comment.