summaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.config/emacs/arkta/arkta-progmodes.el14
-rw-r--r--emacs/.config/emacs/init.el22
2 files changed, 15 insertions, 21 deletions
diff --git a/emacs/.config/emacs/arkta/arkta-progmodes.el b/emacs/.config/emacs/arkta/arkta-progmodes.el
index e19aa47..c58ee93 100644
--- a/emacs/.config/emacs/arkta/arkta-progmodes.el
+++ b/emacs/.config/emacs/arkta/arkta-progmodes.el
@@ -13,7 +13,7 @@
13 :init 13 :init
14 (defun arkta/asm-setup () 14 (defun arkta/asm-setup ()
15 (setq indent-tabs-mode t) 15 (setq indent-tabs-mode t)
16 (set-tab-width 8)) 16 (arkta/set-tab-width 8))
17 :hook (asm-mode . arkta/asm-setup)) 17 :hook (asm-mode . arkta/asm-setup))
18 18
19(use-package auto-compile 19(use-package auto-compile
@@ -30,7 +30,7 @@
30 :init 30 :init
31 (defun arkta/c-setup () 31 (defun arkta/c-setup ()
32 (setq indent-tabs-mode t) 32 (setq indent-tabs-mode t)
33 (set-tab-width c-ts-mode-indent-offset)) 33 (arkta/set-tab-width c-ts-mode-indent-offset))
34 :hook (c-ts-base-mode . arkta/c-setup) 34 :hook (c-ts-base-mode . arkta/c-setup)
35 :custom 35 :custom
36 (c-ts-mode-indent-offset 8) 36 (c-ts-mode-indent-offset 8)
@@ -106,7 +106,7 @@
106 (defun arkta/go-setup () 106 (defun arkta/go-setup ()
107 (add-hook 'before-save-hook #'gofmt-before-save nil t) 107 (add-hook 'before-save-hook #'gofmt-before-save nil t)
108 (setq indent-tabs-mode t) 108 (setq indent-tabs-mode t)
109 (set-tab-width go-ts-mode-indent-offset)) 109 (arkta/set-tab-width go-ts-mode-indent-offset))
110 :hook (go-ts-mode . arkta/go-setup)) 110 :hook (go-ts-mode . arkta/go-setup))
111 111
112(use-package groovy-mode 112(use-package groovy-mode
@@ -150,7 +150,7 @@
150(use-package lua-mode 150(use-package lua-mode
151 :straight t 151 :straight t
152 :custom 152 :custom
153 (lua-indent-level 4) 153 (lua-indent-level standard-indent)
154 :mode ("\\.lua\\'" "\\.rockspec\\'")) 154 :mode ("\\.lua\\'" "\\.rockspec\\'"))
155 155
156(use-package make-mode 156(use-package make-mode
@@ -167,10 +167,8 @@
167 :straight t 167 :straight t
168 :mode ("\\.asm\\'" 168 :mode ("\\.asm\\'"
169 "\\.inc\\'") 169 "\\.inc\\'")
170 :init 170 :custom
171 (defun arkta/nasm-setup () 171 (nasm-offset standard-indent))
172 (set-tab-width 4))
173 :hook (nasm-mode . arkta/nasm-setup))
174 172
175(use-package ninja-mode 173(use-package ninja-mode
176 :straight t 174 :straight t
diff --git a/emacs/.config/emacs/init.el b/emacs/.config/emacs/init.el
index ca353b4..cb865ac 100644
--- a/emacs/.config/emacs/init.el
+++ b/emacs/.config/emacs/init.el
@@ -206,20 +206,16 @@
206;; :if +emacs30+ 206;; :if +emacs30+
207;; :straight 'compat) 207;; :straight 'compat)
208 208
209;; Helper functions 209;; Tab width, configure this before any other modes
210(defmacro defsetter (name &rest emacs-names) 210(defun arkta/set-tab-width (value)
211 (let ((name (intern (concat "set-" (symbol-name name))))) 211 "Set the tab width, sets both `standard-indent' and `tab-width' so that they don't get forgotten."
212 `(defun ,name (value &optional default) 212 (setq standard-indent value
213 (if default 213 tab-width value))
214 (progn
215 ,@(mapcar (lambda (name) `(setq-default ,name value)) emacs-names))
216 ,@(mapcar (lambda (name) `(setq ,name value)) emacs-names)))))
217 214
218(defsetter tab-width c-basic-offset nasm-offset standard-indent tab-width) 215(use-package emacs
219 216 :custom
220;; Miscellany 217 (standard-indent 4)
221 218 (tab-width standard-indent))
222(set-tab-width 4 t)
223 219
224;; HIC SVNT DRACONES 220;; HIC SVNT DRACONES
225 221