From 74ca4e066bc41ce0a6e94e2d4bc0c838df45a838 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Wed, 22 Apr 2026 09:43:02 -0500 Subject: refactor: move 12 internal helpers from chime- to chime-- prefix 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. --- tests/test-chime-environment-regex.el | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'tests/test-chime-environment-regex.el') diff --git a/tests/test-chime-environment-regex.el b/tests/test-chime-environment-regex.el index 2499ad0..2179198 100644 --- a/tests/test-chime-environment-regex.el +++ b/tests/test-chime-environment-regex.el @@ -1,4 +1,4 @@ -;;; test-chime-environment-regex.el --- Tests for chime-environment-regex -*- lexical-binding: t; -*- +;;; test-chime--environment-regex.el --- Tests for chime--environment-regex -*- lexical-binding: t; -*- ;; Copyright (C) 2026 Craig Jennings @@ -19,7 +19,7 @@ ;;; Commentary: -;; Unit tests for chime-environment-regex function. +;; Unit tests for chime--environment-regex function. ;; This function generates the regex used by async-inject-variables to ;; copy chime's config into the async subprocess. @@ -29,9 +29,9 @@ ;;; Normal Cases -(ert-deftest test-chime-environment-regex-matches-default-variables () +(ert-deftest test-chime--environment-regex-matches-default-variables () "The generated regex should match all default chime variable names." - (let ((regex (chime-environment-regex)) + (let ((regex (chime--environment-regex)) (chime-additional-environment-regexes nil)) (dolist (var '("org-agenda-files" "load-path" "org-todo-keywords" "chime-alert-intervals" "chime-keyword-whitelist" @@ -40,10 +40,10 @@ "chime-predicate-blacklist")) (should (string-match-p regex var))))) -(ert-deftest test-chime-environment-regex-includes-additional-regexes () +(ert-deftest test-chime--environment-regex-includes-additional-regexes () "With additional regexes configured, the result should match those too." (let ((chime-additional-environment-regexes '("my-custom-var"))) - (let ((regex (chime-environment-regex))) + (let ((regex (chime--environment-regex))) ;; Should still match defaults (should (string-match-p regex "org-agenda-files")) ;; Should also match the custom variable @@ -51,12 +51,12 @@ ;;; Boundary Cases -(ert-deftest test-chime-environment-regex-empty-additional-list () +(ert-deftest test-chime--environment-regex-empty-additional-list () "Empty additional regexes list should produce a valid regex matching defaults." (let ((chime-additional-environment-regexes nil)) - (let ((regex (chime-environment-regex))) + (let ((regex (chime--environment-regex))) (should (stringp regex)) (should (string-match-p regex "chime-alert-intervals"))))) -(provide 'test-chime-environment-regex) -;;; test-chime-environment-regex.el ends here +(provide 'test-chime--environment-regex) +;;; test-chime--environment-regex.el ends here -- cgit v1.2.3