Skip to content

Commit 443f086

Browse files
committed
Make the ast hooks more idiomatic
1 parent 632be9e commit 443f086

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

clj-refactor.el

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,12 +279,12 @@ if it appears to be unused."
279279
(defcustom cljr-before-warming-ast-cache-hook nil
280280
"Runs before each time the AST is loaded."
281281
:group 'cljr
282-
:type 'function)
282+
:type 'hook)
283283

284284
(defcustom cljr-after-warming-ast-cache-hook nil
285285
"Runs after each time the AST is loaded."
286286
:group 'cljr
287-
:type 'function)
287+
:type 'hook)
288288

289289
;;; Buffer Local Declarations
290290

@@ -2680,13 +2680,11 @@ Also adds the alias prefix to all occurrences of public symbols in the namespace
26802680
asts-in-bad-state) "; "))))))
26812681

26822682
(defun cljr--warm-ast-cache ()
2683-
(when cljr-before-warming-ast-cache-hook
2684-
(funcall cljr-before-warming-ast-cache-hook))
2683+
(run-hooks 'cljr-before-warming-ast-cache-hook)
26852684
(cljr--call-middleware-async
26862685
(cljr--create-msg "warm-ast-cache")
26872686
(lambda (res)
2688-
(when cljr-after-warming-ast-cache-hook
2689-
(funcall cljr-after-warming-ast-cache-hook res))
2687+
(run-hook-with-args 'cljr-after-warming-ast-cache-hook res)
26902688
(cljr--maybe-rethrow-error res)
26912689
(cljr--maybe-nses-in-bad-state res)
26922690
(when cljr--debug-mode

0 commit comments

Comments
 (0)