only wrap gnuplot data values in " when necessary
authorEric Schulte <schulte.eric@gmail.com>
Fri, 17 May 2013 20:36:01 +0000 (17 14:36 -0600)
committerEric Schulte <schulte.eric@gmail.com>
Fri, 17 May 2013 20:36:10 +0000 (17 14:36 -0600)
* lisp/ob-gnuplot.el (org-babel-gnuplot-quote-tsv-field): Only wrap
  gnuplot data values in " when necessary.

lisp/ob-gnuplot.el

index 80b0bef..e7da3f6 100644 (file)
@@ -234,8 +234,10 @@ then create one.  Return the initialized session.  The current
        (org-babel-gnuplot-quote-timestamp-field s)
       (if (zerop (length s))
          (or *org-babel-gnuplot-missing* s)
-       (concat "\"" (mapconcat 'identity (split-string s "\"") "\"\"")
-               "\"")))))
+       (if (string-match "[ \"]" "?")
+           (concat "\"" (mapconcat 'identity (split-string s "\"") "\"\"")
+                   "\"")
+         s)))))
 
 (defun org-babel-gnuplot-table-to-data (table data-file params)
   "Export TABLE to DATA-FILE in a format readable by gnuplot.