Christophe Weblog Wiki Code Publications Music
use srcfile$wd when going to source for an sldb frame
authorChristophe Rhodes <csr21@cantab.net>
Wed, 1 Sep 2010 10:11:06 +0000 (11:11 +0100)
committerChristophe Rhodes <csr21@cantab.net>
Wed, 1 Sep 2010 10:11:06 +0000 (11:11 +0100)
it worked before while emacs and R were started with the same working
directory; this is not always going to be the case.

swank.R

diff --git a/swank.R b/swank.R
index bd7e093703fa4a4d5f9fc5ea7e1ad986853ad7fa..13164853c32efb8a4c0c4086229a7431c6d99516 100644 (file)
--- a/swank.R
+++ b/swank.R
@@ -349,9 +349,8 @@ computeRestartsForEmacs <- function (sldbState) {
   if(is.null(srcfile)) {
     list(quote(`:error`), "no srcfile")
   } else {
-    filename <- get("filename", srcfile)
     list(quote(`:location`),
-         list(quote(`:file`), filename),
+         list(quote(`:file`), sprintf("%s/%s", srcfile$wd, srcfile$filename)),
          list(quote(`:line`), srcref[[1]], srcref[[2]]-1),
          FALSE)
   }