Christophe Weblog Wiki Code Publications Music
more working `swank:compile-file-for-emacs`
authorChristophe Rhodes <csr21@cantab.net>
Thu, 7 Oct 2010 22:09:09 +0000 (23:09 +0100)
committerChristophe Rhodes <csr21@cantab.net>
Thu, 7 Oct 2010 22:09:09 +0000 (23:09 +0100)
Firstly, only parse, don't source, as that seems to be the
protocol (the emacs side is responsible for requesting a load if
desired).  Secondly, the protocol is also to return a
compilation-result structure rather than just TRUE, so do that too.

swank.R

diff --git a/swank.R b/swank.R
index 22cec64d58f898fad9ce4c68b22110bdd4b4c103..fe60f7db49e0c18d9a776996b35b7e49c749bf5f 100644 (file)
--- a/swank.R
+++ b/swank.R
@@ -629,10 +629,6 @@ emacsInspect.numeric <- function(numeric) {
 }
 
 `swank:compile-file-for-emacs` <- function(slimeConnection, sldbState, filename, loadp, ...) {
-  if(loadp==quote(`t`)) {
-    source(filename, local=FALSE)
-  } else {
-    parse(filename)
-  }
-  TRUE
+  times <- system.time(parse(filename))
+  list(quote(`:compilation-result`), list(), TRUE, times[3], substitute(loadp), filename)
 }