aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 14 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index aa8bb3c..1577aa8 100644
--- a/Makefile
+++ b/Makefile
@@ -37,7 +37,20 @@ bin/%.o: %.scm | bin
csc -c -J -unit downstroke.$* $*.scm -o bin/$*.o -I bin
@if [ -f downstroke.$*.import.scm ]; then mv downstroke.$*.import.scm bin/; fi
-.PHONY: clean test engine demos filter
+.PHONY: clean test engine demos filter format
+
+# Reformat every tracked .scm file with Emacs `indent-region` under the user's
+# real init (so geiser-chicken / scheme-mode rules apply consistently).
+# Override EMACS_INIT_DIR / EMACS_SUBSTRATE_DIR if your config lives elsewhere.
+EMACS_INIT_DIR ?= $(HOME)/.emacs-perso
+EMACS_SUBSTRATE_DIR ?= $(EMACS_INIT_DIR)/emacs-substrate
+format:
+ @emacs --batch \
+ --init-directory=$(EMACS_INIT_DIR) \
+ --eval "(add-to-list 'load-path \"$(EMACS_SUBSTRATE_DIR)/\")" \
+ -l $(EMACS_INIT_DIR)/init.el \
+ -l format.el \
+ --eval "(downstroke-format-tracked-scm-files)"
clean:
rm -rf bin downstroke/