From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Subject: Bug: org-clock-sum filter infinite loop [8.2.10 (8.2.10-34-gc41bbc-elpa @ /home/me/.emacs.d/elpa/org-20150223/)] Date: Thu, 5 Mar 2015 20:50:15 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTcjE-0002yf-Qe for emacs-orgmode@gnu.org; Thu, 05 Mar 2015 15:50:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YTcjB-0000kE-Is for emacs-orgmode@gnu.org; Thu, 05 Mar 2015 15:50:44 -0500 Received: from mail-wi0-x231.google.com ([2a00:1450:400c:c05::231]:44920) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTcjA-0000jl-Vc for emacs-orgmode@gnu.org; Thu, 05 Mar 2015 15:50:41 -0500 Received: by wivr20 with SMTP id r20so9808310wiv.3 for ; Thu, 05 Mar 2015 12:50:39 -0800 (PST) Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com. [209.85.212.179]) by mx.google.com with ESMTPSA id cf12sm12068724wjb.10.2015.03.05.12.50.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Mar 2015 12:50:37 -0800 (PST) Received: by wibbs8 with SMTP id bs8so10127044wib.0 for ; Thu, 05 Mar 2015 12:50:36 -0800 (PST) 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Emacs OrgMode I want to sum clock times for items which are in state TODO in the agenda. Using org-clocksum-curret-item as a template: (defun org-clock-sum-current-item (&optional tstart) "Return time, clocked on current item in total." (save-excursion (save-restriction (org-narrow-to-subtree) (org-clock-sum tstart) org-clock-file-total-minutes))) The following works the same as above (nil start and end time): (defun my-org-clock-sum-current-item-in-state () (save-excursion (save-restriction (org-narrow-to-subtree) (org-clock-sum nil nil) org-clock-file-total-minutes))) This version with a filter reports zero clocked time, as expected: (defun my-org-clock-sum-current-item-in-state () (save-excursion (save-restriction (org-narrow-to-subtree) (org-clock-sum nil nil (lambda () nil)) org-clock-file-total-minutes))) And this version with a filter goes into an infinite loop some where in org-clock-sum after processing several items: (defun my-org-clock-sum-current-item-in-state () (save-excursion (save-restriction (org-narrow-to-subtree) (org-clock-sum nil nil (lambda () t)) org-clock-file-total-minutes))) I would like to use a filter like: (lambda () (string-equal "TODO" (org-get-todo-state))) But it looks like no filters are working. ------------------------------------------------------------------------ Emacs : GNU Emacs 24.4.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.14.5) of 2014-11-19 on buildvm-03.phx2.fedoraproject.org Package: Org-mode version 8.2.10 (8.2.10-34-gc41bbc-elpa @ /home/me/.emacs.d/elpa/org-20150223/)