diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2020-06-16 09:24:28 +0200 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2020-06-16 09:24:28 +0200 |
commit | 55035b3041001957f6593a7255c03b14e90745dc (patch) | |
tree | 5e55dbfbf219ce4e15c9567620496368b4d106f7 /emacs-helm.sh | |
parent | 22873693e3719269ab14f2b53b4a2d16d4a88fcc (diff) |
Handle Straight user config
Make was not working with async installed in Straight, and emacs-helm.sh as
well.
In Makefile try to find Straight build directory and add it to LOAD-PATH if
found.
Same for emacs-helm.sh and don't use package.el if straight directory is
found.
Now Helm compile with async installed with Straight and emacs-helm.sh is
working with no extra config.
Diffstat (limited to 'emacs-helm.sh')
-rwxr-xr-x | emacs-helm.sh | 50 |
1 files changed, 27 insertions, 23 deletions
diff --git a/emacs-helm.sh b/emacs-helm.sh index 6edbf7c5..52aa10be 100755 --- a/emacs-helm.sh +++ b/emacs-helm.sh @@ -175,32 +175,36 @@ cat > $CONF_FILE <<EOF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\\n\\n")) (setq load-path (quote $LOAD_PATH)) -(require 'package) -;; User may be using a non standard \`package-user-dir'. -;; Modify \`package-directory-list' instead of \`package-user-dir' -;; in case the user starts Helm from a non-ELPA installation. -(unless (file-equal-p package-user-dir (locate-user-emacs-file "elpa")) - (add-to-list 'package-directory-list (directory-file-name - (file-name-directory - (directory-file-name default-directory))))) - -(let* ((str-lst "$LOAD_PACKAGES") - (load-packages (and str-lst - (not (string= str-lst "")) - (split-string str-lst ",")))) - (setq package-load-list - (if (equal load-packages '("all")) - '(all) - (append '((helm-core t) (helm t) (async t) (popup t)) - (mapcar (lambda (p) (list (intern p) t)) load-packages))))) - -(package-initialize) -(add-to-list 'load-path (file-name-directory (file-truename "$0"))) - -(let ((async-path (expand-file-name "straight/repos/async" user-emacs-directory))) +(defvar default-package-manager nil) +(let ((async-path (expand-file-name "straight/build/async" user-emacs-directory))) (when (file-directory-p async-path) + (setq default-package-manager 'straight) (add-to-list 'load-path async-path))) +(unless (eq default-package-manager 'straight) + (require 'package) + ;; User may be using a non standard \`package-user-dir'. + ;; Modify \`package-directory-list' instead of \`package-user-dir' + ;; in case the user starts Helm from a non-ELPA installation. + (unless (file-equal-p package-user-dir (locate-user-emacs-file "elpa")) + (add-to-list 'package-directory-list (directory-file-name + (file-name-directory + (directory-file-name default-directory))))) + + (let* ((str-lst "$LOAD_PACKAGES") + (load-packages (and str-lst + (not (string= str-lst "")) + (split-string str-lst ",")))) + (setq package-load-list + (if (equal load-packages '("all")) + '(all) + (append '((helm-core t) (helm t) (async t) (popup t)) + (mapcar (lambda (p) (list (intern p) t)) load-packages))))) + + (package-initialize)) + +(add-to-list 'load-path (file-name-directory (file-truename "$0"))) + (unless (> $TOOLBARS 0) (setq default-frame-alist '((vertical-scroll-bars . nil) (tool-bar-lines . 0) |