aboutsummaryrefslogtreecommitdiffstats
path: root/emacs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--emacs-go-mode/Makefile11
-rw-r--r--emacs-go-mode/init-go-mode.el (renamed from emacs/init-go-mode.el)0
-rw-r--r--emacs-haskell-mode/Makefile11
-rw-r--r--emacs-haskell-mode/init-haskell-mode.el (renamed from emacs/init-haskell-mode.el)0
-rw-r--r--emacs/Makefile19
-rw-r--r--emacs/init.el52
-rw-r--r--gdb/init-gdb.el (renamed from emacs/init-gdb.el)0
7 files changed, 62 insertions, 31 deletions
diff --git a/emacs-go-mode/Makefile b/emacs-go-mode/Makefile
new file mode 100644
index 0000000..ea3f8be
--- /dev/null
+++ b/emacs-go-mode/Makefile
@@ -0,0 +1,11 @@
+.POSIX:
+
+install:
+ mkdir -p -- ~/.config/emacs
+ test -L ~/.config/emacs/init-go-mode.el || test ! -e ~/.config/emacs/init-go-mode.el
+ ln -sf -- ~/.dotfiles/emacs-go-mode/init-go-mode.el ~/.config/emacs/
+
+uninstall:
+ +! ../check-installed emacs-go-mode
+ -unlink -- ~/.config/emacs/init-go-mode.el
+ -rmdir -- ~/.config/emacs
diff --git a/emacs/init-go-mode.el b/emacs-go-mode/init-go-mode.el
index 56e3c16..56e3c16 100644
--- a/emacs/init-go-mode.el
+++ b/emacs-go-mode/init-go-mode.el
diff --git a/emacs-haskell-mode/Makefile b/emacs-haskell-mode/Makefile
new file mode 100644
index 0000000..3605590
--- /dev/null
+++ b/emacs-haskell-mode/Makefile
@@ -0,0 +1,11 @@
+.POSIX:
+
+install:
+ mkdir -p -- ~/.config/emacs
+ test -L ~/.config/emacs/init-haskell-mode.el || test ! -e ~/.config/emacs/init-haskell-mode.el
+ ln -sf -- ~/.dotfiles/emacs-haskell-mode/init-haskell-mode.el ~/.config/emacs/
+
+uninstall:
+ +! ../check-installed emacs-haskell-mode
+ -unlink -- ~/.config/emacs/init-haskell-mode.el
+ -rmdir -- ~/.config/emacs
diff --git a/emacs/init-haskell-mode.el b/emacs-haskell-mode/init-haskell-mode.el
index 6fe75c2..6fe75c2 100644
--- a/emacs/init-haskell-mode.el
+++ b/emacs-haskell-mode/init-haskell-mode.el
diff --git a/emacs/Makefile b/emacs/Makefile
index 9fa5799..665bde5 100644
--- a/emacs/Makefile
+++ b/emacs/Makefile
@@ -14,22 +14,8 @@ install:
fi; \
ln -sf -- .config/emacs ~/.emacs.d; \
fi
- printf '; %s\n; %s\n\n' > ~/.config/emacs/init.el \
- 'This file is generated by ~/.dotfiles/emacs/Makefile' \
- '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
- cat -- init.el >> ~/.config/emacs/init.el
- if ../check-installed emacs-go-mode 2>/dev/null; then \
- printf '\n' >> ~/.config/emacs/init.el && \
- cat -- init-go-mode.el >> ~/.config/emacs/init.el; \
- fi
- if ../check-installed emacs-haskell-mode; then\
- printf '\n' >> ~/.config/emacs/init.el && \
- cat -- init-haskell-mode.el >> ~/.config/emacs/init.el; \
- fi
- if ../check-installed gdb; then \
- printf '\n' >> ~/.config/emacs/init.el && \
- cat -- init-gdb.el >> ~/.config/emacs/init.el; \
- fi
+ test -L ~/.config/emacs/init.el || test ! -e ~/.config/emacs/init.el
+ ln -sf -- ~/.dotfiles/emacs/init.el ~/.config/emacs/init.el
if grep Ubuntu < /etc/lsb-release >/dev/null 2>/dev/null; then \
mkdir -p -- ~/.config/profile.d && \
(test ! -e ~/.config/profile.d/emacs || \
@@ -52,3 +38,4 @@ uninstall:
-unlink -- ~/.emacs.d
-rmdir -- ~/.config/emacs
-unlink -- ~/.local/bin/e
+ test ! -d ../.work/emacs || (cd ../.work/emacs && $(MAKE) uninstall)
diff --git a/emacs/init.el b/emacs/init.el
index a807fa7..432b772 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -4,21 +4,25 @@
;; You may delete these explanatory comments.
(package-initialize)
+
+;; Enable the upcase-region function which is disabled by default
(put 'upcase-region 'disabled nil)
-(custom-set-variables
- ;; custom-set-variables was added by Custom.
- ;; If you edit it by hand, you could mess it up, so be careful.
- ;; Your init file should contain only one such instance.
- ;; If there is more than one, they won't work right.
- '(inhibit-startup-screen t))
-(setq display-time-string-forms
- '((propertize (concat " " 24-hours ":" minutes " ")
- )))
+;; Never show the startup screen (go to scratch if there is no file specified)
+(custom-set-variables '(inhibit-startup-screen t))
+
+
+;; Display column number after line number
(column-number-mode)
+
+
+;; Configure and display clock
+(setq display-time-string-forms
+ '((propertize (concat " " 24-hours ":" minutes " ") )))
(display-time-mode)
+
; (set-default-font "-misc-fixed-medium-r-normal--13-*-75-75-c-70-iso8859-1")
;; TODO set-default-font stopped working
@@ -34,16 +38,34 @@
(set-face-foreground 'font-lock-comment-face "red")
+
+;; Fix up C mode
+;;;; disable electric mode
(add-hook 'after-change-major-mode-hook (lambda() (electric-indent-mode -1)))
(add-hook 'c-mode-hook (lambda () (electric-indent-local-mode)))
-
+;;;; use tab as indentation
(defvaralias 'c-basic-offset 'tab-width)
+;; TODO trailing whitespaces are removed even where I want them
+
+
+;; TODO I can probably remove these, do not remember why they were added
(global-set-key (kbd "DEL") 'backward-delete-char)
(setq c-backspace-function 'backward-delete-char)
-(setq vc-follow-symlinks nil)
-(setq vc-handled-backends nil)
-(add-to-list 'auto-mode-alist '("/PKGBUILD$" . shell-script-mode))
-(add-to-list 'auto-mode-alist '("/APKBUILD$" . shell-script-mode))
-(setq auto-mode-alist (cons '("\.cl$" . c-mode) auto-mode-alist))
+;; Version control configurations
+(setq vc-follow-symlinks nil) ; Do not follow symlinks in version control
+(setq vc-handled-backends nil) ; Do not use version control features
+
+
+;; Addition rules for major mode selection
+(add-to-list 'auto-mode-alist '("/PKGBUILD$" . shell-script-mode)) ; arch linux build scripts
+(add-to-list 'auto-mode-alist '("/APKBUILD$" . shell-script-mode)) ; alpine linux build scripts
+(setq auto-mode-alist (cons '("\.cl$" . c-mode) auto-mode-alist)) ; OpenCL source files
+
+
+
+;; Load configurations from installed for other packages
+((lambda ()
+ (dolist (file (directory-files (expand-file-name "~/.config/emacs/") t "^init-.*\\.el$"))
+ (load-file file))))
diff --git a/emacs/init-gdb.el b/gdb/init-gdb.el
index 51b1a35..51b1a35 100644
--- a/emacs/init-gdb.el
+++ b/gdb/init-gdb.el