diff --git a/core/core-configuration-layer.el b/core/core-configuration-layer.el index ebd6e058f..5508b4459 100644 --- a/core/core-configuration-layer.el +++ b/core/core-configuration-layer.el @@ -586,8 +586,7 @@ refreshed during the current session." (configuration-layer//dump-emacs))) ((spacemacs-is-dumping-p) ;; dumping - (configuration-layer//load) - (configuration-layer/message "Dumping Emacs...")) + (configuration-layer//load)) ((and (spacemacs/emacs-with-pdumper-set-p) (spacemacs-run-from-dump-p)) ;; dumped diff --git a/dump-init.el b/dump-init.el index 30e76be68..9dae986d3 100644 --- a/dump-init.el +++ b/dump-init.el @@ -1,2 +1,12 @@ (setq spacemacs-dump-mode 'dumping) (load (concat (file-name-directory load-file-name) "init.el")) +;; we need to backup the load-path in order to restore them +;; when we use the dump file +(setq load-path-backup load-path) +;; disable undo-tree to prevent from segfaulting when loading the dump +(when (fboundp 'global-undo-tree-mode) + (global-undo-tree-mode -1)) +;; (spacemacs/startup-hook) +(configuration-layer/message "Dumping Emacs...") +(setq spacemacs-dump-mode 'dumped) +(garbage-collect) diff --git a/init.el b/init.el index c2cd098e4..2fab584c8 100644 --- a/init.el +++ b/init.el @@ -33,6 +33,7 @@ (let ((file-name-handler-alist nil)) (require 'core-spacemacs) (spacemacs|unless-dumping + ;; Retoring load-path from dump file (when (boundp 'load-path-backup) (setq load-path load-path-backup))) (configuration-layer/load-lock-file) @@ -42,6 +43,7 @@ (spacemacs-buffer/display-startup-note) (spacemacs/setup-startup-hook) (spacemacs|unless-dumping + ;; these modes need to be re-enabled explicitly (global-font-lock-mode) (global-undo-tree-mode t) (winner-mode t)) @@ -51,10 +53,4 @@ (setq server-socket-dir dotspacemacs-server-socket-dir)) (unless (server-running-p) (message "Starting a server...") - (server-start))) - (spacemacs|when-dumping-strict - (setq load-path-backup load-path) - ;; disable undo-tree to prevent from segfaulting when loading the dump - (global-undo-tree-mode -1) - (setq spacemacs-dump-mode 'dumped) - (garbage-collect)))) + (server-start)))))