From: Christophe Rhodes Date: Thu, 16 Sep 2010 19:59:46 +0000 (+0100) Subject: new makeReplResultFunction hook X-Git-Url: http://christophe.rhodes.io/gitweb/?p=swankr.git;a=commitdiff_plain;h=303d24062c70b2e89370714965736b2bfe380175;hp=693bbdb7ab36ad8a1c0915bc76097c82f7170570 new makeReplResultFunction hook default makeReplResult function doing the standard (:write-string value :repl-result) thing for the REPL. --- diff --git a/swank.R b/swank.R index bf5333a..c0adff8 100644 --- a/swank.R +++ b/swank.R @@ -280,12 +280,17 @@ printToString <- function(val) { list("R", "R") } -sendReplResult <- function(slimeConnection, value) { +makeReplResult <- function(value) { string <- printToString(value) - sendToEmacs(slimeConnection, - list(quote(`:write-string`), - paste(string, collapse="\n"), - quote(`:repl-result`))) + list(quote(`:write-string`), paste(string, collapse="\n"), + quote(`:repl-result`)) +} + +makeReplResultFunction <- makeReplResult + +sendReplResult <- function(slimeConnection, value) { + result <- makeReplResultFunction(value) + sendToEmacs(slimeConnection, result) } sendReplResultFunction <- sendReplResult