 ;;; lang/racket/config.el -*- lexical-binding: t; -*-
 
 (def-package! racket-mode
-  :mode "\\.rkt$"
-  :interpreter "racket"
-  :init
-  (add-hook 'racket-repl-mode-hook 'racket-unicode-input-method-enable)
+  :hook ((racket-mode racket-repl-mode) . racket-unicode-input-method-enable)
   :config
-  (set-popup-rule! "*Racket REPL*"
-    :size 10
-    :select t
-    :modeline nil
-    :quit t
-    :transient 3)
+  (set-popup-rule! "^\\*Racket REPL" :size 10 :select t)
   (set-repl-handler! 'racket-mode #'+racket/repl)
   (set-eval-handler! 'racket-mode "racket")
   (set-company-backend! 'racket-mode '(company-abbrev

    :dot     ".")
  (set-rotate-patterns! 'racket-mode
    :symbols '(("#true" "#false")))

  (add-hook! racket-mode
    #'(;; Internals
       racket-unicode-input-method-enable
       ;; 3rd-party functionality
       doom|enable-delete-trailing-whitespace
       ;; fontification
       rainbow-delimiters-mode
       highlight-quoted-mode
       highlight-numbers-mode
       ;; initialization
       flycheck-mode))

  (setq-hook! racket-mode
      racket-smart-open-bracket-enable t
      company-frontends '(company-pseudo-tooltip-unless-just-one-frontend
                          company-preview-if-just-one-frontend
                          company-preview-common-frontend))

  (map! :map racket-mode-map
        :localleader

                                       company-dabbrev
                                       company-files))
  (set-lookup-handlers! 'racket-mode
    :definition     #'racket-describe
    :documentation #'racket-doc)
  (set-docset! 'racket-mode "Racket")
  (set-pretty-symbols! 'racket-mode
