aboutsummaryrefslogtreecommitdiff
path: root/tests/test-chime-environment-regex.el
Commit message (Collapse)AuthorAgeFilesLines
* refactor!: collapse six filter defcustoms into include/exclude alistsCraig Jennings2026-05-051-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* refactor: move 12 internal helpers from chime- to chime-- prefixCraig Jennings2026-04-221-10/+10
| | | | | | | | | | Before MELPA submission, tighten the public API surface. Single-dash chime-foo is the convention for user-facing commands and predicates that external code can bind. Anything that is not meant to be bound externally should use the double-dash chime--foo prefix so byte-compile warnings, docstrings, and MELPA package inspection all point in the same direction. Twelve helpers in chime.el had single-dash names but no user-facing role. They are not mentioned in README, they carry no interactive declaration, and their docstrings do not promise a behavior contract. Rename them: chime-get-minutes-into-day, chime-get-hours-minutes-from-time, chime-set-hours-minutes-for-time, chime-current-time-matches-time-of-day-string, chime-current-time-is-day-wide-time, chime-day-wide-notifications, chime-display-as-day-wide-event, chime-event-has-any-day-wide-timestamp, chime-event-within-advance-notice-window, chime-event-has-any-passed-time, chime-event-is-today, chime-environment-regex. The public API surface is now intentional. It covers chime-mode, chime-validate-configuration, chime-refresh-modeline, chime-done-keywords-predicate, and the chime-debug-* interactive commands in chime-debug.el. Breaking change. No alias shims because there are no downstream users yet.
* Add tests for chime-environment-regexCraig Jennings2026-04-041-0/+62
Verify the regex matches all default variable names, picks up additional user-configured regexes, and handles empty additional list.