emacs/lisp/+apheleia.el

18 lines
506 B
EmacsLisp
Raw Normal View History

2022-01-07 23:30:27 +00:00
;;; +apheleia.el -*- lexical-binding: t; -*-
;;; Code:
2022-06-08 22:59:53 +00:00
(require 'cl-lib)
2022-01-07 23:30:27 +00:00
;; https://github.com/raxod502/apheleia/pull/63#issue-1077529623
2022-06-08 22:59:53 +00:00
(cl-defun +apheleia-indent-region (&key buffer scratch formatter callback &allow-other-keys)
2022-01-07 23:30:27 +00:00
(with-current-buffer scratch
(setq-local indent-line-function
2022-06-08 22:59:53 +00:00
(buffer-local-value 'indent-line-function buffer))
2022-01-07 23:30:27 +00:00
(indent-region (point-min)
2022-01-10 02:52:07 +00:00
(point-max))
2022-01-07 23:30:27 +00:00
(funcall callback)))
(provide '+apheleia)
;;; +apheleia.el ends here