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/
This commit is contained in:
parent
66e307b411
commit
c274128997
|
@ -2657,11 +2657,16 @@ location of point."
|
||||||
form
|
form
|
||||||
(calc-eval (cons form calc-modes)
|
(calc-eval (cons form calc-modes)
|
||||||
(when (and (not keep-empty) numbers) 'num)))
|
(when (and (not keep-empty) numbers) 'num)))
|
||||||
ev (if duration (org-table-time-seconds-to-string
|
ev (if (and duration
|
||||||
(if (string-match "^[0-9]+:[0-9]+\\(?::[0-9]+\\)?$" ev)
|
;; When the result is an empty string,
|
||||||
(string-to-number (org-table-time-string-to-seconds ev))
|
;; keep it empty.
|
||||||
(string-to-number ev))
|
;; See https://list.orgmode.org/orgmode/CAF_DUeEFpNU5UXjE80yB1MB9xj5oVLqG=XadnkqCdzWtakWdPg@mail.gmail.com/
|
||||||
duration-output-format)
|
(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)))
|
ev)))
|
||||||
|
|
||||||
(when org-table-formula-debug
|
(when org-table-formula-debug
|
||||||
|
|
Loading…
Reference in New Issue