From: Henry Blevins <heblevi@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] ob-scheme.el: Fix scheme blocks ignoring :results in formatting
Date: Wed, 20 Jun 2018 15:36:32 -0400 [thread overview]
Message-ID: <CABO_LA=H-b_uc=2D9dkYPoGdJSjes8Hazttq_ERwdj27J1sOEA@mail.gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 325 bytes --]
Currently, scheme babel blocks ignore :results header arguments like
'verbatim' and attempt to format all output as tables. This patch corrects
that and performs the user supplied formatting.
This is my first time contributing a patch, so I apologize if I have made
any mistakes in submitting this.
Regards,
Henry Blevins
[-- Attachment #1.2: Type: text/html, Size: 465 bytes --]
[-- Attachment #2: 0001-ob-scheme.el-Fix-scheme-blocks-ignoring-results-in-f.patch --]
[-- Type: text/x-patch, Size: 1952 bytes --]
From f93f086cbb16926c883a31fe8ad796e0da8bc8f7 Mon Sep 17 00:00:00 2001
From: Henry Blevins <heblevi@gmail.com>
Date: Wed, 20 Jun 2018 14:38:47 -0400
Subject: [PATCH] ob-scheme.el: 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)
---
lisp/ob-scheme.el | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lisp/ob-scheme.el b/lisp/ob-scheme.el
index 0abac7462..fb7c48bbc 100644
--- a/lisp/ob-scheme.el
+++ b/lisp/ob-scheme.el
@@ -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)
--
2.17.0
next reply other threads:[~2018-06-20 19:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-20 19:36 Henry Blevins [this message]
2018-06-21 16:16 ` [PATCH] ob-scheme.el: Fix scheme blocks ignoring :results in formatting Nicolas Goaziou
2018-06-21 19:05 ` Henry Blevins
2018-06-21 20:02 ` Nicolas Goaziou
2018-06-21 17:56 ` Neil Jerram
2018-06-21 18:44 ` Henry Blevins
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CABO_LA=H-b_uc=2D9dkYPoGdJSjes8Hazttq_ERwdj27J1sOEA@mail.gmail.com' \
--to=heblevi@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.