emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Stephen <yo@groks.org>
To: Emacs OrgMode <emacs-orgmode@gnu.org>
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	[thread overview]
Message-ID: <CAAJJdYaRHqY-0jMiDkpnusku+bxiraQ9eUDSach9fPN6dwQ3pQ@mail.gmail.com> (raw)

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/)

             reply	other threads:[~2015-03-05 20:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-05 20:50 Stephen [this message]
2015-08-05  0:00 ` Bug: org-clock-sum filter infinite loop [8.2.10 (8.2.10-34-gc41bbc-elpa @ /home/me/.emacs.d/elpa/org-20150223/)] Bastien Guerry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAJJdYaRHqY-0jMiDkpnusku+bxiraQ9eUDSach9fPN6dwQ3pQ@mail.gmail.com \
    --to=yo@groks.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).