               ((keywordp key)
                (pcase key
                  (:leader
-                  (doom--map-set :definer '(quote leader)))
+                  (setq doom--map-fn 'define-leader-key!))
                  (:localleader
-                  (doom--map-set :definer '(quote localleader)))
+                  (setq doom--map-fn 'define-localleader-key!))
                  (:after
                   (doom--map-nested (list 'after! (pop rest)) rest)
                   (setq rest nil))


;; specials
(defvar doom--map-forms nil)
(defvar doom--map-batch-forms nil)
(defvar doom--map-state '(:dummy t))
(defvar doom--map-parent-state nil)

    (cl-loop with attrs = (doom--map-state)
             for (state . defs) in doom--map-batch-forms
             if (or doom--map-evil-p (not state))
             collect `(,doom--map-fn ,@(if state `(:states ',state)) ,@attrs ,@(nreverse defs))
             into forms
             finally do (push (macroexp-progn forms) doom--map-forms))
    (setq doom--map-batch-forms nil)))
