Christophe Weblog Wiki Code Publications Music
implement swank:load-file and swank:compile-file-for-emacs
[swankr.git] / swank.R
diff --git a/swank.R b/swank.R
index 5fe20bbefe633d6a9f1c1e0009f11e0cef32c9d6..22cec64d58f898fad9ce4c68b22110bdd4b4c103 100644 (file)
--- a/swank.R
+++ b/swank.R
@@ -622,3 +622,17 @@ emacsInspect.numeric <- function(numeric) {
   setwd(directory)
   `swank:default-directory`(slimeConnection, sldbState)
 }
+
+`swank:load-file` <- function(slimeConnection, sldbState, filename) {
+  source(filename, local=FALSE)
+  TRUE
+}
+
+`swank:compile-file-for-emacs` <- function(slimeConnection, sldbState, filename, loadp, ...) {
+  if(loadp==quote(`t`)) {
+    source(filename, local=FALSE)
+  } else {
+    parse(filename)
+  }
+  TRUE
+}