If you use use-package-always-ensure, replace it with straight-use-package-by-default.Add (straight-use-package 'use-package) after the bootstrap script.Let’s convert the existing Emacs From Scratch configuration to use straight.el instead of package.el just to show how little work it requires. While you can use both package.el and straight.el at the same time, I recommend that you only one use one of them just to make sure you don’t have any weird issues resulting from it. If you freeze newer versions of packages after running M-x straight-pull-all, you may need to run M-x straight-thaw-versions on other machines to ensure that all versions are in sync! Now when you clone your Emacs configuration to a new machine, straight.el will install the versions of packages specified in this file. If you check this file into your Emacs configuration repository, it can be shared between machines to ensure the same package versions are installed! This list contains the name of each installed package and the commit that is currently installed. This will generate a file in your Emacs configuration folder called straight/versions/default.el which contains contents like this: To generate such a lockfile, you can run the M-x straight-freeze-versions command. If you’d like to have a more consistent and repeatable configuration across multiple machines, you can create a “lockfile” which ensures that all of the packages you install are locked to specific commits of the associated repositories. ¶TIP: Using straight-use-package interactively to list packages One thing to point out: the name straight-use-package implies some connection to the use-package function but they are not related! We’ll look at how to integrate them later. Straight takes care of downloading, compiling (either byte or native compilation), and adding the package to Emacs’ load path. Straight depends on this line being in your configuration (in some form) to acknowledge that the package is installed and used! This will cause straight.el to install the package if it hasn’t been already. To install a package, you should include an expression like this for it in your init.el file: Conveniently, it uses your Emacs configuration’s init.el file for this purpose! Straight.el depends on a “source of truth” for the list of packages that should be installed and loaded. This part is a little different than what you might be familiar with from package.el. Now that we’ve installed straight.el, let’s see how to install a package with it. If straight.el is already installed, this script won’t try to download it again! You should leave it in your configuration so that it gets installed correctly on any machine where you load your Emacs configuration. You can either run this snippet directly for the first time ( eval-region, etc) or just restart Emacs to pick it up while Emacs is initializing. (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) The maintainers provide a short “bootstrapping” script which will download and configure straight.el for you.Īdd this bootstrapping snippet to your init.el file: To use the MELPA-Stable repository, update your "init.Since straight.el doesn’t come with Emacs, we need a way to make sure it can be installed without using package.el. The packages in here have been tested with the current version of Emacs. However, if the slim possibility of a package breaking is a concern, MELPA offers a stable branch of their archive that is updated less frequently. The packages from MELPA are constantly being built to check whether they are working. The MELPA website said the packages it offers are bleeding edge. This process ensures that all of the packages in MELPA are safe for the regular user to use. After that, the package has to be checked and approved by the maintainers. To submit a package, the developer must submit a pull request to the maintainers of the archive. Yes! Only a few select maintainers can add packages to the MELPA archive. If you want to learn about some simple tricks to improve your productivity in Linux, check out this article. Darkroom is available in the ELPA repository, and the mode can be easily enabled by pressing Alt + x and typing darkroom-mode in the command buffer.Ĭongratulations! You have now learned about a few useful Emacs packages that could significantly improve your productive workflow.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |