From 9e4c58029785c418ad6dbdbff3988a8582388c34 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 13 Jun 2026 13:08:25 -0500 Subject: fix(elisp): byte-compile cross-project .el edits against their own modules The validate-el hook only put the current project's roots on the load path, so editing an .el file from another project failed Phase 1 byte-compile on free-variable warnings: the file's own sibling modules weren't reachable. I added the edited file's directory and its parent to the load path. For in-project edits both are redundant (already covered by PROJECT_ROOT and its modules dir). They only do work when the file sits outside the current project root. I left Phase 2's test runner alone. It discovers tests by stem under PROJECT_ROOT/tests, so a cross-project file's tests aren't found regardless of load path. --- languages/elisp/claude/hooks/validate-el.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/languages/elisp/claude/hooks/validate-el.sh b/languages/elisp/claude/hooks/validate-el.sh index d6999ac..2529fcc 100755 --- a/languages/elisp/claude/hooks/validate-el.sh +++ b/languages/elisp/claude/hooks/validate-el.sh @@ -51,7 +51,12 @@ case "$f" in fi ;; *.el) + # -L the file's own directory (and a sibling project root for files + # 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 \ + -L "$(dirname "$f")" \ + -L "$(dirname "$f")/.." \ -L "$PROJECT_ROOT" \ -L "$PROJECT_ROOT/modules" \ -L "$PROJECT_ROOT/tests" \ -- cgit v1.2.3