     (ignore-errors (delete-file (byte-compile-dest-file file)))
     t))
 
-(defun doom--warn-refresh-session ()
+(defun doom--warn-refresh-session-h ()
   (message "Restart or reload Doom Emacs for changes to take effect:\n")
   (message "  M-x doom/restart-and-restore")
   (message "  M-x doom/restart")


(defun doom--reload-files (&rest files)
  (if noninteractive
      (add-hook 'doom-cli-post-execute-hook #'doom--warn-refresh-session)
    (dolist (file files)
      (load-file (byte-compile-dest-file file)))))

(defun doom--byte-compile-file (file)
  (let ((byte-compile-warnings (if doom-debug-mode byte-compile-warnings)))
    (condition-case e
        (when (byte-compile-file file)
          ;; Give autoloads file a chance to report error

                nil t))
      ((debug error)
       (let ((backup-file (concat file ".bk")))
         (print! (warn "Copied backup to %s") (relpath backup-file))
         (copy-file file backup-file 'overwrite))
       (doom-delete-autoloads-file file)
       (signal 'doom-autoload-error (list file e))))))
