diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2020-06-16 12:30:37 +0200 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2020-06-16 12:30:37 +0200 |
commit | 41a4f068b7478457157f05ebb0feaa531d370918 (patch) | |
tree | 7dd8f3707bc60224d01c86dd50793ca514c0749c /emacs-helm.sh | |
parent | e2c91b1247b490016965d3866ad3412bb99e7ab1 (diff) |
Avoid rebuilding packages after using emacs-helm.sh
When restarting main Emacs after using helm.sh, straight rebuild async and
maybe packages loaded with --load-packages.
So only add async to load-path and only use straight-use-package for packages
specified in --load-packages if autoload file doesn't exists, otherwise load
autoload file.
Diffstat (limited to 'emacs-helm.sh')
-rwxr-xr-x | emacs-helm.sh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/emacs-helm.sh b/emacs-helm.sh index 4c3724bc..7b886d1d 100755 --- a/emacs-helm.sh +++ b/emacs-helm.sh @@ -189,10 +189,17 @@ cat > $CONF_FILE <<EOF (when (file-exists-p bootstrap-file) (setq default-package-manager 'straight) (load bootstrap-file nil 'nomessage) - (straight-use-package 'async) + (add-to-list 'load-path async-path) (when pkg-list (dolist (pkg pkg-list) - (straight-use-package (intern pkg)))))) + (let* ((pkg-path (expand-file-name pkg straight-path)) + (autoload-file (expand-file-name + (format "%s-autoloads.el" pkg) + pkg-path))) + (add-to-list 'load-path pkg-path) + (if (file-exists-p autoload-file) + (load autoload-file nil 'nomessage) + (straight-use-package (intern pkg)))))))) (unless (eq default-package-manager 'straight) (require 'package) |