Robert Klein <rokl...@roklein.de> writes: > When trying to run a table with missing values with ob-gnuplot.el > there's a “:missing value” option. ob-gnuplot is supposed to put the > “value” into the place of empty cell values before calling on gnuplot. > It doesn't do this currently.
Confirmed The problem is partially because of the way `org-table--to-generic-cell' works. It disallows custom processing of empty table cells unless both :raw and :backend arguments are supplied to `orgtbl-to-generic'. The attached patch should fix the issue, though it may be more reasonable to fix orgtbl-to-generic logic. Nicolas, Is there a rationale behind bypassing :fmt and :hfmt for empty table cells in `org-table--to-generic-cell'? In this patch, I have to work around this using :raw parameter in `orgtbl-to-generic' call. I do not feel like such workaround should be needed. Best, Ihor
>From 7033289d7e717eb841d550fbdbc0cc878b96cd32 Mon Sep 17 00:00:00 2001 Message-Id: <7033289d7e717eb841d550fbdbc0cc878b96cd32.1633005978.git.yanta...@gmail.com> From: Ihor Radchenko <yanta...@gmail.com> Date: Thu, 30 Sep 2021 20:40:37 +0800 Subject: [PATCH] ob-gnuplot: Honour :missing argument * lisp/ob-gnuplot.el (org-babel-gnuplot-table-to-data): Force applying `org-babel-gnuplot-quote-tsv-field' to empty table cells when converting org tables to gnuplot input. By default, `orgtbl-to-generic' ignores :fmt for empty table cells. We need to set :raw to non-nil AND :backend to non-nil to force custom formatting of empty table cells. Fixes https://orgmode.org/list/20210617211347.59e4d...@happy.intern.roklein.de --- lisp/ob-gnuplot.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/ob-gnuplot.el b/lisp/ob-gnuplot.el index 6489c23f5..120aaa18e 100644 --- a/lisp/ob-gnuplot.el +++ b/lisp/ob-gnuplot.el @@ -272,7 +272,7 @@ (defun org-babel-gnuplot-table-to-data (table data-file params) (orgtbl-to-generic table (org-combine-plists - '(:sep "\t" :fmt org-babel-gnuplot-quote-tsv-field) + '(:sep "\t" :fmt org-babel-gnuplot-quote-tsv-field :raw t :backend ascii) params))))) data-file) -- 2.32.0