~bzg/org-mode

c274128997881513256d57b4de2505603f9be018 — Ihor Radchenko a month ago 66e307b
org-table-eval-formula: Keep empty result in duration (;TtU) mode

* lisp/org-table.el (org-table-eval-formula): When using T, t, or
U (duration) mode, do not convert empty results into duration.  This
is to keep things consistent with default mode.

Reported-by: Jeff Trull <edaskel@att.net>
Link: https://list.orgmode.org/orgmode/CAF_DUeEFpNU5UXjE80yB1MB9xj5oVLqG=XadnkqCdzWtakWdPg@mail.gmail.com/
1 files changed, 10 insertions(+), 5 deletions(-)

M lisp/org-table.el
M lisp/org-table.el => lisp/org-table.el +10 -5
@@ 2657,11 2657,16 @@ location of point."
		       form
		     (calc-eval (cons form calc-modes)
				(when (and (not keep-empty) numbers) 'num)))
		ev (if duration (org-table-time-seconds-to-string
				 (if (string-match "^[0-9]+:[0-9]+\\(?::[0-9]+\\)?$" ev)
				     (string-to-number (org-table-time-string-to-seconds ev))
				   (string-to-number ev))
				 duration-output-format)
		ev (if (and duration
                            ;; When the result is an empty string,
                            ;; keep it empty.
                            ;; See https://list.orgmode.org/orgmode/CAF_DUeEFpNU5UXjE80yB1MB9xj5oVLqG=XadnkqCdzWtakWdPg@mail.gmail.com/
                            (not (string-empty-p ev)))
                       (org-table-time-seconds-to-string
			(if (string-match "^[0-9]+:[0-9]+\\(?::[0-9]+\\)?$" ev)
			    (string-to-number (org-table-time-string-to-seconds ev))
			  (string-to-number ev))
			duration-output-format)
		     ev)))

	(when org-table-formula-debug