dump: add command line parameter --force-dump

If provided on the command line then force a redump of Emacs not matter what.
This commit is contained in:
syl20bnr 2018-05-06 12:01:32 -04:00
parent af4b4df031
commit 4f75fe5e3b
2 changed files with 29 additions and 17 deletions

View File

@ -20,6 +20,9 @@
"If non-nil packages are synchronized when the configuration layer system is
loaded.")
(defvar spacemacs-force-dump nil
"If non-nil then force a redump of Emacs.")
(defun spacemacs//parse-command-line (args)
"Handle Spacemacs specific command line arguments.
The reason why we don't use the Emacs hooks for processing user defined
@ -59,6 +62,8 @@ arguments is that we want to process these arguments as soon as possible."
(setq spacemacs-force-resume-layouts t))
("--no-package-sync"
(setq spacemacs-sync-packages nil))
("--force-dump"
(setq spacemacs-force-dump t))
(_ (push arg new-args))))
(setq i (1+ i)))
(nreverse new-args)))

View File

@ -574,15 +574,34 @@ refreshed during the current session."
'(dotspacemacs-configuration-layers)
configuration-layer--last-dotspacemacs-configuration-layers-file))
(cond
(changed-since-last-dump-p (configuration-layer//load t))
((or changed-since-last-dump-p
spacemacs-force-dump)
;; dump
(configuration-layer//load)
(when (not (spacemacs-is-dumping-p))
(configuration-layer//dump-emacs)))
((and dotspacemacs-emacs-pdumper-executable-file
(spacemacs-run-from-dump-p))
;; dumped
(configuration-layer/message
"Running from a dumped file. Skipping the loading process!"))
(t (configuration-layer//load)))
(t
(configuration-layer//load)
(when dotspacemacs-emacs-pdumper-executable-file
(configuration-layer/message
(concat "Layer list has not changed since last time. "
"Skipping dumping process!")))))
(run-hooks 'configuration-layer-post-load-hook))
(defun configuration-layer//load (&optional changedp)
(defun configuration-layer//dump-emacs ()
"Dump emacs."
(configuration-layer/message
(concat "Dumping Emacs asynchronously, "
"you should not quit this Emacs "
"session until the dump is finished."))
(spacemacs/dump-emacs))
(defun configuration-layer//load ()
"Actually load the layers.
CHANGEDP non-nil means that layers list has changed since last dump
To prevent package from being installed or uninstalled set the variable
@ -634,20 +653,8 @@ To prevent package from being installed or uninstalled set the variable
(configuration-layer//configure-packages configuration-layer--used-packages)
(configuration-layer//load-layers-files configuration-layer--used-layers
'("keybindings.el"))
(dotspacemacs|call-func dotspacemacs/user-load "Calling dotfile user-load...")
(if (and changedp
(not (spacemacs-is-dumping-p))
dotspacemacs-emacs-pdumper-executable-file
(file-exists-p dotspacemacs-emacs-pdumper-executable-file))
(progn
(configuration-layer/message
(concat "Dumping Emacs asynchronously, "
"you should not quit this Emacs "
"session until the dump is finished."))
(spacemacs/dump-emacs))
(configuration-layer/message
(concat "Layer list has not changed since last time. "
"Skipping dumping process!"))))
(dotspacemacs|call-func dotspacemacs/user-load
"Calling dotfile user-load..."))
(defun configuration-layer/load-auto-layer-file ()
"Load `auto-layer.el' file"