Nicolas Goaziou <m...@nicolasgoaziou.fr> writes: > I'm not sure. I wrote this some years ago. I guess the rationale at that > time was that it didn't feel useful to apply a format to an empty cell. > For example, if you use `:fmt "$%s$"', I assume you wouldn't want to get > "$$" in otherwise empty cells.
Also makes sense. At this point, third-party code is likely to rely on the existing logic, so I do not see any reason to insist on changing org-table. To avoid confusion, can we change the docstring explicitly saying that empty cells are ignored? (see the attached) Best, Ihor
>From 60365a164147dfc71f0047661c143b54064a459b Mon Sep 17 00:00:00 2001 Message-Id: <60365a164147dfc71f0047661c143b54064a459b.1633060596.git.yanta...@gmail.com> From: Ihor Radchenko <yanta...@gmail.com> Date: Fri, 1 Oct 2021 11:40:54 +0800 Subject: [PATCH] orgtbl-to-generic: Mention that :fmt is ignored for empty cells * lisp/org-table.el (orgtbl-to-generic): Amend docstring mentioning that :fmt is ignored for empty table cells. --- lisp/org-table.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lisp/org-table.el b/lisp/org-table.el index 89c57fb06..3fed15054 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -5649,6 +5649,9 @@ (defun orgtbl-to-generic (table params) (:fmt (2 \"$%s$\" 4 (lambda (c) (format \"$%s$\" c)))) + The format is ignored for empty fields. Use :raw t with non-nil + :backend option to force formatting empty fields. + :hlstart :hllstart :hlend :hllend :hsep :hlfmt :hllfmt :hfmt Same as above, specific for the header lines in the table. -- 2.32.0