From 0b65f607102c12260c7cca5df3d8586c2b1a24bd Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 5 May 2026 12:24:56 -0500 Subject: refactor!: demote chime-validation-max-retries to private defvar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is an internal startup-timing parameter, not a knob real users have reason to tune through `M-x customize'. I demoted it from defcustom to defvar and renamed it to `chime--validation-max-retries' to make the private status explicit. Anyone who was overriding it can keep doing so with `setq' (the variable still exists, just under the new name). The three customize-time validation tests went away with the defcustom — nothing left to validate at customize-time once it stops being a customize-target. The setter helper still applies to the other five numeric defcustoms. Test files that referenced the variable (`test-chime-validation-retry.el', `test-integration-chime-mode.el') were renamed mechanically along with the source. Breaking change: `(setq chime-validation-max-retries N)' becomes `(setq chime--validation-max-retries N)' if you actually had it. Most users won't have touched it. --- tests/test-chime-validation-retry.el | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'tests/test-chime-validation-retry.el') diff --git a/tests/test-chime-validation-retry.el b/tests/test-chime-validation-retry.el index b4e886c..70188bc 100644 --- a/tests/test-chime-validation-retry.el +++ b/tests/test-chime-validation-retry.el @@ -12,7 +12,7 @@ ;; ;; Components tested: ;; - chime--validation-retry-count tracking -;; - chime-validation-max-retries configuration +;; - chime--validation-max-retries configuration ;; - chime-check validation retry logic ;; - chime--stop retry counter reset ;; - Message display behavior (waiting vs error) @@ -24,7 +24,7 @@ ;;; Setup and Teardown (defvar test-chime-validation-retry--original-max-retries nil - "Original value of chime-validation-max-retries for restoration.") + "Original value of chime--validation-max-retries for restoration.") (defvar test-chime-validation-retry--original-agenda-files nil "Original value of org-agenda-files for restoration.") @@ -32,7 +32,7 @@ (defun test-chime-validation-retry-setup () "Set up test environment before each test." ;; Save original values - (setq test-chime-validation-retry--original-max-retries chime-validation-max-retries) + (setq test-chime-validation-retry--original-max-retries chime--validation-max-retries) (setq test-chime-validation-retry--original-agenda-files org-agenda-files) ;; Reset validation state @@ -40,12 +40,12 @@ (setq chime--validation-retry-count 0) ;; Set predictable defaults - (setq chime-validation-max-retries 3)) + (setq chime--validation-max-retries 3)) (defun test-chime-validation-retry-teardown () "Clean up test environment after each test." ;; Restore original values - (setq chime-validation-max-retries test-chime-validation-retry--original-max-retries) + (setq chime--validation-max-retries test-chime-validation-retry--original-max-retries) (setq org-agenda-files test-chime-validation-retry--original-agenda-files) ;; Reset validation state @@ -179,14 +179,14 @@ process events normally." (ert-deftest test-chime-validation-retry-boundary-max-retries-zero () "Test max-retries=0 shows error immediately without retrying. -When chime-validation-max-retries is set to 0, validation failures +When chime--validation-max-retries is set to 0, validation failures should immediately show the full error message without any retry attempts." (test-chime-validation-retry-setup) (unwind-protect (progn ;; Set max retries to 0 - (setq chime-validation-max-retries 0) + (setq chime--validation-max-retries 0) ;; Empty org-agenda-files (setq org-agenda-files nil) @@ -222,7 +222,7 @@ show full error." (unwind-protect (progn ;; Set max retries to 1 - (setq chime-validation-max-retries 1) + (setq chime--validation-max-retries 1) ;; Empty org-agenda-files (setq org-agenda-files nil) @@ -261,7 +261,7 @@ The (retry_count + 1)th attempt should show the error message." (unwind-protect (progn ;; Default max retries = 3 - (setq chime-validation-max-retries 3) + (setq chime--validation-max-retries 3) (setq org-agenda-files nil) (cl-letf (((symbol-function 'chime--fetch-and-process) @@ -346,7 +346,7 @@ displayed with all error details in the *Messages* buffer." (test-chime-validation-retry-setup) (unwind-protect (progn - (setq chime-validation-max-retries 2) + (setq chime--validation-max-retries 2) (setq org-agenda-files nil) (cl-letf (((symbol-function 'chime--fetch-and-process) @@ -380,7 +380,7 @@ validation should never be marked as done." (test-chime-validation-retry-setup) (unwind-protect (progn - (setq chime-validation-max-retries 3) + (setq chime--validation-max-retries 3) (setq org-agenda-files nil) (cl-letf (((symbol-function 'chime--fetch-and-process) @@ -406,7 +406,7 @@ many retry attempts, ensuring no integer overflow issues." (test-chime-validation-retry-setup) (unwind-protect (progn - (setq chime-validation-max-retries 1000) + (setq chime--validation-max-retries 1000) (setq org-agenda-files nil) (cl-letf (((symbol-function 'chime--fetch-and-process) -- cgit v1.2.3