]> rhodes.io Git - swankr.git/commitdiff
Christophe Weblog Wiki Code Publications Music
new makeReplResultFunction hook
authorChristophe Rhodes <csr21@cantab.net>
Thu, 16 Sep 2010 19:59:46 +0000 (20:59 +0100)
committerChristophe Rhodes <csr21@cantab.net>
Thu, 16 Sep 2010 19:59:46 +0000 (20:59 +0100)
default makeReplResult function doing the standard
(:write-string value :repl-result) thing for the REPL.

swank.R

diff --git a/swank.R b/swank.R
index bf5333a3d94f450a69fbe48aaa36f9dbb552f8da..c0adff899a9a8b895f06cf692d53a21cf0b9c6ed 100644 (file)
--- 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