                     ;; compatibility fallbacks
                     "gnutls-cli -p %p %h"))
 
-;; Emacs stores authinfo in HOME and in plaintext. Let's not do that, mkay? This
-;; file usually stores usernames, passwords, and other such treasures for the
+;; Emacs stores authinfo in $HOME and in plaintext. Let's not do that, mkay?
+;; This file stores usernames, passwords, and other such treasures for the
 ;; aspiring malicious third party.
 (setq auth-sources (list (expand-file-name "authinfo.gpg" doom-etc-dir)
                          "~/.authinfo.gpg"))
 
-;; Emacs on Windows frequently confuses HOME (C:\Users\<NAME>) and APPDATA,
+;; Emacs on Windows frequently confuses HOME (C:\Users\<NAME>) and %APPDATA%,
 ;; causing `abbreviate-home-dir' to produce incorrect paths.
 (when IS-WINDOWS
   (setq abbreviated-home-dir "\\`'"))


;; Adopt a sneaky garbage collection strategy of waiting until idle time to
;; collect; staving off the collector while the user is working.
(when doom-interactive-mode
  (add-transient-hook! 'pre-command-hook (gcmh-mode +1))
  (with-eval-after-load 'gcmh
    (setq gcmh-idle-delay 10
          gcmh-verbose doom-debug-mode
          gcmh-high-cons-threshold 16777216) ; 16mb
    (add-hook 'focus-out-hook #'gcmh-idle-garbage-collect)))

;; HACK `tty-run-terminal-initialization' is *tremendously* slow for some
;;      reason. Disabling it completely could have many side-effects, so we
;;      defer it until later.
(unless (display-graphic-p)
  (advice-add #'tty-run-terminal-initialization :override #'ignore)
  (add-hook! 'window-setup-hook
    (defun doom-init-tty-h ()
      (advice-remove #'tty-run-terminal-initialization #'ignore)
      (tty-run-terminal-initialization (selected-frame) nil t))))


;;

    (setq doom-init-p t)

    ;; Reset as much state as possible, so `doom-initialize' can be treated like
    ;; a reset function. e.g. when reloading the config.
    (setq-default exec-path doom--initial-exec-path
                  load-path doom--initial-load-path
                  process-environment doom--initial-process-environment)
