aboutsummaryrefslogtreecommitdiff
path: root/chime.el
diff options
context:
space:
mode:
Diffstat (limited to 'chime.el')
-rw-r--r--chime.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/chime.el b/chime.el
index f33a7c1..cd47d19 100644
--- a/chime.el
+++ b/chime.el
@@ -262,7 +262,8 @@ running the async command to check notifications."
:type '(repeat string))
(defcustom chime-predicate-blacklist
- '(chime-done-keywords-predicate)
+ '(chime-done-keywords-predicate
+ chime-declined-events-predicate)
"Never receive notifications for events matching these predicates.
Each function should take an event POM and return non-nil iff that event should
not trigger a notification."
@@ -1280,6 +1281,14 @@ Combines keyword, tag, and custom predicate blacklists."
(goto-char (marker-position marker))
(member (nth 2 (org-heading-components)) org-done-keywords))))
+(defun chime-declined-events-predicate (marker)
+ "Return non-nil when entry at MARKER carries `:STATUS: declined'.
+This is the marker org-gcal writes for events the user has declined in
+their calendar. Only the literal lowercase `declined' value is matched
+because that is what real org-gcal exports use."
+ (let ((status (org-entry-get marker "STATUS")))
+ (and status (string= status "declined"))))
+
(defun chime--apply-whitelist (markers)
"Apply whitelist to MARKERS."
(-if-let (whitelist-predicates (chime--whitelist-predicates))