[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/helm ff4cd0ebc8 2/3: Try to fix emacs-helm.sh with exotic
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/helm ff4cd0ebc8 2/3: Try to fix emacs-helm.sh with exotic emacs packages installations |
Date: |
Tue, 16 Aug 2022 06:58:36 -0400 (EDT) |
branch: elpa/helm
commit ff4cd0ebc87355c35c667a7409ecc65b18632ffe
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>
Try to fix emacs-helm.sh with exotic emacs packages installations
May fail in some unexpected conditions where async is installed
manually in an unknow place and helm is installed from package and
vice versa.
---
emacs-helm.sh | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/emacs-helm.sh b/emacs-helm.sh
index c3020ea8bd..23bfdf7d58 100755
--- a/emacs-helm.sh
+++ b/emacs-helm.sh
@@ -177,15 +177,22 @@ cat > $CONF_FILE <<EOF
(setq load-path (quote $LOAD_PATH))
(defvar default-package-manager nil)
+;; /home/you/.emacs.d/.local/straight/build-27.1/helm
+(defvar initial-package-directory (file-name-directory (file-truename "$0")))
+
(defvar bootstrap-version)
(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))
+ ;; /home/you/.emacs.d/.local/straight/build-27.1
+ (straight-path (file-name-directory (directory-file-name
initial-package-directory)))
+ ;; /home/you/.emacs.d/.local/straight/build-27.1/async
+ (async-path (expand-file-name "async" straight-path))
+ ;; /home/you/.emacs.d/.local/straight/repos/straight.el/bootstrap.el
(bootstrap-file
- (expand-file-name "straight/repos/straight.el/bootstrap.el"
user-emacs-directory))
+ (expand-file-name "repos/straight.el/bootstrap.el"
+ (file-name-directory (directory-file-name
straight-path))))
(bootstrap-version 5))
(when (file-exists-p bootstrap-file)
(setq default-package-manager 'straight)
@@ -208,9 +215,12 @@ cat > $CONF_FILE <<EOF
;; 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"))
+ ;; Something like /home/you/.emacs.d/somedir/else/elpa/
+ ;; starting from default-directory is wrong in case helm.sh is a symlink
+ ;; or e.g. helm --chdir foo have been used.
(add-to-list 'package-directory-list (directory-file-name
(file-name-directory
- (directory-file-name
default-directory)))))
+ (directory-file-name
initial-package-directory)))))
(let* ((str-lst "$LOAD_PACKAGES")
(load-packages (and str-lst
@@ -224,7 +234,7 @@ cat > $CONF_FILE <<EOF
(package-initialize))
-(add-to-list 'load-path (file-name-directory (file-truename "$0")))
+(add-to-list 'load-path initial-package-directory)
(unless (> $TOOLBARS 0)
(setq default-frame-alist '((vertical-scroll-bars . nil)