From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joost Helberg Subject: error in calculating percentages in clocktables Date: Mon, 29 Nov 2010 11:56:16 +0100 (CET) Message-ID: <20101129.115616.179398633.joost@snow.nl> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=58654 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PN1PB-0006XT-8n for emacs-orgmode@gnu.org; Mon, 29 Nov 2010 05:56:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PN1PA-0005fV-2p for emacs-orgmode@gnu.org; Mon, 29 Nov 2010 05:56:21 -0500 Received: from mx.snow.nl ([213.154.248.146]:33193) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PN1P9-0005fA-UO for emacs-orgmode@gnu.org; Mon, 29 Nov 2010 05:56:20 -0500 Received: from intern.snow.nl (neerijnen.snow.nl [213.154.248.134]) by mx.snow.nl (Postfix) with ESMTP id 1E8D9403CB for ; Mon, 29 Nov 2010 11:56:17 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by intern.snow.nl (Postfix) with ESMTP id CECC9F1201 for ; Mon, 29 Nov 2010 11:56:16 +0100 (CET) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org ls, I'm using clocktables and encountered an issue in calculating the percentage in the last column. Some columns have moved 1 left in the head-revision, but the generated formula was not changed. Hence the following patch. The percentages come out OK with this patch. Can someone using clocktables verify that this patch is correct and doesn't break other stuff? diff --git a/lisp/org-clock.el b/lisp/org-clock.el index eb859df..0c7c73b 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -2173,9 +2173,9 @@ from the dynamic block defintion." (format "\n#+TBLFM: $%d='(org-clock-time%% @%d$%d $%d..$%d);%%.1f" pcol - (+ 2 (if narrow 1 0)) - (+ 3 (if multifile 1 0)) - (+ (if multifile 1 0) 3) + (+ 1 (if narrow 1 0)) + (+ 2 (if multifile 1 0)) + (+ (if multifile 1 0) 2) (1- pcol))) (setq recalc t)) ((stringp formula) regards, Joost Helberg -- Snow B.V. http://snow.nl