-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathMakefile
89 lines (74 loc) · 3.2 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
help:
@echo 'Usage: make [target]'
@echo
@echo 'Setup:'
@echo ' setup-bare Set up Emfy in fake home without installing packages.'
@echo ' setup-full Set up Emfy in fake home along with installed packages.'
@echo
@echo 'Checks:'
@echo ' loc Count non-blank, non-comment, and non-docstring lines.'
@echo ' lint Lint with Flycheck.'
@echo ' benchmark Print benchmarking info about emacs-init-time.'
@echo ' run Run Emacs with whatever state fake home directory is in.'
@echo
@echo 'Demos:'
@echo ' demo Set up full Emfy and run Emacs for demo screenshot.'
@echo ' wombat1 Set up bare Emfy and demo Wombat defaults.'
@echo ' wombat2 Set up bare Emfy and demo custom colours.'
@echo ' lorem1 Set up bare Emfy and demo trailing spaces.'
@echo ' lorem2 Set up bare Emfy and demo trailing newlines.'
@echo ' lorem3 Set up bare Emfy and demo missing newline.'
@echo ' lorem4 Set up bare Emfy and demo present newline.'
@echo
@echo 'Checklist:'
@echo ' make loc'
@echo ' make setup-full'
@echo ' make lint'
@echo ' make benchmark'
@echo ' make demo'
@echo ' make wombat1'
@echo ' make wombat2'
@echo ' make lorem1'
@echo ' # etc.'
setup-bare:
rm -rf .emacs.d/
mkdir .emacs.d/
cp ../init.el .emacs.d/
setup-full: setup-bare
HOME=. emacs --eval '(progn (install-packages) (kill-emacs))'
loc:
f() { grep -vE '^$$|^;|^ *".*"$$' ../init.el; }; f; f | wc -l
_lint:
emacs -l lint.el 2>&1
lint:
make _lint 2>&1 | \
grep -vE 'with-eval-after-load|prefix "init"|key sequence is reserved|to free variable'
benchmark:
HOME=. emacs --eval "(progn (princ (emacs-init-time) 'external-debugging-output) (kill-emacs))"; echo
run:
HOME=. emacs
demo:
HOME=. emacs --eval '(progn (set-frame-size (selected-frame) 140 32) (find-file "example.md") (split-window-right) (find-file "example.el") (goto-char (1- (point-max))) (message ""))'
wombat1: setup-bare
sed -n '1,/load-theme/p' ../init.el > .emacs.d/init.el
HOME=. emacs --eval '(progn (set-frame-size (selected-frame) 80 12) (find-file "foo.el") (message ""))'
wombat2: setup-bare
sed -n '1,/Enable line/p' ../init.el > .emacs.d/init.el
HOME=. emacs --eval '(progn (set-frame-size (selected-frame) 80 12) (find-file "foo.el") (message ""))'
lorem1: setup-bare
sed -n '1,/Show stray lines/p' ../init.el > .emacs.d/init.el
HOME=. emacs --eval '(progn (set-frame-size (selected-frame) 80 12) (find-file "lorem1.txt") (message ""))'
lorem2: setup-bare
sed -n '1,/indicate-empty-lines/p' ../init.el > .emacs.d/init.el
HOME=. emacs --eval '(progn (set-frame-size (selected-frame) 80 12) (find-file "lorem2.txt") (message ""))'
lorem3: setup-bare
sed -n '1,/indicate-buffer-boundaries/p' ../init.el > .emacs.d/init.el
printf '%s' "$$(cat lorem2.txt)" > lorem3.txt
HOME=. emacs --eval '(progn (set-frame-size (selected-frame) 80 12) (find-file "lorem3.txt") (message ""))'
# Indicate buffer boundaries (terminating newline present)
lorem4: setup-bare
sed -n '1,/indicate-buffer-boundaries/p' ../init.el > .emacs.d/init.el
printf '%s\n' "$$(cat lorem2.txt)" > lorem4.txt
HOME=. emacs --eval '(progn (set-frame-size (selected-frame) 80 12) (find-file "lorem4.txt") (message ""))'
reset:
rm -rf .emacs.d/ .tmp/