summaryrefslogtreecommitdiff
path: root/.config/emacs/modules/bd--essentials.el
diff options
context:
space:
mode:
authorbd <bdunahu@colostate.edu>2024-03-29 19:11:40 -0600
committerbd <bdunahu@colostate.edu>2024-03-29 19:11:40 -0600
commitbb92d2715f9ea0868ea5edd3ac870bbec9d4f343 (patch)
treef268e5d0da421f6183cc492d0d834fb7a9c96e09 /.config/emacs/modules/bd--essentials.el
parent69aaa9077b9e8aa575ae5681f82e019e8c34ee18 (diff)
Create autoformatter library, replacing cleanup function
Diffstat (limited to '.config/emacs/modules/bd--essentials.el')
-rw-r--r--.config/emacs/modules/bd--essentials.el16
1 files changed, 3 insertions, 13 deletions
diff --git a/.config/emacs/modules/bd--essentials.el b/.config/emacs/modules/bd--essentials.el
index e15f29f..8b07ed6 100644
--- a/.config/emacs/modules/bd--essentials.el
+++ b/.config/emacs/modules/bd--essentials.el
@@ -23,20 +23,10 @@
(global-hl-line-mode 1)
(global-visual-line-mode t)
-(defun bd/cleanup-exempt-modes ()
- "Modes which should NOT be autoformatted
-on save."
- (unless (or (derived-mode-p 'text-mode) (equal major-mode 'makefile-gmake-mode))
- (bd/cleanup-buffer)))
-
-(defun bd/cleanup-buffer ()
- (interactive)
- (delete-trailing-whitespace)
- (untabify (point-min) (point-max))
- (indent-region (point-min) (point-max)))
-
+;; my custom cleanup mode
+(require 'autoformat)
+(autoformat-mode 1)
(setopt next-line-add-newlines t)
-(add-hook 'before-save-hook 'bd/cleanup-exempt-modes)
;;;; buffers