From mboxrd@z Thu Jan 1 00:00:00 1970 From: oldk1331 Subject: [PATCH] ob-scheme: Handle :epilogue params Date: Wed, 18 Dec 2019 17:08:25 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------34DC582F160C4F3F4EBBE34F" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:46719) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihVJo-0006uF-KW for emacs-orgmode@gnu.org; Wed, 18 Dec 2019 04:08:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihVJn-0007QV-I8 for emacs-orgmode@gnu.org; Wed, 18 Dec 2019 04:08:32 -0500 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:42930) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihVJn-0007Lb-Ah for emacs-orgmode@gnu.org; Wed, 18 Dec 2019 04:08:31 -0500 Received: by mail-pl1-x643.google.com with SMTP id p9so685261plk.9 for ; Wed, 18 Dec 2019 01:08:31 -0800 (PST) Received: from [10.67.20.89] ([45.122.156.254]) by smtp.gmail.com with ESMTPSA id y199sm2143295pfb.137.2019.12.18.01.08.27 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Dec 2019 01:08:29 -0800 (PST) Content-Language: en-US List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org This is a multi-part message in MIME format. --------------34DC582F160C4F3F4EBBE34F Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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 --------------34DC582F160C4F3F4EBBE34F Content-Type: text/x-patch; charset=UTF-8; name="0001-ob-scheme-Handle-epilogue-params.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-ob-scheme-Handle-epilogue-params.patch" >From 168aaf5ea6c855dfab96d1df6ea85996ba643253 Mon Sep 17 00:00:00 2001 From: Qian Yun 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 --------------34DC582F160C4F3F4EBBE34F--