Re: [O] [patch] adding :prologue and :epilogue parameters for Maxima src blocks

2017-01-09 Thread Eric S Fraga
On Sunday,  8 Jan 2017 at 23:39, Nicolas Goaziou wrote:
> Applied. Thank you.

Thanks.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 26.0.50.1, Org release_9.0.2-104-gf5b7de


signature.asc
Description: PGP signature


Re: [O] [patch] adding :prologue and :epilogue parameters for Maxima src blocks

2017-01-08 Thread Nicolas Goaziou
Hello,

Eric S Fraga  writes:

> Sure although I'm not entirely sure what format you want this in nor how
> long an entry you would like so here goes:

Anything is fine as long as users are notified there was a change in
that area.

> Babel options ":prologue" and ":epilogue" have been implemented for
> Maxima src blocks which prepend and append, respectively, the given code
> strings.  This can be useful for specifying formatting settings which
> would add clutter to exported code.  For instance, you can use this
> ~:prologue "fpprintprec: 2; linel: 50;"~ for presenting Maxima results
> in a beamer presentation.

Applied. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] [patch] adding :prologue and :epilogue parameters for Maxima src blocks

2017-01-08 Thread Eric S Fraga
On Saturday,  7 Jan 2017 at 14:53, Nicolas Goaziou wrote:
> Hello,
>
> Eric S Fraga  writes:
>
>> 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.
>
> Thank you. Applied.

Thank you!

> Would you mind providing an ORG-NEWS entry for this?

Sure although I'm not entirely sure what format you want this in nor how
long an entry you would like so here goes:

Babel options ":prologue" and ":epilogue" have been implemented for
Maxima src blocks which prepend and append, respectively, the given code
strings.  This can be useful for specifying formatting settings which
would add clutter to exported code.  For instance, you can use this
~:prologue "fpprintprec: 2; linel: 50;"~ for presenting Maxima results
in a beamer presentation.

Thanks again,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 26.0.50.1, Org release_9.0.2-104-gf5b7de


signature.asc
Description: PGP signature


Re: [O] [patch] adding :prologue and :epilogue parameters for Maxima src blocks

2017-01-07 Thread Nicolas Goaziou
Hello,

Eric S Fraga  writes:

> 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.

Thank you. Applied.

Would you mind providing an ORG-NEWS entry for this?

> I have signed the copyright assignment already (many years ago).

Indeed. You are already in the Org Hall of Fame
()

Regards,

-- 
Nicolas Goaziou



[O] [patch] adding :prologue and :epilogue parameters for Maxima src blocks

2017-01-05 Thread Eric S Fraga
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

-- 
Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D)
From 7b6a19418bd2e1fd4593939d825496618d86e65e Mon Sep 17 00:00:00 2001
From: Eric S Fraga 
Date: Thu, 5 Jan 2017 15:03:05 +
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.
---
 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
--- a/lisp/ob-maxima.el
+++ b/lisp/ob-maxima.el
@@ -48,9 +48,13 @@
 
 (defun org-babel-maxima-expand (body params)
   "Expand a block of Maxima code according to its header arguments."
-  (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 params
 		  (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")))
 
-- 
2.11.0



signature.asc
Description: PGP signature