alphapapa / org-super-agenda

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

Excluding diary entries #200

Closed promisedlandt closed 3 years ago

promisedlandt commented 3 years ago

Hello,

I have a simple TODO in my main org file to send an email to my accountant on the first day of every month. It uses diary-date and looks like this:

*** TODO Send accounting mail
    <%%(diary-date t 1 t)>

(I have omitted the body).

The daily portion of my super agenda shows it just fine, but it also shows up under Todos, despite my trying to discard it with (:discard (:scheduled t). I guess that makes sense, as it does not have a SCHEDULED: property, but do you have any other idea how I can filter it out?

(setq org-agenda-custom-commands
      '(
        ("a" "Overview"
         (
          (agenda ""
                  ((org-agenda-overriding-header "Life")
                   (org-agenda-span 'day)
                   (org-super-agenda-groups
                     '(
                       (:name "Daily"
                              :anything) ; <--------- shows up fine here
                       )
                     )))
          (todo "INPROGRESS"
                ((org-agenda-overriding-header "In Progress")
                )
                )
          (todo "TODO"
                ((org-agenda-overriding-header "Quests")
                 (org-super-agenda-groups
                   '(
                     (:discard (:scheduled t)) ; <---------- Does not get discarded here
                     (:name "Immediate"
                            :priority "A"
                            )
                     (:name "High priority"
                            :priority "B"
                            :order 2
                            )
                     (:name "Low priority"
                            :priority "D"
                            :order 4
                            )
                     (:name "Eventually"
                            :priority "E"
                            :order 5
                            )
                     (:name "Normal priority" ; <---------- Gets displayed here, sadness
                            :not (:priority ("A" "B" "D" "E"))
                            :order 3
                            )
                     )
                   )))
          )
         )
        )
      )
alphapapa commented 3 years ago

You can use :discard with any of these selectors: https://github.com/alphapapa/org-super-agenda#normal-selectors So just pick one that could match that entry and use it.

promisedlandt commented 3 years ago

Right, so :scheduled matcher not working is expected? I guess I can tag all diary-date entries and discard that tag everywhere I discard scheduled, thanks.

alphapapa commented 3 years ago

Right, so :scheduled matcher not working is expected?

Yes, since the entry is not scheduled, it shouldn't match.

I guess I can tag all diary-date entries and discard that tag everywhere I discard scheduled, thanks.

There are probably various ways you could do it. For one, try something like :time-grid t; that will probably work. If not, you could use the :regexp matcher to match against <%%. Tagging is another option, but probably not necessary.

promisedlandt commented 3 years ago

Thanks for the quick help, but both those options match too much - :time-grid removes everything, :regexp also matches entries with text like "TODO plan something with either <%%... or <%..`. I'm completely fine tagging the entries, it's only about a dozen.

alphapapa commented 3 years ago

:regexp also matches entries with text like "TODO plan something with either <%%... or <%..`.

What's the difference between entries like that and the one you want to remove? They both have diary sexps outside of an Org planning property line. AFAIK the Org agenda treats an active timestamp outside of a planning line as that entry's appointment date. So maybe tagging is the best solution for you, but see also this FAQ entry: https://github.com/alphapapa/org-super-agenda#why-are-some-items-not-displayed-even-though-i-used-group-selectors-for-them

promisedlandt commented 3 years ago

What's the difference between entries like that and the one you want to remove? They both have diary sexps outside of an Org planning property line

It's very possible there is no difference and I have not seen them because I have not reached their particular day yet. Good to know. Either way, I prefer having those "false positives" since they are easy to identify. I will not write my todos like that anymore, that was a very good hint :smile: :

Thanks for the FAQ entry, I will go from multiple org agenda groups with org-super-agenda subgroups to just org-super-agenda groups.

alphapapa commented 3 years ago

As you can see, Org agenda is infinitely powerful, and with infinite power comes unlimited confusion. :) That's one of the reasons I wrote org-ql, to try to make an alternative that's easier to understand.