emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: oldk1331 <oldk1331@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] ob-scheme: Handle :epilogue params
Date: Wed, 18 Dec 2019 17:08:25 +0800	[thread overview]
Message-ID: <e8917a9f-31ec-e1d9-9b75-43d1cc02441c@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1121 bytes --]

Hi all,

This is a simple change that adds support for :epilogue in ob-scheme.

Best wishes,
Qian

==========

* lisp/ob-scheme.el (org-babel-expand-body:scheme): Add :epilogue
  param support.

TINYCHANGE
---
 lisp/ob-scheme.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/ob-scheme.el b/lisp/ob-scheme.el
index 21d9fad2b..ee0d93c13 100644
--- a/lisp/ob-scheme.el
+++ b/lisp/ob-scheme.el
@@ -71,7 +71,8 @@
 (defun org-babel-expand-body:scheme (body params)
   "Expand BODY according to PARAMS, return the expanded body."
   (let ((vars (org-babel--get-vars params))
-	(prepends (cdr (assq :prologue params))))
+	(prepends (cdr (assq :prologue params)))
+	(postpends (cdr (assq :epilogue params))))
     (concat (and prepends (concat prepends "\n"))
 	    (if (null vars) body
 	      (format "(let (%s)\n%s\n)"
@@ -80,7 +81,8 @@
 			 (format "%S" (print `(,(car var) ',(cdr var)))))
 		       vars
 		       "\n      ")
-		      body)))))
+		      body))
+	    (and postpends (concat "\n" postpends)))))


 (defvar org-babel-scheme-repl-map (make-hash-table :test #'equal)
-- 
2.24.0



[-- Attachment #2: 0001-ob-scheme-Handle-epilogue-params.patch --]
[-- Type: text/x-patch, Size: 1210 bytes --]

From 168aaf5ea6c855dfab96d1df6ea85996ba643253 Mon Sep 17 00:00:00 2001
From: Qian Yun <oldk1331@gmail.com>
Date: Wed, 18 Dec 2019 16:53:01 +0800
Subject: [PATCH] ob-scheme: Handle :epilogue params

* lisp/ob-scheme.el (org-babel-expand-body:scheme): Add :epilogue
  param support.

TINYCHANGE
---
 lisp/ob-scheme.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/ob-scheme.el b/lisp/ob-scheme.el
index 21d9fad2b..ee0d93c13 100644
--- a/lisp/ob-scheme.el
+++ b/lisp/ob-scheme.el
@@ -71,7 +71,8 @@
 (defun org-babel-expand-body:scheme (body params)
   "Expand BODY according to PARAMS, return the expanded body."
   (let ((vars (org-babel--get-vars params))
-	(prepends (cdr (assq :prologue params))))
+	(prepends (cdr (assq :prologue params)))
+	(postpends (cdr (assq :epilogue params))))
     (concat (and prepends (concat prepends "\n"))
 	    (if (null vars) body
 	      (format "(let (%s)\n%s\n)"
@@ -80,7 +81,8 @@
 			 (format "%S" (print `(,(car var) ',(cdr var)))))
 		       vars
 		       "\n      ")
-		      body)))))
+		      body))
+	    (and postpends (concat "\n" postpends)))))
 
 
 (defvar org-babel-scheme-repl-map (make-hash-table :test #'equal)
-- 
2.24.0



             reply	other threads:[~2019-12-18  9:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-18  9:08 oldk1331 [this message]
2019-12-18 12:46 ` [PATCH] ob-scheme: Handle :epilogue params Neil Jerram
2020-02-03 19:26 ` Bastien

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e8917a9f-31ec-e1d9-9b75-43d1cc02441c@gmail.com \
    --to=oldk1331@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 public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).