summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasushi SHOJI <yashi@atmark-techno.com>2014-03-11 02:26:47 +0900
committerBastien Guerry <bzg@altern.org>2014-03-13 12:56:54 +0100
commite2b6c506c28540943c9802a46500c940baa793be (patch)
treeb60d6cefe6ed764671feb5bf0eefc8a4e61974d0
parentbca8a49363ddfe93fafe9a2bd2849554f50ec6dc (diff)
downloadorg-mode-e2b6c506c28540943c9802a46500c940baa793be.tar.gz
org-plot: Handle explicit date/time index
* lisp/org-plot.el (org-plot-quote-tsv-field): Dump data as is when `timeind' is set. * lisp/org-plot.el (org-plot/gnuplot): By-pass type checking when either `textind' or `timeind' is set. The current org-plot relies on `org-table-number-regexp' and `org-ts-regexp3' to check the index type. However, we already have `timeind' to indicate that the index is the datatype of date/time. By-pass the type checking in `org-plot/gnuplot' when either `textind' or `timeind' is set. The whole point of the check is to determine the type. We do not need that when we already know. Also dump the date/time data with `org-plot-quote-tsv-field' as is, without double quotes, when `timeind' is set. So that we can use `timefmt' to read what we have. Currently we do not have a good way to specify `timefmt' with the double quotes. TINYCHANGE
-rw-r--r--lisp/org-plot.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/org-plot.el b/lisp/org-plot.el
index 556b9ef..b5000ea 100644
--- a/lisp/org-plot.el
+++ b/lisp/org-plot.el
@@ -109,7 +109,8 @@ will be added. Returns the resulting property list."
(defun org-plot-quote-tsv-field (s)
"Quote field S for export to gnuplot."
- (if (string-match org-table-number-regexp s) s
+ (if (or (string-match org-table-number-regexp s)
+ (plist-get params :timeind)) s
(if (string-match org-ts-regexp3 s)
(org-plot-quote-timestamp-field s)
(concat "\"" (mapconcat 'identity (split-string s "\"") "\"\"") "\""))))
@@ -312,7 +313,9 @@ line directly before or after the table."
(when y-labels (plist-put params :ylabels y-labels)))))
;; check for timestamp ind column
(let ((ind (- (plist-get params :ind) 1)))
- (when (and (>= ind 0) (equal '2d (plist-get params :plot-type)))
+ (when (and (>= ind 0) (equal '2d (plist-get params :plot-type))
+ (not (or (plist-get params :timeind)
+ (plist-get params :textind))))
(if (= (length
(delq 0 (mapcar
(lambda (el)