Skip to content

Commit 4a08072

Browse files
committed
tweak(core): accept hook symbol in +hook-once!
1 parent 4dd3285 commit 4a08072

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

elisp/+minemacs.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ DEPTH and LOCAL are passed as is to `add-hook'."
241241
(defmacro +hook-once! (hook &rest body)
242242
"Hook BODY in HOOK, it runs only once."
243243
(declare (indent 1))
244-
(let ((fn-name (intern (format "+hook-once--function-%d-h" (cl-incf +hook-once-num)))))
244+
(let ((hook (+unquote hook))
245+
(fn-name (intern (format "+hook-once--function-%d-h" (cl-incf +hook-once-num)))))
245246
`(add-hook
246247
',hook
247248
(defun ,fn-name ()

0 commit comments

Comments
 (0)