summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--init.el10
-rw-r--r--lisp/+apheleia.el16
2 files changed, 26 insertions, 0 deletions
diff --git a/init.el b/init.el index b046ffa..19513ea 100644 --- a/init.el +++ b/init.el
@@ -567,6 +567,16 @@
567 [remap isearch-query-replace] #'anzu-isearch-query-replace 567 [remap isearch-query-replace] #'anzu-isearch-query-replace
568 [remap isearch-query-replace-regexp] #'anzu-isearch-query-replace-regexp)) 568 [remap isearch-query-replace-regexp] #'anzu-isearch-query-replace-regexp))
569 569
570(setup (:straight-when (apheleia
571 :host github :repo "raxod502/apheleia")
572 (executable-find "diff"))
573 (:require apheleia
574 +apheleia)
575 (setf (alist-get 'indent-region apheleia-formatters) #'+apheleia-indent-region
576 (alist-get 'emacs-lisp-mode apheleia-mode-alist) 'indent-region
577 (alist-get 'lisp-interaction-mode apheleia-mode-alist) 'indent-region)
578 (apheleia-global-mode +1))
579
570(setup (:straight avy) 580(setup (:straight avy)
571 (:require avy +avy) 581 (:require avy +avy)
572 (:+key "M-j" #'avy-goto-char-timer) 582 (:+key "M-j" #'avy-goto-char-timer)
diff --git a/lisp/+apheleia.el b/lisp/+apheleia.el new file mode 100644 index 0000000..f3b16e4 --- /dev/null +++ b/lisp/+apheleia.el
@@ -0,0 +1,16 @@
1;;; +apheleia.el -*- lexical-binding: t; -*-
2
3;;; Code:
4
5;; https://github.com/raxod502/apheleia/pull/63#issue-1077529623
6(defun +apheleia-indent-region (orig scratch callback _error)
7 (with-current-buffer scratch
8 (setq-local indent-line-function
9 (buffer-local-value 'indent-line-function orig))
10 (indent-region (point-min)
11(point-max))
12 (funcall callback)))
13
14(provide '+apheleia)
15;;; +apheleia.el ends here
16 \ No newline at end of file