Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

':children todo' doesn't seem to work #75

Closed
bleggett opened this issue Mar 13, 2019 · 7 comments
Closed

':children todo' doesn't seem to work #75

bleggett opened this issue Mar 13, 2019 · 7 comments

Comments

@bleggett
Copy link

bleggett commented Mar 13, 2019

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?

@bleggett bleggett changed the title :children todo doesn't seem to work ':children todo' doesn't seem to work Mar 13, 2019
@alphapapa
Copy link
Owner

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.

@alphapapa
Copy link
Owner

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.

@bleggett
Copy link
Author

bleggett commented Mar 14, 2019

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

@alphapapa
Copy link
Owner

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

alphapapa added a commit that referenced this issue Mar 15, 2019
Fixes #75.  Thanks to Ben Leggett (@bleggett) for reporting.
@bleggett
Copy link
Author

Works, thanks!

alphapapa added a commit that referenced this issue Jul 12, 2019
Fixes #75.  Thanks to Ben Leggett (@bleggett) for reporting.
@whirm
Copy link

whirm commented Aug 9, 2019

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!

alphapapa added a commit that referenced this issue Aug 9, 2019
Actually fixes #75.  Thanks to Elric Milon (@whirm) for reporting.
@alphapapa
Copy link
Owner

@whirm Thanks, it should be actually fixed now.

dancn pushed a commit to dancn/org-super-agenda that referenced this issue Apr 24, 2020
Fixes alphapapa#75.  Thanks to Ben Leggett (@bleggett) for reporting.
dancn pushed a commit to dancn/org-super-agenda that referenced this issue Apr 24, 2020
Actually fixes alphapapa#75.  Thanks to Elric Milon (@whirm) for reporting.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants