فهرست منبع

fleshing out the gnuplot task

Eric Schulte 16 سال پیش
والد
کامیت
37d5edbad9
2فایلهای تغییر یافته به همراه61 افزوده شده و 1 حذف شده
  1. 52 0
      lisp/langs/org-babel-gnuplot.el
  2. 9 1
      org-babel.org

+ 52 - 0
lisp/langs/org-babel-gnuplot.el

@@ -0,0 +1,52 @@
+;;; org-babel-gnuplot.el --- org-babel functions for gnuplot evaluation
+
+;; Copyright (C) 2009 Eric Schulte
+
+;; Author: Eric Schulte
+;; Keywords: literate programming, reproducible research
+;; Homepage: http://orgmode.org
+;; Version: 0.01
+
+;;; License:
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+;;
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; Org-Babel support for evaluating gnuplot source code.
+;;
+;; This differs from most standard languages in that
+;;
+;; 1) we are generally only going to return results of type "file"
+;;
+;; 2) we are adding the "file" and "cmdline" header arguments
+
+;;; Code:
+(require 'org-babel)
+
+(org-babel-add-interpreter "gnuplot")
+
+(add-to-list 'org-babel-tangle-langs '("gnuplot" "gnuplot"))
+
+(defun org-babel-execute:gnuplot (body params)
+  "Execute a block of Gnuplot code with org-babel.  This function is
+called by `org-babel-execute-src-block'."
+  (message "executing Gnuplot source code block"))
+
+(defun org-babel-prep-session:gnuplot (session params))
+
+(provide 'org-babel-gnuplot)
+;;; org-babel-gnuplot.el ends here

+ 9 - 1
org-babel.org

@@ -1974,8 +1974,16 @@ This could probably be added to [[file:lisp/org-babel-script.el][org-babel-scrip
 #+resname: implementing-ditaa
 [[file:blue.png][blue.png]]
 
-*** TODO gnuplot
+*** STARTED gnuplot
 (see [[* file result types][file result types]])
+
+- a required =file= header argument
+- a =cmdline= header argument
+- to add variables
+  - scalar variables should be replaced in the body of the gnuplot code
+  - vector variables should be exported to tab-separated files, and
+    the variable names should be replaced with the path to the files
+
 *** TODO dot
 (see [[* file result types][file result types]])