Use dynamic byte-compilation for autoload files
Very experimental! This reduces the size and overhead of autoload files slightly, but may have other reprecussions!
This commit is contained in:
parent
43c65ab628
commit
3661462a7a
1 changed files with 6 additions and 4 deletions
|
@ -46,8 +46,10 @@ init.el and config.el. Then runs `doom-reload-hook'."
|
||||||
everyone in the universe and their dog, causing errors that make babies cry. No
|
everyone in the universe and their dog, causing errors that make babies cry. No
|
||||||
one wants that.")
|
one wants that.")
|
||||||
|
|
||||||
(defun doom--byte-compile (file)
|
(defun doom--byte-compile-file (file)
|
||||||
(let ((short-name (file-name-nondirectory file)))
|
(let ((short-name (file-name-nondirectory file))
|
||||||
|
(byte-compile-dynamic t)
|
||||||
|
(byte-compile-dynamic-docstrings t))
|
||||||
(condition-case-unless-debug ex
|
(condition-case-unless-debug ex
|
||||||
(when (byte-compile-file file)
|
(when (byte-compile-file file)
|
||||||
(load (byte-compile-dest-file file) nil t)
|
(load (byte-compile-dest-file file) nil t)
|
||||||
|
@ -179,7 +181,7 @@ modified."
|
||||||
(replace-match "" t t))
|
(replace-match "" t t))
|
||||||
;; Byte compile it to give the file a chance to reveal errors.
|
;; Byte compile it to give the file a chance to reveal errors.
|
||||||
(save-buffer)
|
(save-buffer)
|
||||||
(doom--byte-compile doom-autoload-file)
|
(doom--byte-compile-file doom-autoload-file)
|
||||||
(when (and noninteractive (not (daemonp)))
|
(when (and noninteractive (not (daemonp)))
|
||||||
(doom--server-load doom-autoload-file))
|
(doom--server-load doom-autoload-file))
|
||||||
t)
|
t)
|
||||||
|
@ -244,7 +246,7 @@ This should be run whenever your `doom!' block or update your packages."
|
||||||
(goto-char (match-beginning 1))
|
(goto-char (match-beginning 1))
|
||||||
(kill-sexp))
|
(kill-sexp))
|
||||||
(print! (green "✓ Removed load-path/auto-mode-alist entries")))
|
(print! (green "✓ Removed load-path/auto-mode-alist entries")))
|
||||||
(doom--byte-compile doom-package-autoload-file)
|
(doom--byte-compile-file doom-package-autoload-file)
|
||||||
(when (and noninteractive (not (daemonp)))
|
(when (and noninteractive (not (daemonp)))
|
||||||
(doom--server-load doom-package-autoload-file))
|
(doom--server-load doom-package-autoload-file))
|
||||||
t))
|
t))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue