aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/org/ob-gnuplot.el
diff options
context:
space:
mode:
authorAlan Mackenzie2022-01-22 11:02:50 +0000
committerAlan Mackenzie2022-01-22 11:02:50 +0000
commit14d64a8adcc866deecd758b898e8ef2d836b354a (patch)
tree83cff9669e266f8e283ccb8cd7518e909240f1e1 /lisp/org/ob-gnuplot.el
parentbdd9b5b8a0d37dd09ee530c1dab3a44bee09e0f8 (diff)
parentebe334cdc234de2897263aed4c05ac7088c11857 (diff)
downloademacs-scratch/correct-warning-pos.tar.gz
emacs-scratch/correct-warning-pos.zip
Merge branch 'master' into scratch/correct-warning-posscratch/correct-warning-pos
Diffstat (limited to 'lisp/org/ob-gnuplot.el')
-rw-r--r--lisp/org/ob-gnuplot.el25
1 files changed, 10 insertions, 15 deletions
diff --git a/lisp/org/ob-gnuplot.el b/lisp/org/ob-gnuplot.el
index 69a5f5f91bd..895738822de 100644
--- a/lisp/org/ob-gnuplot.el
+++ b/lisp/org/ob-gnuplot.el
@@ -129,6 +129,7 @@ code."
129 (title (cdr (assq :title params))) 129 (title (cdr (assq :title params)))
130 (lines (cdr (assq :line params))) 130 (lines (cdr (assq :line params)))
131 (sets (cdr (assq :set params))) 131 (sets (cdr (assq :set params)))
132 (missing (cdr (assq :missing params)))
132 (x-labels (cdr (assq :xlabels params))) 133 (x-labels (cdr (assq :xlabels params)))
133 (y-labels (cdr (assq :ylabels params))) 134 (y-labels (cdr (assq :ylabels params)))
134 (timefmt (cdr (assq :timefmt params))) 135 (timefmt (cdr (assq :timefmt params)))
@@ -138,6 +139,7 @@ code."
138 (file-name-directory (buffer-file-name)))) 139 (file-name-directory (buffer-file-name))))
139 (add-to-body (lambda (text) (setq body (concat text "\n" body))))) 140 (add-to-body (lambda (text) (setq body (concat text "\n" body)))))
140 ;; append header argument settings to body 141 ;; append header argument settings to body
142 (when missing (funcall add-to-body (format "set datafile missing '%s'" missing)))
141 (when title (funcall add-to-body (format "set title '%s'" title))) 143 (when title (funcall add-to-body (format "set title '%s'" title)))
142 (when lines (mapc (lambda (el) (funcall add-to-body el)) lines)) 144 (when lines (mapc (lambda (el) (funcall add-to-body el)) lines))
143 (when sets 145 (when sets
@@ -288,21 +290,14 @@ Pass PARAMS through to `orgtbl-to-generic' when exporting TABLE."
288 (with-temp-file data-file 290 (with-temp-file data-file
289 (insert (let ((org-babel-gnuplot-timestamp-fmt 291 (insert (let ((org-babel-gnuplot-timestamp-fmt
290 (or (plist-get params :timefmt) "%Y-%m-%d-%H:%M:%S"))) 292 (or (plist-get params :timefmt) "%Y-%m-%d-%H:%M:%S")))
291 (replace-regexp-in-string 293 (orgtbl-to-generic
292 ;; org export backend adds "|" at the beginning/end of 294 table
293 ;; the table lines. Strip those. 295 (org-combine-plists
294 "^|\\(.+\\)|$" 296 '( :sep "\t" :fmt org-babel-gnuplot-quote-tsv-field
295 "\\1" 297 ;; Two setting below are needed to make :fmt work.
296 (orgtbl-to-generic 298 :raw t
297 table 299 :backend ascii)
298 (org-combine-plists 300 params)))))
299 '( :sep "\t" :fmt org-babel-gnuplot-quote-tsv-field
300 ;; Two setting below are needed to make :fmt work.
301 :raw t
302 ;; Use `org', not `ascii' because `ascii' may
303 ;; sometimes mishandle quoted strings.
304 :backend org)
305 params))))))
306 data-file) 301 data-file)
307 302
308(provide 'ob-gnuplot) 303(provide 'ob-gnuplot)