Fix doom/reload & doom/reload-autoloads

This commit is contained in:
Henrik Lissner 2019-07-27 17:03:44 +02:00
parent 3c36a345d8
commit 402260f154
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 25 additions and 17 deletions

View file

@ -33,24 +33,30 @@ reloads your package list, and lastly, reloads your private config.el.
Runs `doom-reload-hook' afterwards." Runs `doom-reload-hook' afterwards."
(interactive "P") (interactive "P")
(require 'core-cli) (require 'core-cli)
(general-auto-unbind-keys) (require 'core-packages)
(let ((doom-reloading-p t)) (doom-delete-autoloads-file doom-autoload-file)
(when (getenv "DOOMENV") (doom-delete-autoloads-file doom-package-autoload-file)
(doom-reload-env-file 'force)) (let ((doom-reloading-p t)
(doom-reload-autoloads force-p) doom-init-p
(let (doom-init-p) doom-init-modules-p
(doom-initialize)) doom-init-packages-p)
(let ((default-directory doom-core-dir))
(mapc (doom-rpartial #'load 'noerror 'nomessage)
(file-expand-wildcards "autoload/*.el")))
(doom-initialize 'force)
(when (file-exists-p doom-env-file)
(doom-reload-env-file))
(doom-reload-autoloads nil 'force)
(with-demoted-errors "PRIVATE CONFIG ERROR: %s" (with-demoted-errors "PRIVATE CONFIG ERROR: %s"
(let (doom-init-modules-p) (general-auto-unbind-keys)
(doom-initialize-modules))) (unwind-protect
(when (bound-and-true-p doom-packages) (doom-initialize-modules)
(doom/reload-packages)) (general-auto-unbind-keys t)))
(run-hook-wrapped 'doom-reload-hook #'doom-try-run-hook)) (run-hook-wrapped 'doom-reload-hook #'doom-try-run-hook))
(general-auto-unbind-keys t)
(message "Finished!")) (message "Finished!"))
;;;###autoload ;;;###autoload
(defun doom/reload-autoloads (&optional _force-p) (defun doom/reload-autoloads ()
"Reload only `doom-autoload-file' and `doom-package-autoload-file'. "Reload only `doom-autoload-file' and `doom-package-autoload-file'.
This is much faster and safer than `doom/reload', but not as comprehensive. This This is much faster and safer than `doom/reload', but not as comprehensive. This
@ -59,10 +65,11 @@ not reload your private config.
It is useful to only pull in changes performed by 'doom refresh' on the command It is useful to only pull in changes performed by 'doom refresh' on the command
line." line."
(interactive "P") (interactive)
;; TODO regenerate autoloads (require 'core-cli)
(doom-load-autoloads-file doom-autoload-file) (require 'core-packages)
(doom-load-autoloads-file doom-package-autoload-file)) (doom-initialize-packages)
(doom-reload-autoloads nil 'force))
;;;###autoload ;;;###autoload
(defun doom/reload-env () (defun doom/reload-env ()

View file

@ -1,6 +1,7 @@
;;; -*- lexical-binding: t; no-byte-compile: t; -*- ;;; -*- lexical-binding: t; no-byte-compile: t; -*-
(require 'seq) (require 'seq)
(require 'straight nil t)
(defvar doom-auto-accept (getenv "YES") (defvar doom-auto-accept (getenv "YES")