aboutsummaryrefslogtreecommitdiffstats
path: root/emacs
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-06-25 18:09:21 +0200
committerMattias Andrée <maandree@kth.se>2021-06-25 18:09:21 +0200
commit6022e47b19161375fd2159299def5c76c915956d (patch)
treea863536cd6bf4b5c607ea00993e5666602ef8fd5 /emacs
parentAdd instructions to README (diff)
downloaddotfiles-6022e47b19161375fd2159299def5c76c915956d.tar.gz
dotfiles-6022e47b19161375fd2159299def5c76c915956d.tar.bz2
dotfiles-6022e47b19161375fd2159299def5c76c915956d.tar.xz
Fix bugs
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'emacs')
-rw-r--r--emacs/Makefile15
1 files changed, 10 insertions, 5 deletions
diff --git a/emacs/Makefile b/emacs/Makefile
index beebde0..23f2aa3 100644
--- a/emacs/Makefile
+++ b/emacs/Makefile
@@ -3,13 +3,18 @@ include ../common.mk
install:
mkdir -p -- ~/.config
- if test -d ~/.emacs.d; then \
- test ! -e ~/.config/emacs && \
- mv -- ~/.emacs.d ~/.config/emacs; \
+ if test -L ~/.emacs.d; then \
+ test "$$(readlink -- ~/.emacs.d)" = .config/emacs; \
else \
- mkdir -p -- ~/.config/emacs; \
+ set -e; \
+ if test -d ~/.emacs.d; then \
+ test ! -e ~/.config/emacs; \
+ mv -- ~/.emacs.d ~/.config/emacs; \
+ else \
+ mkdir -p -- ~/.config/emacs; \
+ fi; \
+ ln -sf -- .config/emacs ~/.emacs.d; \
fi
- ln -sf -- .config/emacs ~/.emacs.d
printf '; %s\n\n' 'This file is generated by ~/.dotfiles/emacs/Makefile' > ~/.config/emacs/init.el
cat -- init.el >> ~/.config/emacs/init.el
if $(CHECK_INSTALLED) emacs-go-mode 2>/dev/null; then\