From 7c0ac31bdfcaca9a564173b7aeed67225e459184 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Wed, 6 Apr 2011 08:49:34 +0100 Subject: [PATCH] absolutify some more source file finding --- swank.R | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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) } -- 2.30.2