dump: save dump files in .cache/dumps directory

This commit is contained in:
syl20bnr 2018-05-08 00:58:12 -04:00
parent 3fa3311985
commit 583630df1b
4 changed files with 27 additions and 24 deletions

View File

@ -80,12 +80,11 @@ in the dump."
;; (default nil)
dotspacemacs-emacs-pdumper-executable-file nil
;; File path of Spacemacs dump file. This is the file created by the portable
;; dumper. To load it when starting Emacs add the parameter `--dump-file'
;; Name of the Spacemacs dump file. This is the file will be created by the
;; portable dumper in the cache directory under dumps sub-directory.
;; To load it when starting Emacs add the parameter `--dump-file'
;; when invoking Emacs 27.1 executable on the command line, for instance:
;; ./emacs --dump-file=spacemacs.pdump
;; If the file path is relative, it will be relative to the directory pointed
;; by `dotspacemacs-emacs-pdumper-executable-file'.
;; ./emacs --dump-file=/Users/sylvain/.emacs.d/.cache/dumps/spacemacs.pdmp
;; (default spacemacs.pdmp)
dotspacemacs-emacs-dumper-dump-file "spacemacs.pdmp"))
#+END_SRC
@ -106,7 +105,7 @@ To actually start Spacemacs with the compiled Emacs 27.1 and the Spacemacs dump,
on the command line in the =src= directory of the cloned Emacs source:
#+BEGIN_SRC shell
./emacs --dump-file=spacemacs.pdmp &
./emacs --dump-file=/Users/sylvain/.emacs.d/.cache/dumps/spacemacs.pdmp &
#+END_SRC
*** Report issues
@ -125,7 +124,7 @@ To use the created dump file, open a shell in the =src= directory of the cloned
Emacs source and type:
#+BEGIN_SRC shell
./emacs --dump-file=spacemacs.pdmp &
./emacs --dump-file=/Users/sylvain/.emacs.d/.cache/dumps/spacemacs.pdmp &
#+END_SRC
=spacemacs.pdmp= corresponds the value of the variable

View File

@ -61,12 +61,11 @@ for the portable dumper (this is currently the branch pdumper).
If nil then automatic dump of emacs is disabled.")
(defvar dotspacemacs-emacs-dumper-dump-file "spacemacs.pdmp"
"File path of Spacemacs dump file. This is the file created by the portable
dumper. To load it when starting Emacs add the parameter `--dump-file'
"Name of the Spacemacs dump file. This is the file will be created by the
portable dumper in the cache directory under dumps sub-directory.
To load it when starting Emacs add the parameter `--dump-file'
when invoking Emacs 27.1 executable on the command line, for instance:
./emacs --dump-file=spacemacs.pdump
If the file path is relative, it will be relative to the directory pointed
by `dotspacemacs-emacs-pdumper-executable-file'.")
./emacs --dump-file=/Users/sylvain/.emacs.d/.cache/dumps/spacemacs.pdmp")
(defvar dotspacemacs-gc-cons '(100000000 0.1)
"Set `gc-cons-threshold' and `gc-cons-percentage' when startup finishes.

View File

@ -12,6 +12,9 @@
(defvar spacemacs-dump-mode 'not-dumped
"Spacemacs dump mode, can be `not-dumped', `dumped' or `dumping'.")
(defconst spacemacs-dump-directory
(concat spacemacs-cache-directory "dumps/"))
(defun spacemacs/defer ()
"Return non-nil if dump is not supported."
(eq 'not-dumped spacemacs-dump-mode))
@ -58,15 +61,18 @@ You should not used this function, it is reserved for some specific process."
"Dump emacs in a subprocess."
(let ((default-directory (file-name-directory
dotspacemacs-emacs-pdumper-executable-file)))
(make-directory spacemacs-dump-directory t)
(make-process
:name "spacemacs-dumper"
:buffer "*spacemacs-dumper*"
:command (list dotspacemacs-emacs-pdumper-executable-file
"--batch"
"-l" "~/.emacs.d/dump-init.el"
"-eval" (concat "(dump-emacs-portable \""
dotspacemacs-emacs-dumper-dump-file
"\")")))))
:command
(list dotspacemacs-emacs-pdumper-executable-file
"--batch"
"-l" "~/.emacs.d/dump-init.el"
"-eval" (concat "(dump-emacs-portable \""
(concat spacemacs-dump-directory
dotspacemacs-emacs-dumper-dump-file)
"\")")))))
;; ;; Brute-force load all .el files in ELPA packages
;; (dolist (d (directory-files package-user-dir t nil 'nosort))

View File

@ -449,13 +449,12 @@ in the dump."
;; (default nil)
dotspacemacs-emacs-pdumper-executable-file nil
;; File path of Spacemacs dump file. This is the file created by the portable
;; dumper. To load it when starting Emacs add the parameter `--dump-file'
;; Name of the Spacemacs dump file. This is the file will be created by the
;; portable dumper in the cache directory under dumps sub-directory.
;; To load it when starting Emacs add the parameter `--dump-file'
;; when invoking Emacs 27.1 executable on the command line, for instance:
;; ./emacs --dump-file=spacedump.pdump
;; If the file path is relative, it will be relative to the directory pointed
;; by `dotspacemacs-emacs-pdumper-executable-file'.
;; (default spacedump.pdmp)
;; ./emacs --dump-file=~/.emacs.d/.cache/dumps/spacedump.pdmp
;; (default spacemacs.pdmp)
dotspacemacs-emacs-dumper-dump-file "spacemacs.pdmp"))
(defun dotspacemacs/user-config ()