dump: auto-dump emacs on load if layer list has changed
* rename core-dump.el to core-dumper.el * add function spacemacs/dump-emacs * explicitly load core-dumper.el file in init.el * asynchronously dump emacs if layer list has changed, see special buffer *spacemacs-dumper* for the output.
This commit is contained in:
parent
9ff0d967d3
commit
14b71afb42
|
@ -554,8 +554,11 @@ refreshed during the current session."
|
|||
To prevent package from being installed or uninstalled set the variable
|
||||
`spacemacs-sync-packages' to nil."
|
||||
(run-hooks 'configuration-layer-pre-load-hook)
|
||||
(dotspacemacs|call-func dotspacemacs/layers "Calling dotfile layers...")
|
||||
(spacemacs|when-dumping
|
||||
(setq changedp nil)
|
||||
(let ((layers dotspacemacs-configuration-layers))
|
||||
(dotspacemacs|call-func dotspacemacs/layers "Calling dotfile layers...")
|
||||
(setq changedp (not (equal layers dotspacemacs-configuration-layers))))
|
||||
(when changedp
|
||||
(setq dotspacemacs--configuration-layers-saved
|
||||
dotspacemacs-configuration-layers)
|
||||
(when (spacemacs-buffer//choose-banner)
|
||||
|
@ -605,7 +608,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..."))
|
||||
(dotspacemacs|call-func dotspacemacs/user-load "Calling dotfile user-load...")
|
||||
(spacemacs|unless-dumping (spacemacs/dump-emacs)))
|
||||
(run-hooks 'configuration-layer-post-load-hook))
|
||||
|
||||
(defun configuration-layer/load-auto-layer-file ()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;;; core-dump.el --- Spacemacs Core File
|
||||
;;; core-dumper.el --- Spacemacs Core File
|
||||
;;
|
||||
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
|
||||
;;
|
||||
|
@ -45,6 +45,14 @@ You should not used this function, it is reserved for some specific process."
|
|||
`(unless (eq 'dumping spacemacs-dump-mode)
|
||||
,@body))
|
||||
|
||||
(defun spacemacs/dump-emacs ()
|
||||
"Dump emacs in a subprocess."
|
||||
(let ((default-directory "~/dev/emacs/src"))
|
||||
(make-process
|
||||
:name "spacemacs-dump"
|
||||
:buffer "*spacemacs-dumper*"
|
||||
:command (list "~/dev/emacs/src/emacs" "--batch" "-l" "~/.emacs.d/dump-init.el" "-eval" "(dump-emacs-portable \"spacedump.pdmp\")"))))
|
||||
|
||||
;; ;; Brute-force load all .el files in ELPA packages
|
||||
;; (dolist (d (directory-files package-user-dir t nil 'nosort))
|
||||
;; (unless (or (string-equal ".." (substring d -2))
|
||||
|
@ -56,4 +64,4 @@ You should not used this function, it is reserved for some specific process."
|
|||
;; (message "%s" f)
|
||||
;; (ignore-errors (load f t))))))
|
||||
|
||||
(provide 'core-dump)
|
||||
(provide 'core-dumper)
|
|
@ -11,7 +11,6 @@
|
|||
(setq message-log-max 16384)
|
||||
|
||||
(require 'subr-x nil 'noerror)
|
||||
(require 'core-dump)
|
||||
(require 'core-emacs-backports)
|
||||
(require 'page-break-lines)
|
||||
(require 'core-debug)
|
||||
|
|
1
init.el
1
init.el
|
@ -20,6 +20,7 @@
|
|||
"core/core-versions.el"))
|
||||
(load-file (concat (file-name-directory load-file-name)
|
||||
"core/core-load-paths.el"))
|
||||
(load-file (concat spacemacs-core-directory "core-dumper.el"))
|
||||
|
||||
(if (not (version<= spacemacs-emacs-min-version emacs-version))
|
||||
(error (concat "Your version of Emacs (%s) is too old. "
|
||||
|
|
Loading…
Reference in New Issue