From: Christophe Rhodes Date: Tue, 13 Sep 2011 11:40:20 +0000 (+0100) Subject: support ?help buffers X-Git-Url: http://christophe.rhodes.io/gitweb/?a=commitdiff_plain;h=a4e616b468f6c3dc31dcc9ab6902e18037c049f2;p=swankr.git support ?help buffers use new fancy :popup-buffer event in slime-media. --- diff --git a/BUGS.org b/BUGS.org index f8b4be6..24cd075 100644 --- a/BUGS.org +++ b/BUGS.org @@ -28,7 +28,7 @@ * RESOLVED #8 startup is not filesystem-location independent :MINOR:FIXED: Requires the cwd to be the swankr directory to be able to find swank-presentations and swank-media -* OPEN #9 help and ? to produce help buffers :WISHLIST: +* RESOLVED #9 help and ? to produce help buffers :WISHLIST:FIXED: Not like ESS, though: that works by looking at the user's input with a regexp. Use slime-media? * RESOLVED #10 0 or more than 1 exprs at REPL :MINOR:FIXED: diff --git a/swank-media.R b/swank-media.R index 01ea682..1d7071d 100644 --- a/swank-media.R +++ b/swank-media.R @@ -41,4 +41,12 @@ makeMediaReplResult.matrix <- function(value) { makeMediaReplResult.default(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") + list(quote(`:popup-buffer`), sprintf("*slime-help(%s)*", attr(value, "topic")), + string, quote(`ess-help-mode`)) +} + makeReplResultFunction <- makeMediaReplResult