reddit / emacs

Download packages without fetching repositories when using Straight*

flyin1501 · 2022-06-13 23:26
flyin1501 · 2022-06-13 23:32
If you use straight, installing packages with a large repository (like protobuf-mode) might sometimes be a hassle. While this is not a true solution that keeps track of the package with Straight as usual, it is actually possible to just use package.el together with Straight. For example, this should just work: (require 'straight) (require 'package) (package-install 'corfu-terminal) (package-activate 'corfu-terminal) (straight-use-package 'corfu) (global-corfu-mode) (corfu-terminal-mode)
nv-elisp · 2022-06-14 03:42
I wouldn't recommend this. Straight wasn't designed to work in conjunction with package.el. How long does the repo you mention typically take to download?
flyin1501 · 2022-06-14 05:12
- The example I keep using, protobuf-mode, is 32MiB when unzipped (so the cloned repository is probably about double that with depth = 1), so maybe half a minute (my internet speed is 1MiB/s at best); it will still be the largest package just because that's the whole protobuf repository. - I left this out, but this also is a way to work around ~~Straight not yet having NonGNU ELPA support~~. While this is not a supported use case, and if things break it's all on me, for me it is a worthwhile option to save a significant amount of space when I'm not worried about easy contribution to particular packages. Straight wasn't designed for it, but it doesn't conflict with package.el either. (straight-package-neutering-mode simply stops package.el (and Customize) from messing with the init file.) Straight of course does not have a streamlined workflow for doing this, but I can make that myself. I'm still surprised that it works, but I also don't see why this would stop working, other than potential issues with package.el installing an already-present dependency, which I can work around.
nv-elisp · 2022-06-15 00:48
> Straight not yet having NonGNU ELPA support. Added today. Testing is appreciated.
flyin1501 · 2022-06-15 09:50
Oh wow, thank you! Will do.