From: Christophe Rhodes Date: Sat, 11 Jan 2014 14:40:45 +0000 (+0000) Subject: `swank:describe-function` and `swank:describe-symbol` implementations X-Git-Url: http://christophe.rhodes.io/gitweb/?a=commitdiff_plain;h=fdb4f4d744580b9dc6db92489610f32e42cec15e;p=swankr.git `swank:describe-function` and `swank:describe-symbol` implementations from Philipp Marek, about an eternity ago. --- diff --git a/swank-media.R b/swank-media.R index 59f7d77..1240526 100644 --- a/swank-media.R +++ b/swank-media.R @@ -42,9 +42,7 @@ makeMediaReplResult.matrix <- function(value) { } makeMediaReplResult.help_files_with_topic <- function(value) { - output <- capture.output(tools:::Rd2txt(utils:::.getHelpFile(value), - options=list(underline_titles=FALSE))) - string <- paste(output, collapse="\n") + string <- helpFilesWithTopicString(value) list(quote(`:popup-buffer`), sprintf("*slime-help(%s)*", attr(value, "topic")), string, quote(`ess-help-mode`)) } diff --git a/swank.R b/swank.R index 8ba9060..67fdbbc 100644 --- a/swank.R +++ b/swank.R @@ -361,6 +361,22 @@ sendReplResultFunction <- sendReplResult } } +`swank:describe-function` <- function(slimeConnection, sldbState, op, package) { + ## FIXME: maybe not the best match? + `swank:operator-arglist`(slimeConnection, sldbState, op, package) +} + +helpFilesWithTopicString <- function(value) { + output <- capture.output(tools:::Rd2txt(utils:::.getHelpFile(value), + options=list(underline_titles=FALSE))) + paste(output, collapse="\n") +} + +`swank:describe-symbol` <- function(slimeConnection, sldbState, op, package) { + value <- help(op) + helpFilesWithTopicString(value) +} + `swank:throw-to-toplevel` <- function(slimeConnection, sldbState) { condition <- simpleCondition("Throw to toplevel") class(condition) <- c("swankTopLevel", class(condition))