       ;; Don't monopolize frame!
       (advice-add #'org-agenda :around #'doom*suppress-delete-other-windows)
 
-      (after! evil
-        (map! :map* org-agenda-mode-map
-              :m [escape] 'org-agenda-Quit
-              :m "ESC"    'org-agenda-Quit))
+      (map! :map org-agenda-mode-map
+            :m [escape] 'org-agenda-Quit
+            :m "ESC"    'org-agenda-Quit)
       (let ((map org-agenda-mode-map))
         (define-key map "q" 'org-agenda-Quit)
         (define-key map "Q" 'org-agenda-Quit)))))

          (window (selected-window)))
      (apply orig-fn args)
      (when popup-p (doom/popup-close window))))
  (advice-add 'xref-goto-xref :around 'doom*xref-follow-and-close))


;; Ensure these settings are attached to org-load-hook as late as possible,


;; Major mode changes (and other things) may call `kill-all-local-variables',
;; turning off things like `doom-popup-mode'. This prevents that.
(put 'doom-popup-mode  'permanent-local t)
(put 'doom-popup-rules 'permanent-local t)

(defun doom|hide-modeline-in-popup ()
  "Don't show modeline in popup windows without a :modeline rule. If one exists
and it's a symbol, use `doom-modeline' to grab the format. If non-nil, show the
mode-line as normal. If nil (or omitted, by default), then hide the modeline
entirely."
  (if doom-popup-mode
      (let ((modeline (plist-get doom-popup-rules :modeline)))
        (cond ((or (eq modeline 'nil)
