From 2574c4cabc34756eb124e69d6a8e0ffeaa56a44f Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 1 Mar 2025 19:26:05 +0100 Subject: ... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- emacs/Makefile | 19 +++-------------- emacs/init-gdb.el | 1 - emacs/init-go-mode.el | 3 --- emacs/init-haskell-mode.el | 7 ------- emacs/init.el | 52 +++++++++++++++++++++++++++++++++------------- 5 files changed, 40 insertions(+), 42 deletions(-) delete mode 100644 emacs/init-gdb.el delete mode 100644 emacs/init-go-mode.el delete mode 100644 emacs/init-haskell-mode.el (limited to 'emacs') 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-gdb.el b/emacs/init-gdb.el deleted file mode 100644 index 51b1a35..0000000 --- a/emacs/init-gdb.el +++ /dev/null @@ -1 +0,0 @@ -(setq gdb-many-windows t) diff --git a/emacs/init-go-mode.el b/emacs/init-go-mode.el deleted file mode 100644 index 56e3c16..0000000 --- a/emacs/init-go-mode.el +++ /dev/null @@ -1,3 +0,0 @@ -(add-to-list 'load-path "/usr/share/emacs/site-lisp/go-mode/") -(autoload 'go-mode "go-mode" nil t) -(add-to-list 'auto-mode-alist '("\\.go\\'" . go-mode)) diff --git a/emacs/init-haskell-mode.el b/emacs/init-haskell-mode.el deleted file mode 100644 index 6fe75c2..0000000 --- a/emacs/init-haskell-mode.el +++ /dev/null @@ -1,7 +0,0 @@ -(add-to-list 'load-path "/usr/share/emacs/site-lisp/haskell-mode/") -(require 'haskell-mode-autoloads) -(add-to-list 'Info-default-directory-list "/usr/share/emacs/site-lisp/haskell-mode/") -(add-hook 'haskell-mode-hook - (lambda () - (turn-on-haskell-doc) - (turn-on-haskell-simple-indent))) 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)))) -- cgit v1.2.3-70-g09d2