From 303d24062c70b2e89370714965736b2bfe380175 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Thu, 16 Sep 2010 20:59:46 +0100 Subject: [PATCH 1/1] new makeReplResultFunction hook default makeReplResult function doing the standard (:write-string value :repl-result) thing for the REPL. --- swank.R | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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 -- 2.30.2