diff --git a/lisp/doom-lib.el b/lisp/doom-lib.el index e2c89bf76..4110e792f 100644 --- a/lisp/doom-lib.el +++ b/lisp/doom-lib.el @@ -443,15 +443,13 @@ ARGLIST." (allow-other-keys arglist)) ,@body))) -(let ((i 1)) - (dolist (sym '(%2 %3 %4 %5 %6 %7 %8 %9)) - (put 'fn! sym (cl-incf i)))) +(setplist 'doom--fn-crawl '(%2 2 %3 3 %4 4 %5 5 %6 6 %7 7 %8 8 %9 9)) (defun doom--fn-crawl (data args) (cond ((symbolp data) (when-let (pos (cond ((eq data '%*) 0) ((memq data '(% %1)) 1) - ((get 'fn! data)))) + ((get 'doom--fn-crawl data)))) (when (and (= pos 1) (aref args 1) (not (eq data (aref args 1)))) @@ -730,9 +728,8 @@ advised)." (defun ,fn (&rest _) ,(format "Transient hook for %S" (doom-unquote hook-or-function)) ,@forms - (let ((sym ,hook-or-function)) - (cond ((functionp sym) (advice-remove sym #',fn)) - ((symbolp sym) (remove-hook sym #',fn)))) + (cond ((functionp sym) (advice-remove sym #',fn)) + ((symbolp sym) (remove-hook sym #',fn))) (unintern ',fn nil)) (cond ((functionp sym) (advice-add ,hook-or-function ,(if append? :after :before) #',fn))