From f4e6d36574e682bf8f13665c60055e3296d48600 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 26 May 2020 04:09:11 -0400 Subject: [PATCH] Move 'restart Emacs to see changes' message to 'doom sync' It isn't the autoloads generator's responsibility to do this. The "changes" referred to consist of more than just the regenerated autoloads file. --- core/cli/autoloads.el | 9 ++------- core/core-cli.el | 3 ++- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/core/cli/autoloads.el b/core/cli/autoloads.el index 83077cc50..af030efa1 100644 --- a/core/cli/autoloads.el +++ b/core/cli/autoloads.el @@ -80,17 +80,12 @@ one wants that.") (defun doom-autoloads--compile-file (file) (condition-case-unless-debug e (let ((byte-compile-warnings (if doom-debug-p byte-compile-warnings))) - (when (byte-compile-file file) - (unless doom-interactive-p - (add-hook 'kill-emacs-hook #'doom-cli--warn-refresh-session-h)) - (load (byte-compile-dest-file file) nil t))) + (and (byte-compile-file file) + (load (byte-compile-dest-file file) nil t))) (error (delete-file (byte-compile-dest-file file)) (signal 'doom-autoload-error (list file e))))) -(defun doom-cli--warn-refresh-session-h () - (print! (info "Restart or 'M-x doom/reload' Doom Emacs for changes to take effect"))) - (defun doom-autoloads--cleanup-form (form &optional expand) (let ((func (car-safe form))) (cond ((memq func '(provide custom-autoload)) diff --git a/core/core-cli.el b/core/core-cli.el index ffb78c173..fe72ebc30 100644 --- a/core/core-cli.el +++ b/core/core-cli.el @@ -405,7 +405,8 @@ stale." (doom-cli-packages-update)) (doom-cli-packages-purge prune-p 'builds-p prune-p prune-p) (run-hooks 'doom-sync-post-hook) - (doom-autoloads-reload) + (when (doom-autoloads-reload) + (print! (info "Restart Emacs or use 'M-x doom/reload' for changes to take effect"))) t)) (load! "cli/env")