From aad8eb548e7a7a7fde1908a9f9c66f980da10b56 Mon Sep 17 00:00:00 2001 From: Daniele Nicolodi Date: Tue, 20 Oct 2020 15:22:02 +0200 Subject: [PATCH 3/3] org-table: Add mode flag to enable Calc units simplification mode * org-table.el (org-table-eval-formula): Add the `u` mode flag to enable Calc's units simplification mode. --- lisp/org-table.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org-table.el b/lisp/org-table.el index 4baad2600..6b92656bd 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -2447,11 +2447,12 @@ location of point." (?e (org-table--set-calc-mode 'calc-float-format (list 'eng n))))) ;; Remove matched flags from the mode string. (setq fmt (replace-match "" t t fmt))) - (while (string-match "\\([tTUNLEDRFS]\\)" fmt) + (while (string-match "\\([tuTUNLEDRFS]\\)" fmt) (let ((c (string-to-char (match-string 1 fmt)))) (cl-case c (?t (setq duration t numbers t duration-output-format org-table-duration-custom-format)) + (?u (org-table--set-calc-mode 'calc-simplify-mode 'units)) (?T (setq duration t numbers t duration-output-format nil)) (?U (setq duration t numbers t duration-output-format 'hh:mm)) (?N (setq numbers t)) -- 2.28.0