1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-22 07:09:47 +00:00

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.
This commit is contained in:
Eric Schulte 2011-06-10 10:49:04 -06:00
parent 889a487ae4
commit 3f90f26336

View File

@ -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))