diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-05 12:39:55 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-05 12:39:55 -0500 |
| commit | 3019a33d391912120a78cad43a49eb34c4a1d044 (patch) | |
| tree | 4941d154529ce988bbdeb5e1929fa6cdea35f94a /tests/test-chime-declined-events-predicate.el | |
| parent | 26fabb22edfea51e8a686c179ab91d00a2ff0bc3 (diff) | |
| download | chime-3019a33d391912120a78cad43a49eb34c4a1d044.tar.gz chime-3019a33d391912120a78cad43a49eb34c4a1d044.zip | |
refactor!: collapse six filter defcustoms into include/exclude alists
Six per-axis filter variables (keyword/tags/predicate × whitelist/blacklist)
were carrying parallel structure for what's really one decision: include
events that look like X, exclude events that look like Y. I merged them
into two alists, `chime-include-filters' and `chime-exclude-filters', each
keyed by axis (`keywords', `tags', `predicates').
Default for `chime-exclude-filters' keeps the same out-of-the-box
behavior — done items and declined Google Calendar invites stay
filtered:
((predicates . (chime-done-keywords-predicate
chime-declined-events-predicate)))
Implementation: one shared `chime--filter-predicates' helper that walks
the alist and emits a marker-taking predicate per non-empty axis. The
public callers — now `chime--apply-include-filters' and
`chime--apply-exclude-filters' — wrap that helper with
`-orfn'-then-`-filter' and `-orfn'-then-`-remove' respectively. The
async-environment regex injection list shrank from six names to two,
and the debug config dump in chime-debug.el follows.
The terminology shift (whitelist/blacklist → include/exclude) drops
loaded language for descriptive intent. The internal helpers and the
public function names all moved together.
Tests: 700-ish lines across five test files (test-chime-apply-whitelist,
test-chime-apply-blacklist, test-chime-whitelist-blacklist-conflicts,
test-chime-environment-regex, test-chime-declined-events-predicate)
were rewritten to bind the new alists. The dedup-conflict tests still
exercise the same precedence rule (exclude wins on overlap). README's
filtering section was rewritten end-to-end with new examples.
Migration:
(setq chime-keyword-whitelist '("TODO"))
;; ->
(setq chime-include-filters '((keywords . ("TODO"))))
(setq chime-predicate-blacklist '(my-pred))
;; ->
(setq chime-exclude-filters '((predicates . (my-pred))))
This brings the consolidation pass to 37 -> 29 defcustoms, the target
from .ai/settings-consolidation.org.
Diffstat (limited to 'tests/test-chime-declined-events-predicate.el')
| -rw-r--r-- | tests/test-chime-declined-events-predicate.el | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/test-chime-declined-events-predicate.el b/tests/test-chime-declined-events-predicate.el index ca25faa..5f8c4b8 100644 --- a/tests/test-chime-declined-events-predicate.el +++ b/tests/test-chime-declined-events-predicate.el @@ -144,13 +144,15 @@ than treating it as declined." (let ((marker (point-marker))) (should-not (chime-declined-events-predicate marker))))) -;;;; Integration with the default predicate-blacklist +;;;; Integration with the default exclude filters -(ert-deftest test-chime-declined-events-predicate-on-default-blacklist () - "Normal: the predicate ships in the default `chime-predicate-blacklist' -so out-of-the-box installs hide declined events without extra config." +(ert-deftest test-chime-declined-events-predicate-on-default-exclude-filters () + "Normal: the predicate ships in the default `chime-exclude-filters' +under the predicates key, so out-of-the-box installs hide declined +events without extra config." (should (memq 'chime-declined-events-predicate - (default-value 'chime-predicate-blacklist)))) + (alist-get 'predicates + (default-value 'chime-exclude-filters))))) (provide 'test-chime-declined-events-predicate) ;;; test-chime-declined-events-predicate.el ends here |
