summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2013-06-21 15:01:54 (GMT)
committer Eric Schulte <schulte.eric@gmail.com>2013-06-21 15:02:12 (GMT)
commitc5cc342e1ce7cc9d8c0c3fe3330da2e007a89b8d (patch)
tree6c3137a460dfbc211e98592b5d821bef3029cae4
parent7f05b315f54e7c451d6b9ea0cb9100ca93cc506a (diff)
downloadorg-mode-c5cc342e1ce7cc9d8c0c3fe3330da2e007a89b8d.zip
org-mode-c5cc342e1ce7cc9d8c0c3fe3330da2e007a89b8d.tar.gz
smarter gnuplot file extension to terminal mapping
* lisp/ob-gnuplot.el (*org-babel-gnuplot-terms*): Smarter gnuplot file extension to terminal mapping. (org-babel-expand-body:gnuplot): Smarter gnuplot file extension to terminal mapping.
-rw-r--r--lisp/ob-gnuplot.el13
1 files changed, 12 insertions, 1 deletions
diff --git a/lisp/ob-gnuplot.el b/lisp/ob-gnuplot.el
index 6baae9f..803309e 100644
--- a/lisp/ob-gnuplot.el
+++ b/lisp/ob-gnuplot.el
@@ -75,6 +75,13 @@ blocks."
:group 'org-babel
:type 'string)
+(defcustom *org-babel-gnuplot-terms*
+ '((eps . "postscript eps"))
+ "List of file extensions and the associated gnuplot terminal."
+ :group 'org-babel
+ :type '(repeat (cons (symbol :tag "File extension")
+ (string :tag "Gnuplot terminal"))))
+
(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
@@ -97,7 +104,11 @@ code."
(let* ((vars (org-babel-gnuplot-process-vars params))
(out-file (cdr (assoc :file params)))
(term (or (cdr (assoc :term params))
- (when out-file (file-name-extension out-file))))
+ (when out-file
+ (let ((ext (file-name-extension out-file)))
+ (or (cdr (assoc (intern (downcase ext))
+ *org-babel-gnuplot-terms*))
+ ext)))))
(cmdline (cdr (assoc :cmdline params)))
(title (cdr (assoc :title params)))
(lines (cdr (assoc :line params)))