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

:discard will discard all lines in agenda that render exactly the same if any *one* of the corresponding headings match #227

Open
telotortium opened this issue Jul 26, 2022 · 1 comment
Assignees
Milestone

Comments

@telotortium
Copy link

I have an Org-mode file filled with entries from org-gcal. One of the features it has is the ability to retrieve the parent of a recurring event and put the individual instances of the recurring event as children under this parent event - note that the parent event has the "recurrence" property while the children do not:

* MEETING Deloitte BPO Feedback - AML team
:PROPERTIES:
:recurrence: [RRULE:FREQ=MONTHLY;UNTIL=20221029T035959Z;INTERVAL=1;BYDAY=4TU]
:calendar-id: [email protected]
:entry-id: bar/[email protected]
:Effort:   0:30
:org-gcal-managed: gcal
:END:
:org-gcal:
<2022-07-26 Tue 14:00-14:30>
:END:

** MEETING Deloitte BPO Feedback - AML team
:PROPERTIES:
:calendar-id: [email protected]
:entry-id: bar_20220726T210000Z/[email protected]
:Effort:   0:30
:END:
:org-gcal:
<2022-07-26 Tue 14:00-14:30>
:END:

I wanted to ensure that I only see the child events, not the parent events, so I used the following org-super-agenda-groups:

  (setq! org-super-agenda-groups
         ;; Each group has an implicit boolean OR operator between its selectors.
         '(
           ;; Discard top-level recurring events fetched by org-gcal unless I’ve
           ;; done something to indicate I’m using them.
           (:discard
            (:tag "ARCHIVE"
             :and
             (:todo "CANCELLED")
             :and
             (
               ;; Not using ~:property "recurrence"~ because the properties
               ;; there are inherited, which means it will match all the
               ;; children too.
               :regexp "^[ \t]*:recurrence:"
               :not (:log t)
               :not (:habit t))
             :and
             (:tag "inbox")))
           (:name "Today"  ; Optionally specify section name
            :time-grid t  ; Items that appear on the time grid
            :todo "TODAY")  ; Items that have this TODO keyword
           (:name "Important (max in-flight should be 3)" :priority "A")
           ;; Set order of multiple groups at once
           (:todo "WAITING")
           (:name "Drill" :tag "drill")
           (:name "Today" :scheduled today :deadline today)
           (:name "Overdue"
            :and
            (:scheduled past :deadline past))
           (:name "Habits" :habit t)
           (:priority<= "B"
            ;; Show this section after "Today" and "Important", because
            ;; their order is unspecified, defaulting to 0. Sections
            ;; are displayed lowest-number-first.
            :order 1)))

However, this ends up deleting both lines for "Deloitte BPO Feedback - AML team" - the parent and the child.

I can work around this by adding the tag :gcal: to the parent heading (this is a tag I already have in FILETAGS, so I don't mind adding it here). This seems to work by slightly reformatting the agenda lines so that they're not the exact same - notice the tags at the end of the line:

  Lark:       14:00-14:30 MEETING Deloitte BPO Feedback - AML team                     :TikTok::gcal:
  Lark:       14:00-14:30 MEETING Deloitte BPO Feedback - AML team                     :TikTok:gcal::

Expected behavior: remove only the parent heading, not the child heading, from the agenda, even if the heading lines are exactly the same.

@alphapapa
Copy link
Owner

Hm, this seems strange. Would you simplify the groups definition to the minimum necessary to reproduce the problem?

Also, please see org-super-agenda-properties-inherit; I wonder if disabling that would let you use the property selector.

@alphapapa alphapapa self-assigned this Sep 24, 2023
@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