alphapapa/org-super-agenda

':children todo' doesn't seem to work

bleggett opened this issue · 7 comments

First off, this package is AMAZING and is letting me get rid of lots of handrolled/copypasted org-agenda cruft, so thanks. I'm like 90% of the way to replacing half of my emacs config file with a 10-line statement.

Second, I'm either doing something wrong or :children todo isn't working consistently.

Given this TODO item with children (but no TODO tagged children):
Screen Shot 2019-03-13 at 12 32 12 PM

and this o-s-a group config:

    (setq org-super-agenda-groups
     '((:name "Active Projects"
              :and (:todo "TODO" :children todo))
       (:name "Stuck Projects"
              :and (:todo ("WAITING" "HOLD") :children todo))
       (:name "Pending Refile"
              :tag "REFILE")
       (:name "On Hold"
              :order 99)))

I'm still seeing the above TODO entry in Active Projects, even though my understanding of :and (:todo "TODO" :children todo) is that it should ONLY include things that

  1. Have a todo keyword
    AND
  2. Have children with todo keywords

and the entry in question fails # 2, and so should be filtered out of the group, but isn't.

Any ideas? Am I misunderstanding something here?

Hi,

Thanks for the kind words and the detailed bug report. You seem to be correct in that it's not behaving quite right. I need to add to the test case and investigate further.

It's possible that the version of Org being used is relevant. Which version of Org and Emacs are you using?

Thanks.

After a bit more checking, I'm not sure what the problem is. Here's what I did:

  1. Make new Org file containing:
* TODO DASH7?
  1. Eval:
(setq org-super-agenda-groups
      '((:name "Active Projects"
               :and (:todo "TODO" :children todo))
        (:name "Stuck Projects"
               :and (:todo ("WAITING" "HOLD") :children todo))
        (:name "Pending Refile"
               :tag "REFILE")
        (:name "On Hold"
               :order 99)))
  1. In the Org file buffer, C-c a < t to show to-do items restricted to that buffer.

The resulting "Global list of TODO items of type: ALL" *Org Agenda* buffer had no items.

Then I added a child to-do item to the DASH7 item and re-ran the agenda search, and the DASH7 item was shown under the Active Projects group, and the child item was shown in the Other items group.

So while I did find some incorrect behavior in the existing test case, testing the specific scenario you describe seems to work correctly.

Can you verify this with an ECM?

Thanks.

Yes, and what you describe is what I see as well. The problem however is that I still see the DASH7 item in the Active Projects list if I remove the TODO keyword from its child item, making it a TODO item with no child TODOs, just child bullets.

Screen Shot 2019-03-14 at 8 15 58 AM

See? The project has child items, but none of them are TODO child items, so I would expect :children todo to filter DASH7 out of the Active Projects listing (because while there ARE children, there are no TODO-tagged children) and it does not.

Versions are
Emacs: GNU Emacs 26.1.91 (build 1, x86_64-apple-darwin18.2.0, Carbon Version 158 AppKit 1671.2)\n of 2019-02-13
Org: 9.2.2

I'm not strong with Elisp at all or I'd debug and PR myself, but imagine that something is funky with ~line 507 of org-super-agenda.el

Either org-super-agenda--map-children isn't interpreting the form arg correctly, or org-entry-is-todo-p is somehow reporting the wrong thing, which would be an Org bug.

   (org-super-agenda--map-children
               :form (org-entry-is-todo-p)
               :any t))

Ok, I think I've fixed it. Please let me know if it works correctly for you now. Thanks for reporting!

Works, thanks!

whirm commented

I'm having the same issue with 1.2-pre from melpa.

The following TODO entry will be selected with :children todo.

* TODO [#C] non-Project
** subheading 1
** subheading 2
** subheading 3
** subheading 4
** subheading 5

Thanks!

@whirm Thanks, it should be actually fixed now.