From: Christophe Rhodes Date: Wed, 6 Apr 2011 07:49:34 +0000 (+0100) Subject: absolutify some more source file finding X-Git-Url: http://christophe.rhodes.io/gitweb/?a=commitdiff_plain;h=7c0ac31bdfcaca9a564173b7aeed67225e459184;p=swankr.git absolutify some more source file finding --- diff --git a/swank.R b/swank.R index 0384004..0de35f7 100644 --- a/swank.R +++ b/swank.R @@ -304,8 +304,10 @@ sendReplResult <- function(slimeConnection, value) { sendReplResultFunction <- sendReplResult `swank:listener-eval` <- function(slimeConnection, sldbState, string) { + ## O how ugly string <- gsub("#\\.\\(swank:lookup-presented-object-or-lose([^)]*)\\)", ".(`swank:lookup-presented-object-or-lose`(slimeConnection, sldbState,\\1))", string) expr <- parse(text=string)[[1]] + ## O maybe this is even uglier lookedup <- do.call("bquote", list(expr)) value <- eval(lookedup, envir = globalenv()) sendReplResultFunction(slimeConnection, value) @@ -370,8 +372,16 @@ computeRestartsForEmacs <- function (sldbState) { if(is.null(srcfile)) { list(quote(`:error`), "no srcfile") } else { + filename <- get("filename", srcfile) + ## KLUDGE: what this means is "is the srcfile filename + ## absolute?" + if(substr(filename, 1, 1) == "/") { + file <- filename + } else { + file <- sprintf("%s/%s", srcfile$wd, filename) + } list(quote(`:location`), - list(quote(`:file`), sprintf("%s/%s", srcfile$wd, srcfile$filename)), + list(quote(`:file`), file), list(quote(`:line`), srcref[[1]], srcref[[2]]-1), FALSE) }