From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: [patch] adding :prologue and :epilogue parameters for Maxima src blocks Date: Thu, 05 Jan 2017 15:07:49 +0000 Message-ID: <8760lta6ka.fsf@ucl.ac.uk> Reply-To: Eric S Fraga Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cP9e4-0002Gk-P1 for emacs-orgmode@gnu.org; Thu, 05 Jan 2017 10:08:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cP9e0-00056Q-Rs for emacs-orgmode@gnu.org; Thu, 05 Jan 2017 10:08:00 -0500 Received: from mail-db5eur01on0110.outbound.protection.outlook.com ([104.47.2.110]:24800 helo=EUR01-DB5-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cP9e0-00056I-FN for emacs-orgmode@gnu.org; Thu, 05 Jan 2017 10:07:56 -0500 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 --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hello, Please find attached a small patch for consideration. This patch adds two new parameters to the Maxima babel src blocks: prologue and epilogue, as already exist for gnuplot for instance. I have signed the copyright assignment already (many years ago). Thanks, eric =2D-=20 Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-ob-maxima.el-add-prologue-and-epilogue-src-block-opt.patch Content-Transfer-Encoding: quoted-printable From=207b6a19418bd2e1fd4593939d825496618d86e65e Mon Sep 17 00:00:00 2001 From: Eric S Fraga Date: Thu, 5 Jan 2017 15:03:05 +0000 Subject: [PATCH] ob-maxima.el: add prologue and epilogue src block options = for Maxima * ob-maxima.el (org-babel-maxima-expand): add contents of prologue and epilogue src block options to the body of code. =2D-- lisp/ob-maxima.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ob-maxima.el b/lisp/ob-maxima.el index 4d16156ce..9ff9ff346 100644 =2D-- a/lisp/ob-maxima.el +++ b/lisp/ob-maxima.el @@ -48,9 +48,13 @@ =20 (defun org-babel-maxima-expand (body params) "Expand a block of Maxima code according to its header arguments." =2D (let ((vars (org-babel--get-vars params))) + (let ((vars (org-babel--get-vars params)) + (epilogue (cdr (assq :epilogue params))) + (prologue (cdr (assq :prologue params)))) (mapconcat 'identity (list + ;; any code from the specified prologue at the start + prologue ;; graphic output (let ((graphic-file (ignore-errors (org-babel-graphical-output-file para= ms)))) (if graphic-file @@ -62,6 +66,8 @@ (mapconcat 'org-babel-maxima-var-to-maxima vars "\n") ;; body body + ;; any code from the specified epilogue at the end + epilogue "gnuplot_close ()$") "\n"))) =20 =2D-=20 2.11.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQSPXCedOQfhSlwpVw3IkZPY//z2fQUCWG5hRQAKCRDIkZPY//z2 fa/+AJ9f+ztY1cvnjQgBJkXUuoKmFLGAoQCeOgEuhHltlz3sQQFbxRX2zYQ9QzA= =Bb9p -----END PGP SIGNATURE----- --==-=-=--