summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2026-03-16 22:48:12 -0700
committerJohn Wiegley <johnw@newartisans.com>2026-03-16 22:48:12 -0700
commit9cc1e804395342bc028800d87c5318ccd97d6071 (patch)
tree71abf904e2f3915ddab50ade15137e8d0b80c791
parent475177f380c48ca36bc1f3dcdc61267448286897 (diff)
Load cl-lib in format checks for consistent indentation
The format check was failing because cl-case and cl-letf indentation depends on cl-lib being loaded (indent spec 1 vs default). Locally, .dir-locals.el triggers bug-reference-prog-mode which transitively loads cl-lib, but the Nix CI copies files with `*.el` glob which doesn't match .dir-locals.el, so cl-lib was never loaded. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
-rw-r--r--Makefile4
-rw-r--r--flake.nix1
-rw-r--r--lefthook.yml1
3 files changed, 4 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 061075f..9c807ab 100644
--- a/Makefile
+++ b/Makefile
@@ -83,14 +83,14 @@ uninstall:
format:
@for f in $(SRC_EL); do \
$(EMACS) $(LOADPATH) $$f --eval \
- '(progn (setq-default indent-tabs-mode nil) (indent-region (point-min) (point-max)) (save-buffer))'; \
+ '(progn (require (quote cl-lib)) (setq-default indent-tabs-mode nil) (indent-region (point-min) (point-max)) (save-buffer))'; \
done
# Check formatting without modifying files
format-check:
@for f in $(SRC_EL); do \
$(EMACS) $(LOADPATH) $$f --eval \
- '(progn (setq-default indent-tabs-mode nil) (let ((original (buffer-string))) (indent-region (point-min) (point-max)) (unless (string= original (buffer-string)) (message "Formatting differs: %s" buffer-file-name) (kill-emacs 1))))'; \
+ '(progn (require (quote cl-lib)) (setq-default indent-tabs-mode nil) (let ((original (buffer-string))) (indent-region (point-min) (point-max)) (unless (string= original (buffer-string)) (message "Formatting differs: %s" buffer-file-name) (kill-emacs 1))))'; \
done
# Byte-compile with warnings as errors
diff --git a/flake.nix b/flake.nix
index e35f9f0..f4d73bb 100644
--- a/flake.nix
+++ b/flake.nix
@@ -76,6 +76,7 @@
for f in ${sourceFiles}; do
HOME=$TMPDIR emacs -Q --batch "$f" --eval '
(progn
+ (require (quote cl-lib))
(setq-default indent-tabs-mode nil)
(let ((original (buffer-string)))
(indent-region (point-min) (point-max))
diff --git a/lefthook.yml b/lefthook.yml
index 9808458..f06c263 100644
--- a/lefthook.yml
+++ b/lefthook.yml
@@ -8,6 +8,7 @@ pre-commit:
for f in async.el async-bytecomp.el async-package.el dired-async.el smtpmail-async.el; do
emacs -Q --batch "$f" --eval '
(progn
+ (require (quote cl-lib))
(setq-default indent-tabs-mode nil)
(let ((original (buffer-string)))
(indent-region (point-min) (point-max))