summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2011-06-10 10:49:04 -0600
committerEric Schulte <schulte.eric@gmail.com>2011-06-10 10:49:04 -0600
commit3f90f263360fe0dfc44571e7799fa4b09d7ba0db (patch)
treee6efb4ea2e8d50f8f82e4921bea860311267e1c5
parent889a487ae436ceb34877d87e90828016feeab1ad (diff)
downloadorg-mode-3f90f263360fe0dfc44571e7799fa4b09d7ba0db.tar.gz
ob-ruby: xmpfilter result type for outputting annotated source code
Thanks to Avdi Grimm for suggesting this addition * lisp/ob-ruby.el (xmp): Declaring this function to appease the compiler. (org-babel-execute:ruby): "xmp" result option for outputting annotated source code.
-rw-r--r--lisp/ob-ruby.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/ob-ruby.el b/lisp/ob-ruby.el
index 41245e2..da53912 100644
--- a/lisp/ob-ruby.el
+++ b/lisp/ob-ruby.el
@@ -44,6 +44,7 @@
(eval-when-compile (require 'cl))
(declare-function run-ruby "ext:inf-ruby" (&optional command name))
+(declare-function xmp "ext:rcodetools" (&optional option))
(add-to-list 'org-babel-tangle-lang-exts '("ruby" . "rb"))
@@ -61,8 +62,14 @@ This function is called by `org-babel-execute-src-block'."
(result-type (cdr (assoc :result-type params)))
(full-body (org-babel-expand-body:generic
body params (org-babel-variable-assignments:ruby params)))
- (result (org-babel-ruby-evaluate
- session full-body result-type result-params)))
+ (result (if (member "xmp" result-params)
+ (with-temp-buffer
+ (require 'rcodetools)
+ (insert full-body)
+ (xmp (cdr (assoc :xmp-option params)))
+ (buffer-string))
+ (org-babel-ruby-evaluate
+ session full-body result-type result-params))))
(org-babel-reassemble-table
result
(org-babel-pick-name (cdr (assoc :colname-names params))