From 6045ba72c893a5718639217e4c25b948e7505cee Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 11 May 2026 07:20:50 -0500 Subject: chore(hooks): eval load-prefer-newer before byte-compile and test runs The validate-el.sh hook loaded stale `.elc` files when the matching `.el` was newer (e.g. after a sed-driven rename where the byte-compile hook never fires). `make test` already sets this. The hook didn't, so I added `(setq load-prefer-newer t)` to all three emacs invocations: the parens check, the byte-compile, and the test run. --- .claude/hooks/validate-el.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to '.claude') diff --git a/.claude/hooks/validate-el.sh b/.claude/hooks/validate-el.sh index 803badf8..dfb7ac7e 100755 --- a/.claude/hooks/validate-el.sh +++ b/.claude/hooks/validate-el.sh @@ -41,13 +41,16 @@ MAX_AUTO_TEST_FILES=20 # skip if more matches than this (large test suites) case "$f" in */init.el|*/early-init.el) # Byte-compile here would load the full package graph. Parens only. - if ! output="$(emacs --batch --no-site-file --no-site-lisp "$f" \ + if ! output="$(emacs --batch --no-site-file --no-site-lisp \ + --eval '(setq load-prefer-newer t)' \ + "$f" \ --eval '(check-parens)' 2>&1)"; then fail_json "PAREN CHECK FAILED" "$f" "$output" fi ;; *.el) if ! output="$(emacs --batch --no-site-file --no-site-lisp \ + --eval '(setq load-prefer-newer t)' \ -L "$PROJECT_ROOT" \ -L "$PROJECT_ROOT/modules" \ -L "$PROJECT_ROOT/tests" \ @@ -89,6 +92,7 @@ if [ "$count" -ge 1 ] && [ "$count" -le "$MAX_AUTO_TEST_FILES" ]; then load_args=() for t in "${tests[@]}"; do load_args+=("-l" "$t"); done if ! output="$(emacs --batch --no-site-file --no-site-lisp \ + --eval '(setq load-prefer-newer t)' \ -L "$PROJECT_ROOT" \ -L "$PROJECT_ROOT/modules" \ -L "$PROJECT_ROOT/tests" \ -- cgit v1.2.3