summaryrefslogtreecommitdiff
path: root/emacs-helm.sh
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2020-06-16 10:35:18 +0200
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2020-06-16 10:35:18 +0200
commite2c91b1247b490016965d3866ad3412bb99e7ab1 (patch)
tree4c8ea55c1f38399ea529b98bfcb185dc753361f5 /emacs-helm.sh
parent55035b3041001957f6593a7255c03b14e90745dc (diff)
Fix emacs-helm.sh --load-packages option with straight
When straight is available use it to load packages specified with --load-packages.
Diffstat (limited to 'emacs-helm.sh')
-rwxr-xr-xemacs-helm.sh19
1 files changed, 16 insertions, 3 deletions
diff --git a/emacs-helm.sh b/emacs-helm.sh
index 52aa10be..4c3724bc 100755
--- a/emacs-helm.sh
+++ b/emacs-helm.sh
@@ -175,11 +175,24 @@ cat > $CONF_FILE <<EOF
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\\n\\n"))
(setq load-path (quote $LOAD_PATH))
+
(defvar default-package-manager nil)
-(let ((async-path (expand-file-name "straight/build/async" user-emacs-directory)))
- (when (file-directory-p async-path)
+(let* ((packages "$LOAD_PACKAGES")
+ (pkg-list (and packages
+ (not (equal packages ""))
+ (split-string packages ",")))
+ (straight-path (expand-file-name "straight/build/" user-emacs-directory))
+ (async-path (expand-file-name "straight/build/async" user-emacs-directory))
+ (bootstrap-file
+ (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
+ (bootstrap-version 5))
+ (when (file-exists-p bootstrap-file)
(setq default-package-manager 'straight)
- (add-to-list 'load-path async-path)))
+ (load bootstrap-file nil 'nomessage)
+ (straight-use-package 'async)
+ (when pkg-list
+ (dolist (pkg pkg-list)
+ (straight-use-package (intern pkg))))))
(unless (eq default-package-manager 'straight)
(require 'package)