feat: Improve Straight.el startup time
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
/users/crumb/programs/emacs/eln-cache
|
/users/crumb/programs/emacs/eln-cache
|
||||||
|
/users/crumb/programs/emacs/auto-save-list
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
;;; early-init.el -*- lexical-binding: t; -*-
|
;;; early-init.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;; Disable package.el; we use Straight.
|
||||||
(setq package-enable-at-startup nil)
|
(setq package-enable-at-startup nil)
|
||||||
|
|||||||
@@ -1,9 +1,18 @@
|
|||||||
;;; init-straight.el -*- lexical-binding: t; -*-
|
;;; init-straight.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
(defun syd-initialise-straight-options ()
|
||||||
|
(setq
|
||||||
|
;; Improves Straight's startup time. Instead of checking for modifications
|
||||||
|
;; on init, changes will only be detected when the file is saved from within
|
||||||
|
;; Emacs (with `save-buffer', specifically!).
|
||||||
|
straight-check-for-modifications '(check-on-save find-when-checking)))
|
||||||
|
|
||||||
;; Bootstrap Straight.el
|
;; Bootstrap Straight.el
|
||||||
(defun syd-initialise-straight ()
|
(defun syd-initialise-straight ()
|
||||||
(defvar bootstrap-version)
|
(defvar bootstrap-version)
|
||||||
|
|
||||||
|
(syd-initialise-straight-options)
|
||||||
|
|
||||||
(setq straight-base-dir
|
(setq straight-base-dir
|
||||||
(or (getenv "EMACS_STRAIGHT_BASE_DIR")
|
(or (getenv "EMACS_STRAIGHT_BASE_DIR")
|
||||||
(error "Cannot initialise straight: $EMACS_STRAIGHT_BASE_DIR is undefined!")))
|
(error "Cannot initialise straight: $EMACS_STRAIGHT_BASE_DIR is undefined!")))
|
||||||
@@ -15,8 +24,7 @@
|
|||||||
(unless (file-exists-p bootstrap-file)
|
(unless (file-exists-p bootstrap-file)
|
||||||
(message "Could not find Straight's bootstrap file. Attempting to download it now.")
|
(message "Could not find Straight's bootstrap file. Attempting to download it now.")
|
||||||
(let* ((url "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el")
|
(let* ((url "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el")
|
||||||
(url-buffer (url-retrieve-synchronously
|
(url-buffer (url-retrieve-synchronously url 'silent 'inhibit-cookies)))
|
||||||
url 'silent 'inhibit-cookies)))
|
|
||||||
(with-current-buffer url-buffer
|
(with-current-buffer url-buffer
|
||||||
(goto-char (point-max))
|
(goto-char (point-max))
|
||||||
(eval-print-last-sexp))))
|
(eval-print-last-sexp))))
|
||||||
|
|||||||
Reference in New Issue
Block a user