refactor(format): introduce +format-functions

This commit is contained in:
Henrik Lissner 2024-02-14 17:44:21 -05:00
parent 8651651125
commit 20de3d0f29
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
2 changed files with 67 additions and 11 deletions

View file

@ -27,6 +27,17 @@ This has no effect on the +onsave flag, apheleia will always be used there.")
(defvaralias '+format-with 'apheleia-formatter
"Set this to explicitly use a certain formatter for the current buffer.")
(defvar +format-functions
'(+format-in-org-src-blocks-fn
+format-with-lsp-fn)
"A list of functions to run when formatting a buffer or region.
Each function is given three arguments: the starting point, end point, and a
symbol indicating the type of operation being requested (as a symbol: either
`region' or `buffer').
The first function to return non-nil will abort all functions after it,
including Apheleia itself.")
;;
;;; Bootstrap