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

Add explicit :or operator for use within :and operator? #241

Open
max6166 opened this issue Feb 14, 2023 · 3 comments
Open

Add explicit :or operator for use within :and operator? #241

max6166 opened this issue Feb 14, 2023 · 3 comments

Comments

@max6166
Copy link

max6166 commented Feb 14, 2023

I have a number of very intricate org-super-agenda views. I have many instances where the code could be greatly simplified if there were some way to specify a boolean OR within an :and selector. For example:

(:name "Stuff to do"
    :and (
         :tag "mustdo"
         :not (:todo "ONHOLD")
         :ProjectID "ClientX"
         :tag "email"
    )
    :and (
         :todo "NOW"
         :not (:todo "ONHOLD")
         :ProjectID "ClientX"
         :tag "email"
    )
    :and (
         :priority "A"
         :not (:todo "ONHOLD")
         :ProjectID "ClientX"
         :tag "email"
    )    
)

Only the first item differs in each of the above :and selectors. If there were some way to specify OR within the :and selector, the above could be simplified to:

(:name "Stuff to do"
    :and (
         :or (:tag "mustdo" :todo "NOW" :priority "A")
         :not (:todo "ONHOLD")
         :ProjectID "ClientX"
         :tag "email"
    )    
)

The above is much easier to maintain and would greatly reduce the length of my code, at least. Is this enhancement at all feasible?

@alphapapa
Copy link
Owner

Hello,

It's software, so anything is possible. :) That would probably be doable without too much difficulty, but the code that implements the pseudo-language is pretty ugly, so it might get a little messy. I'm working on a next-generation based on taxy that implements a more natural, Lispy language for defining groups, so I'm not likely to spend much time "shoehorning" changes like this into org-super-agenda anytime soon. I'm willing to help review patches, though...

@max6166
Copy link
Author

max6166 commented Feb 26, 2023

I'm working on a next-generation based on taxy

Cool! I don't know how I missed your taxy project. On behalf of all of us, thank you for all your incredible packages.

Would you consider one day posting a short video demonstrating your own workflow using your packages? I think that information would be incredibly useful to many of us, so we can see how the packages complement each other.

@alphapapa
Copy link
Owner

Thanks for the kind words.

I get asked about this sort of thing from time to time. I don't have a single workflow, and the ones I have are always works-in-progress, especially as I develop these tools further. Having said that, there are some features I would like to demonstrate to help users understand what's possible with them, e.g. making links and bookmarks to org-ql views, which may even include org-super-agenda grouping. It's just a matter of finding the time to do it, and my Emacs-related to-do lists are already long. :)

Anyway, if you have more specific questions about that sort of thing, feel free to ask, but preferably on Reddit r/emacs or r/orgmode. Feel free to ping me on Matrix to let me know if you post something like that: @alphapapa:matrix.org

@alphapapa alphapapa added this to the Future milestone Sep 24, 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

2 participants