alphapapa / alphapapa/org-super-agenda
:discard will discard all lines in agenda that render exactly the same if any *one* of the corresponding headings match
- Lingua principale
- Emacs Lisp
- Stelle
- 1.5k
- Fork
- 107
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
I have an Org-mode file filled with entries from [org-gcal](https://github.com/kidd/org-gcal.el). 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: foo@group.calendar.google.com
:entry-id: bar/foo@group.calendar.google.com
: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: foo@group.calendar.google.com
:entry-id: bar_20220726T210000Z/foo@group.calendar.google.com
: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.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.