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

[FEATURE REQUEST] A predicate for "sibling" #287

Closed
Cletip opened this issue Jul 20, 2022 · 4 comments
Closed

[FEATURE REQUEST] A predicate for "sibling" #287

Cletip opened this issue Jul 20, 2022 · 4 comments

Comments

@Cletip
Copy link

Cletip commented Jul 20, 2022

Hello !

I am currently trying to do the following: only get headings that are the next actions to be taken. A concrete example: 

`

  • Project
    ** TODO Task one, the next action that I want to see
    ** TODO Task two, but after the task one, not the next action`

As you can see here, the next action is the task one.

A slightly more complicated example: 

`

  • Project
    ** Not next action
    *** Next action
    *** Not next action
    ** Not next action

  • Project
    ** DONE Task one
    ** TODO next action
    `

I managed to make a function with "org-agenda-skip-function" which allows me to find its famous next action. But how to do it with org-ql ? Is there a possibility to "translate" this function into an org-ql query ?
I'm also thinking of creating a new predicate, "brother-up", which would return true if the heading has a heading of the same level before it

So maybe I could find the next action by taking the following headings:

  • no task in done
  • no descendant
  • no "brother up" not done

I'm a bit lost, because I don't even know if it would work, and if I have thought about everything. I don't know in which direction to go.

Thanks in advance for your answers

@alphapapa
Copy link
Owner

Hello,

This issue tracker is intended for reporting bugs, feature requests, proposing patches, etc, not for general support questions. As well, by asking here, only I can offer answers, and only you can benefit from them. Please ask in a more appropriate, public forum, like https://old.reddit.com/r/emacs+orgmode, #emacs:matrix.org, etc. so that other users can offer help and learn as well.

@Cletip
Copy link
Author

Cletip commented Jul 20, 2022

Thanks you for your answer.

Sorry, it's true that this is not the right place for this kind of question, I got carried away. My basic question is the following and it's in the "feature request" category (I don't know how to label a topic lol sorry) : 

Could there be a predicate for "sibling"?
It could be something like the following:

sibling (&optional query upOrDown)
returns true if the heading has a sibling (before or after the heading).
upOrDown would specify whether it should be before or after (a simple boolean)

I don't know if you see the idea and if it is possible.

@Cletip Cletip changed the title How to implement the "next action" (in GTD method) with org-ql [FEATURE REQUEST] A predicate for "sibling" Jul 21, 2022
@alphapapa
Copy link
Owner

Please see #105.

@Cletip
Copy link
Author

Cletip commented Jul 21, 2022

Thanks you for your answer, I will check this.

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

2 participants