summary refs log tree commit diff stats
path: root/lisp/+apheleia.el
diff options
context:
space:
mode:
authorCase Duckworth2022-06-09 09:16:50 -0500
committerCase Duckworth2022-06-09 09:16:50 -0500
commit21b5d80814520540454c1167ca0495dd023c54dd (patch)
treeb50bd959b44f7dbb6986514f4f88540a848913c8 /lisp/+apheleia.el
parentblep (diff)
downloademacs-21b5d80814520540454c1167ca0495dd023c54dd.tar.gz
emacs-21b5d80814520540454c1167ca0495dd023c54dd.zip
Fix startup complaining
Diffstat (limited to 'lisp/+apheleia.el')
-rw-r--r--lisp/+apheleia.el45
1 files changed, 0 insertions, 45 deletions
diff --git a/lisp/+apheleia.el b/lisp/+apheleia.el index df651b8..9ed731c 100644 --- a/lisp/+apheleia.el +++ b/lisp/+apheleia.el
@@ -2,7 +2,6 @@
2 2
3;;; Code: 3;;; Code:
4 4
5(require 'apheleia)
6(require 'cl-lib) 5(require 'cl-lib)
7 6
8;; https://github.com/raxod502/apheleia/pull/63#issue-1077529623 7;; https://github.com/raxod502/apheleia/pull/63#issue-1077529623
@@ -14,49 +13,5 @@
14 (point-max)) 13 (point-max))
15 (funcall callback))) 14 (funcall callback)))
16 15
17
18;;; `setup' integration
19
20(require 'setup)
21
22(setup-define :apheleia
23 (lambda (name formatter &optional mode -pend)
24 (let* ((mode (or mode (setup-get 'mode)))
25 (current-formatters (and -pend
26 (alist-get mode apheleia-formatters))))
27 `(progn
28 (setf (alist-get ',name apheleia-formatters)
29 ,formatter)
30 (setf (alist-get ',mode apheleia-mode-alist)
31 ',(pcase -pend
32 (:append (append (ensure-list current-formatters)
33 (list name)))
34 (:prepend (cons name (ensure-list current-formatters)))
35 ('nil name)
36 (_ (error "Improper `:apheleia' -PEND argument")))))))
37 :documentation
38 "Register a formatter to `apheleia''s lists.
39NAME is the name given to the formatter in `apheleia-formatters'
40and `apheleia-mode-alist'. FORMATTER is the command paired with
41NAME in `apheleia-formatters'. MODE is the mode or modes to add
42NAME to in `apheleia-mode-alist'. If MODE is not given or nil,
43use the setup form's MODE. Optional argument -PEND can be one of
44`:append' or `:prepend', and if given will append or prepend the
45given NAME to the current formatters for the MODE in
46`apheleia-mode-alist', rather than replace them (the default).
47
48Example:
49(setup
50 (:apheleia isort (\"isort\" \"--stdout\" \"-\")
51 python-mode))
52; =>
53(progn
54 (setf (alist-get 'isort apheleia-formatters)
55 '(\"isort\" \"--stdout\" \"-\"))
56 (setf (alist-get 'python-mode apheleia-mode-alist)
57 'isort))
58
59This form cannot be repeated, and it cannot be used as HEAD.")
60
61(provide '+apheleia) 16(provide '+apheleia)
62;;; +apheleia.el ends here 17;;; +apheleia.el ends here