diff options
author | Eric Schulte <schulte.eric@gmail.com> | 2011-06-10 10:49:04 -0600 |
---|---|---|
committer | Eric Schulte <schulte.eric@gmail.com> | 2011-06-10 10:49:04 -0600 |
commit | 3f90f263360fe0dfc44571e7799fa4b09d7ba0db (patch) | |
tree | e6efb4ea2e8d50f8f82e4921bea860311267e1c5 | |
parent | 889a487ae436ceb34877d87e90828016feeab1ad (diff) | |
download | org-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.el | 11 |
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)) |