practicalli / spacemacs

Content for the book - Clojure Development with Spacemacs
https://practical.li/spacemacs
Creative Commons Attribution Share Alike 4.0 International
110 stars 33 forks source link

Pin a package in Spacemacs #293

Open practicalli-johnny opened 2 years ago

practicalli-johnny commented 2 years ago

Should a newly published package have an issue, an older version of the package can be pinned using a specific commit from the packages GitHub repository

Related issue: #166

Spacemacs

Add a recipe for the package to the dotspacemacs-additional-packages list in .spacemacs configuration

Visit the package repository on GitHub and search through the commit history to find a commit before the issue occurred.

(smartparens
  :location (recipe 
              :fetcher github 
              :repo "Fuco1/smartparens" 
              :commit "73b9dd0c70f381aee2da8c8b27f79019aa80dcae"))

An existing package must be moved or deleted from ~/.elisp/elpa/<emacs version>/develop directory.

Related or dependent packages may also need a recipe or at least their packages removed from the elpa directory

Doom Emacs

All of Doom's packages are pinned by default. A pinned package is a package locked to a specific commit, like so:

(package! evil :pin "e00626d9fd")

MELPA / Quelpa

Quelpa uses MELPA recipe format so it can do as well

(<package-name>
 :fetcher [git|github|gitlab|hg]
 [:url "<repo url>"]
 [:repo "github-or-gitlab-user/repo-name"]
 [:commit "commit"]
 [:branch "branch"]
 [:version-regexp "<regexp>"]
 [:files ("<file1>" ...)])

example:

(use-package smartparens
  :quelpa
  (smartparens
   :fetcher github
   :repo "Fuco1/smartparens"
   :commit "73b9dd0c70f381aee2da8c8b27f79019aa80dcae"))
practicalli-johnny commented 2 years ago

Related articles