Add force-p parameter to doom//refresh

Also force autoloads regeneration on doom upgrade.
This commit is contained in:
Henrik Lissner 2018-06-12 12:26:48 +02:00
parent 77ac164651
commit c6324da59d
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -213,16 +213,16 @@ recompile. Run this whenever you:
(string-match-p "[^ \t\n]" (buffer-string)) (string-match-p "[^ \t\n]" (buffer-string))
(error "Failed to check working tree in %s" dir))))) (error "Failed to check working tree in %s" dir)))))
(defun doom//refresh () (defun doom//refresh (&optional force-p)
"Ensure Doom is in a working state by checking autoloads and packages, and "Ensure Doom is in a working state by checking autoloads and packages, and
recompiling any changed compiled files. This is the shotgun solution to most recompiling any changed compiled files. This is the shotgun solution to most
problems with doom." problems with doom."
(interactive) (interactive "P")
(doom//reload-doom-autoloads) (doom//reload-doom-autoloads force-p)
(unwind-protect (unwind-protect
(progn (ignore-errors (doom//packages-autoremove)) (progn (ignore-errors (doom//packages-autoremove))
(ignore-errors (doom//packages-install))) (ignore-errors (doom//packages-install)))
(doom//reload-package-autoloads) (doom//reload-package-autoloads force-p)
(doom//byte-compile nil 'recompile))) (doom//byte-compile nil 'recompile)))
(defun doom//upgrade () (defun doom//upgrade ()
@ -272,7 +272,7 @@ problems with doom."
(buffer-string))) (buffer-string)))
(unless (equal (vc-git-working-revision doom-emacs-dir) rev) (unless (equal (vc-git-working-revision doom-emacs-dir) rev)
(error "Failed to checkout latest commit.\n\n%s" (buffer-string))) (error "Failed to checkout latest commit.\n\n%s" (buffer-string)))
(doom//refresh) (doom//refresh 'force)
(message "Done! Please restart Emacs for changes to take effect")))) (message "Done! Please restart Emacs for changes to take effect"))))
(user-error (user-error
(message "%s Aborting." (error-message-string e))) (message "%s Aborting." (error-message-string e)))