summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2013-06-21 08:51:41 -0600
committerEric Schulte <schulte.eric@gmail.com>2013-06-21 09:02:12 -0600
commit7f05b315f54e7c451d6b9ea0cb9100ca93cc506a (patch)
treec69c73a0df32f295377ff0c0b80f1942915e0c4a
parent3fe512d7caafccb5f03bbc6af6ee7f5240a36316 (diff)
downloadorg-mode-7f05b315f54e7c451d6b9ea0cb9100ca93cc506a.tar.gz
customization variable prefix gnuplot code blocks
* lisp/ob-gnuplot.el (*org-babel-gnuplot-prefix*): Customization variable prefix gnuplot code blocks. (org-babel-expand-body:gnuplot): Customization variable prefix gnuplot code blocks.
-rw-r--r--lisp/ob-gnuplot.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/lisp/ob-gnuplot.el b/lisp/ob-gnuplot.el
index 7ea039a..6baae9f 100644
--- a/lisp/ob-gnuplot.el
+++ b/lisp/ob-gnuplot.el
@@ -68,6 +68,13 @@
(defvar *org-babel-gnuplot-missing* nil)
+(defcustom *org-babel-gnuplot-prefix* nil
+ "Optional prefix to send to gnuplot before the body of every code block.
+For example \"reset\" may be used to reset gnuplot between
+blocks."
+ :group 'org-babel
+ :type 'string)
+
(defun org-babel-gnuplot-process-vars (params)
"Extract variables from PARAMS and process the variables.
Dumps all vectors into files and returns an association list
@@ -144,7 +151,9 @@ code."
(mapc (lambda (pair)
(setq body (replace-regexp-in-string
(format "\\$%s" (car pair)) (cdr pair) body)))
- vars))
+ vars)
+ (when *org-babel-gnuplot-prefix*
+ (funcall add-to-body *org-babel-gnuplot-prefix*)))
body))
(defun org-babel-execute:gnuplot (body params)