ob-scheme: Fix scheme blocks ignoring :results in formatting

* ob-scheme.el (org-babel-execute:scheme): Process the :result header
argument to conditionally and appropriately format output.

Currently, `org-babel-execute:scheme' ignores the user specified :result header
argument found in the :result-param parameter and process all output as a table.
The fix is to pass the `result' and :result-param to the `org-babel-result-cond'
function to invoke the corresponding formatting.

For example, the following block incorrectly formats its output as a table:

(list 1 2 3)

| 1 | 2 | 3 |

This patch results in the correct behavior:

(list 1 2 3)

: (1 2 3)

Bringing it inline with the result using Emacs lisp:

(list 1 2 3)

: (1 2 3)
This commit is contained in:
Henry Blevins 2018-06-20 14:38:47 -04:00 committed by Nicolas Goaziou
parent fbd138f527
commit 9c8de985a5
1 changed files with 4 additions and 1 deletions

View File

@ -212,6 +212,7 @@ This function is called by `org-babel-execute-src-block'"
(session (org-babel-scheme-make-session-name
source-buffer-name (cdr (assq :session params)) impl))
(full-body (org-babel-expand-body:scheme body params))
(result-params (cdr (assq :result-params params)))
(result
(org-babel-scheme-execute-with-geiser
full-body ; code
@ -225,7 +226,9 @@ This function is called by `org-babel-execute-src-block'"
(cdr (assq :colnames params)))
(org-babel-pick-name (cdr (assq :rowname-names params))
(cdr (assq :rownames params))))))
(org-babel-scheme--table-or-string table))))))
(org-babel-result-cond result-params
result
(org-babel-scheme--table-or-string table)))))))
(provide 'ob-scheme)