From 0165cc6bfc9905b5806ba879e7a7cdf0233d4351 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 29 Sep 2021 17:21:50 -0500 Subject: Change apheleia stupid indenting --- lisp/acdw-apheleia.el | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lisp/acdw-apheleia.el (limited to 'lisp') diff --git a/lisp/acdw-apheleia.el b/lisp/acdw-apheleia.el new file mode 100644 index 0000000..1b646ef --- /dev/null +++ b/lisp/acdw-apheleia.el @@ -0,0 +1,25 @@ +;;; acdw-apheleia.el --- bespoke apheleia junk -*- lexical-binding: t -*- + +;;; Commentary: + +;;; Code: + +(require 'apheleia) + +(defcustom apheleia-stupid-modes '(makefile-mode + org-mode) + "List of stupid modes to not use `apheleia-global-mode' on." + :type '(repeat function) + :group 'apheleia) + +(defun apheleia-dumb-auto-format () + "Format a buffer dumbly." + ;; If there's no apheleia formatter for the mode, just indent the + ;; buffer. + (unless (or (apply #'derived-mode-p apheleia-stupid-modes) + (and (fboundp 'apheleia--get-formatter-command) + (apheleia--get-formatter-command))) + (indent-region (point-min) (point-max)))) + +(provide 'acdw-apheleia) +;;; acdw-apheleia ends here -- cgit 1.4.1-21-gabe81