refactor(format): introduce +format-functions
This commit is contained in:
parent
8651651125
commit
20de3d0f29
2 changed files with 67 additions and 11 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue