aboutsummaryrefslogtreecommitdiff
path: root/README.org
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-05 12:20:29 -0500
committerCraig Jennings <c@cjennings.net>2026-05-05 12:20:29 -0500
commit68877f04c2ceb569ae5cd74b8303b84b36ced1c5 (patch)
tree6ca0e67785c759bae0687728798e8c7c4b164841 /README.org
parent44831f8587947212f2df8c38e81a3c1b6fa588fc (diff)
downloadchime-68877f04c2ceb569ae5cd74b8303b84b36ced1c5.tar.gz
chime-68877f04c2ceb569ae5cd74b8303b84b36ced1c5.zip
fix: validate numeric defcustoms at customize-time
Six numeric settings are declared as integers but were read straight into arithmetic and timer math. A bad value (string, negative number, nil where nil isn't supported) used to slip past the defcustom and surface as a timer error or `arith-error' deep in a callback, instead of as a configuration problem at the moment the user set it. I added `chime--validate-integer-setting' as a small shared helper and wired a `:set' on each of the affected defcustoms: - `chime-modeline-lookahead-minutes' — integer >= 0 (0 disables) - `chime-tooltip-lookahead-hours' — integer >= 1 - `chime-modeline-tooltip-max-events' — integer >= 1 or nil (show all) - `chime-day-wide-advance-notice' — integer >= 0 or nil (same-day only) - `chime-max-consecutive-failures' — integer >= 0 (0 disables warnings) - `chime-validation-max-retries' — integer >= 0 (0 = fail immediately) The constraints follow each docstring's stated intent. The helper signals `user-error', so `customize-set-variable' surfaces it as a config problem rather than a generic error trace. Tests: 22 cases in `tests/test-chime-numeric-defcustom-setters.el' — five direct on the helper plus each defcustom's accept/reject paths through `customize-set-variable'.
Diffstat (limited to 'README.org')
0 files changed, 0 insertions, 0 deletions