aboutsummaryrefslogtreecommitdiff
path: root/languages/elisp/claude/hooks
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-13 23:39:07 -0500
committerCraig Jennings <c@cjennings.net>2026-07-13 23:39:07 -0500
commit7e61dc0fa44e9b782f2a551e3813bb11eed20af7 (patch)
treed75e7e1d954ccfb54735cd21ac5707629dbd7ca5 /languages/elisp/claude/hooks
parent3eed2e185773451574c51a4bad591a2753dac662 (diff)
downloadrulesets-7e61dc0fa44e9b782f2a551e3813bb11eed20af7.tar.gz
rulesets-7e61dc0fa44e9b782f2a551e3813bb11eed20af7.zip
fix(elisp): validate-el.sh prefers source over stale bytecode
Both emacs invocations in the hook now set load-prefer-newer, matching the project-side Makefile and early-init guards. Without it, the PostToolUse hook after a pull that changed a module ran tests against the module's stale .elc and every test failed void-function on the newly-added symbols. From .emacs.d's 2026-07-13 handoff, repro-verified there; inbox/2026-07-13-1712-from-.emacs.d.
Diffstat (limited to 'languages/elisp/claude/hooks')
-rwxr-xr-xlanguages/elisp/claude/hooks/validate-el.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/languages/elisp/claude/hooks/validate-el.sh b/languages/elisp/claude/hooks/validate-el.sh
index 8e46457..d028789 100755
--- a/languages/elisp/claude/hooks/validate-el.sh
+++ b/languages/elisp/claude/hooks/validate-el.sh
@@ -55,6 +55,7 @@ case "$f" in
# under a tests/ subdir) so cross-project edits compile against their
# own modules, not just this project's.
if ! output="$(emacs --batch --no-site-file --no-site-lisp \
+ --eval '(setq load-prefer-newer t)' \
-L "$(dirname "$f")" \
-L "$(dirname "$f")/.." \
-L "$PROJECT_ROOT" \
@@ -99,6 +100,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" \