   :after (:all js2-mode company tern)
   :config
 
-  (defun radian--company-tern-enable ()
+  (radian-defhook radian--company-tern-enable ()
+    js2-mode-hook
     "Enable `company-tern' in the current buffer."
     (setq-local company-backends
-                (cons 'company-tern radian--company-backends-global)))
-
-  (add-hook 'js2-mode-hook #'radian--company-tern-enable))
+                (cons 'company-tern radian--company-backends-global))))
 
 ;;;; Markdown
 ;; https://daringfireball.net/projects/markdown/

  :after haskell-mode
  :config

  (defun radian--hindent-enable-maybe (&optional arg)
    "Enable `hindent-mode' if not in `literate-haskell-mode'.
ARG is passed to `hindent-mode' toggle function."
    ;; Don't enable `hindent-mode' in `literate-haskell-mode'. See
    ;; https://github.com/commercialhaskell/hindent/issues/496.
    (unless (derived-mode-p 'literate-haskell-mode)
      (hindent-mode arg)))

  (add-hook 'haskell-mode-hook #'radian--hindent-enable-maybe))

;;;; HTML
;; https://www.w3.org/TR/html5/

;; over the init-file. We do this to avoid having straight.el
;; configuration mentioned in the top-level init-file.

(radian-defhook radian--reset-straight-current-profile ()
  radian--finalize-init-hook
  "Reset `straight-current-profile' to nil.
This function is used on `radian--finalize-init-hook' to emulate
binding the variable dynamically over the entire init-file."
  (setq straight-current-profile nil))

(setq straight-current-profile 'radian)

;; Treat loading the init-file as a transaction. See the straight.el
;; documentation for more information about this.

(radian-defhook radian--finalize-straight-transaction ()
  radian--finalize-init-hook
  "Finalize the init-file's straight.el transaction."
  (setq straight-treat-as-init nil)
  (straight-finalize-transaction))

(setq straight-treat-as-init t)

