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

Sibling predicates #105

Open
Zetagon opened this issue Mar 26, 2020 · 6 comments
Open

Sibling predicates #105

Zetagon opened this issue Mar 26, 2020 · 6 comments
Assignees

Comments

@Zetagon
Copy link

Zetagon commented Mar 26, 2020

I currently depend on https://orgmode.org/manual/TODO-dependencies.html to hide tasks that are not relevant now. It is possible to do a query for filtering out tasks blocked by subtasks but I don't think it is possible to implement ordered tasks because there is no sibling predicate.

Will sibling predicates be implemented?

@akirak
Copy link
Contributor

akirak commented Mar 27, 2020

You can use org-entry-blocked-p to check if an entry is blocked, and its result is available as BLOCKED property. In org-ql, you could use (property "BLOCKED" "") for selecting non-blocked entries. However, dimming would require a further implementation.

@Zetagon
Copy link
Author

Zetagon commented Mar 27, 2020

I personally don't need dimming so it's alright.

@alphapapa
Copy link
Owner

@Zetagon You titled the issue about hiding or dimming, but your question seems to be about sibling predicates.

A sibling predicate is an interesting idea. It could probably be implemented pretty simply. Can you give me some example use cases? That is, pretend that there's a (sibling) predicate that works the same as, e.g. (parent). What would you use it for?

@Zetagon
Copy link
Author

Zetagon commented Mar 27, 2020

The goal was to hide blocked tasks in the same way as described in the link, which is why I titled it the way I did. That way you can have ordered tasks where only the first task in that subtree is shown. It is very handy when describing tasks that are only relevant after the previous ones have been completed.

This query would only show subtask 1. After subtask 1 has been completed subtask 2 would be shown.

(and (todo)
     (not (sibling-above (todo))))
* Project
:PROPERTIES:
:ORDERED:  t
:END:
** Non-task heading
** TODO Subtask 1
** Another non-task heading
** TODO Subtask 2
** TODO Subtask 3

I asked about sibling predicates because that would solve the problem in a very general way.

As for the api, I think there has to be some sense of direction, i.e. siblings above or siblings below current task. I think that it would also be nice to have a predicate for an immediate sibling(i.e. one entry above/under) or a sibling arbitrarily far away(e.g. Subtask 1 and 3 are still siblings). In other words, there would be one predicate that works in the same way as parent, ancestor, child and descendants but for siblings instead.

Btw, org-ql is an amazing package. It is so nice to write queries in it!

@alphapapa
Copy link
Owner

Thanks for the example and thoughts. I agree, that could be very useful. I probably won't work on this soon, but I'll plan to add it in the future, maybe in version 0.6.

@alphapapa alphapapa self-assigned this Apr 7, 2020
@alphapapa alphapapa added this to the 0.6 milestone Apr 7, 2020
@alphapapa alphapapa changed the title Implement hiding or dimming blocked tasks Sibling predicates Apr 7, 2020
This was referenced Feb 11, 2021
@alphapapa
Copy link
Owner

Since it's been so long since the last 0.x release, I'm going to defer this to 0.7 in an effort to reduce the scope of 0.6 and release it sooner.

@alphapapa alphapapa modified the milestones: 0.6, 0.7 Jun 17, 2021
@alphapapa alphapapa modified the milestones: 0.7, 0.8 Mar 10, 2023
@alphapapa alphapapa removed this from the 0.8 milestone Dec 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants