alphapapa / org-super-agenda

Supercharge your Org daily/weekly agenda by grouping items
GNU General Public License v3.0
1.35k stars 107 forks source link

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

Open max6166 opened 1 year ago

max6166 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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