From e4a254453dedacafcca883a3b20302762c872280 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 5 May 2026 05:15:59 -0500 Subject: fix: skip declined events in tooltip, modeline, and notifications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit org-gcal writes `:STATUS: declined' on calendar entries the user has declined, and chime was happily showing them in the tooltip, modeline, and notification stream — which defeats the whole point of declining a meeting. I added `chime-declined-events-predicate', mirroring the shape of `chime-done-keywords-predicate', and put it on the default `chime-predicate-blacklist'. The match is on the literal lowercase value because that's what real org-gcal exports use; uppercase or other values pass through. Users who want declined events back can pop the predicate off the blacklist. Tests cover all four STATUS values seen in real org-gcal data (accepted, declined, needs-action, tentative), plus the no-property, empty-property, todo-keyword-still-attached, gibberish-value, case-sensitivity, and default-blacklist-membership cases. --- chime.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'chime.el') 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)) -- cgit v1.2.3