Add support for installing/enabling straight.el

This commit is contained in:
Arne Brasseur 2019-12-25 12:52:09 +01:00
parent abfbd9e640
commit 677cb7c21e
2 changed files with 20 additions and 0 deletions

18
.emacs
View file

@ -68,6 +68,21 @@
(symbol-name (read (current-buffer)) ))
"default"))
(defun chemacs-load-straight ()
(defvar bootstrap-version)
(let ((bootstrap-file (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun chemacs-get-emacs-profile (profile)
(cdr (assoc profile chemacs-emacs-profiles)))
@ -96,6 +111,9 @@
(setenv (car env) (cdr env)))
(chemacs-emacs-profile-key 'env))
(when (chemacs-emacs-profile-key 'straight-p)
(chemacs-load-straight))
;; Start the actual initialization
(load init-file)

View file

@ -143,6 +143,8 @@ Other things you can configure
- =env= An association list of environment variables. These will get set before
loading the profile, so they can influence the initialization, and they are
visible to any subprocesses spawned from Emacs.
- =straight-p= Enable the [Straight](https://github.com/raxod502/straight.el)
functional package manager
Store =.emacs-profile.el= together with your dotfiles. If you're not yet keeping
a version controlled directory of dotfiles, then check out