From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Corneli Subject: org-table debugging formula - error Date: Thu, 11 Oct 2018 16:06:30 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56716) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAcXv-0002V2-2i for emacs-orgmode@gnu.org; Thu, 11 Oct 2018 11:06:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gAcXq-00022g-S5 for emacs-orgmode@gnu.org; Thu, 11 Oct 2018 11:06:39 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:34648) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gAcXq-00021L-Gq for emacs-orgmode@gnu.org; Thu, 11 Oct 2018 11:06:34 -0400 Received: by mail-wr1-x42b.google.com with SMTP id l6-v6so9678356wrt.1 for ; Thu, 11 Oct 2018 08:06:34 -0700 (PDT) Received: from dhcp-90-218.inf.ed.ac.uk (dhcp-90-218.inf.ed.ac.uk. [129.215.90.218]) by smtp.gmail.com with ESMTPSA id n11-v6sm32946517wra.26.2018.10.11.08.06.31 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Oct 2018 08:06:31 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hello, I got an error when debugging the behaviour of a formula. You'll need: (setq org-table-formula-debug t) Then with any luck this should allow you to reproduce the error: C-c C-c to run formula. | Task | Estimated Effort | |-----------------------+------------------| | INTRODUCTION | 9:30 | |-----------------------+------------------| | BACKGROUND | | |-----------------------+------------------| | FOO WORKFLOW | | |-----------------------+------------------| | BAR WORKFLOW | | |-----------------------+------------------| | BAZ WORKFLOW | | |-----------------------+------------------| | ADDITIONAL WORKFLOWS | 1d 4h 0min | |-----------------------+------------------| | FINDINGS | | |-----------------------+------------------| | ADDITIONAL ANALYSIS | 24:00 | |-----------------------+------------------| | DISCUSSION | | |-----------------------+------------------| | BIBLIOGRAPHY | | |-----------------------+------------------| | Appendix: Status | | | TOTAL WORKDAYS NEEDED | 5d 5h 30min | #+TBLFM: @>$2='(org-duration-from-minutes (apply '+ (map 'list 'org-duration-to-minutes (list @I+1$2 @II+1$2 @III+1$2 @IIII+1$2 @IIIII+1$2 @IIIIII+1$2 @IIIIIII+1$2 @IIIIIIII+1$2)))) I've attached a patch that fixes the problem for me. I'm on Org mode version 9.1.14 (release_9.1.14-974-ga85ba9 @ /Users/joe/org-mode/lisp/) Joe --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=table_gives_error.diff diff --git a/lisp/org-table.el b/lisp/org-table.el index 8eb38ef68..80de97d21 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -2953,7 +2953,7 @@ $xyz-> %s $1-> %s\n" orig formula form0 form)) (if (consp ev) (princ (format " %s^\nError: %s" - (make-string (car ev) ?\-) (nth 1 ev))) + (make-string (floor (car ev)) ?\-) (nth 1 ev))) (princ (format "Result: %s\nFormat: %s\nFinal: %s" ev (or fmt "NONE") (if fmt (format fmt (string-to-number ev)) ev))))) --=-=-=--