add auto compile of elisp in packages to speed startup time
This commit is contained in:
parent
b9dc7d469b
commit
19600905e5
|
@ -13,6 +13,22 @@
|
||||||
(setq kmn/is-termux
|
(setq kmn/is-termux
|
||||||
(string-suffix-p "Android" (string-trim (shell-command-to-string "uname -a"))))
|
(string-suffix-p "Android" (string-trim (shell-command-to-string "uname -a"))))
|
||||||
|
|
||||||
|
; ensure elisp plugins are compiled
|
||||||
|
(require 'dash)
|
||||||
|
(require 'f)
|
||||||
|
|
||||||
|
(defun was-compiled-p (path)
|
||||||
|
"Does the directory at PATH contain any .elc files?"
|
||||||
|
(--any-p (f-ext? it "elc") (f-files path)))
|
||||||
|
|
||||||
|
(defun ensure-packages-compiled ()
|
||||||
|
"If any packages installed with package.el aren't compiled yet, compile them."
|
||||||
|
(--each (f-directories package-user-dir)
|
||||||
|
(unless (was-compiled-p it)
|
||||||
|
(byte-recompile-directory it 0))))
|
||||||
|
|
||||||
|
(ensure-packages-compiled)
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
; backups
|
; backups
|
||||||
(defconst kmn/backup-dir
|
(defconst kmn/backup-dir
|
||||||
|
|
20
emacs.md
20
emacs.md
|
@ -75,6 +75,7 @@ open scratch buffer. paste below into it as the contents then do `M-x ev-b RET`
|
||||||
diminish
|
diminish
|
||||||
dash
|
dash
|
||||||
s
|
s
|
||||||
|
f
|
||||||
oragami
|
oragami
|
||||||
ido-completing-read+
|
ido-completing-read+
|
||||||
dired-single
|
dired-single
|
||||||
|
@ -99,3 +100,22 @@ open scratch buffer. paste below into it as the contents then do `M-x ev-b RET`
|
||||||
(package-install p))))
|
(package-install p))))
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
speed up runtime by compiling all packages
|
||||||
|
|
||||||
|
```
|
||||||
|
(require 'dash)
|
||||||
|
(require 'f)
|
||||||
|
|
||||||
|
(defun was-compiled-p (path)
|
||||||
|
"Does the directory at PATH contain any .elc files?"
|
||||||
|
(--any-p (f-ext? it "elc") (f-files path)))
|
||||||
|
|
||||||
|
(defun ensure-packages-compiled ()
|
||||||
|
"If any packages installed with package.el aren't compiled yet, compile them."
|
||||||
|
(--each (f-directories package-user-dir)
|
||||||
|
(unless (was-compiled-p it)
|
||||||
|
(byte-recompile-directory it 0))))
|
||||||
|
|
||||||
|
(ensure-packages-compiled)
|
||||||
|
```
|
||||||
|
|
Reference in a new issue