emacsrepositorymelpa

How should I work with MELPA and MELPA-stable using Emacs?


I often run into a problem when I install packages with Emacs: what can I do if one of the packages is broken in melpa and the other is broken in melpa-stable? For example if I use melpa-stable elscreen fails on startup:

run-hooks: Symbol's function definition is void: elscreen-start

but if I run on melpa elscreen works but cider-nrepl fails to start up. I checked their github profile and their build is currently failing. Is there a way to work around this?


Solution

  • You can use both melpa and melpa-stable, and pin certain packages to certain repositories by customizing package-pin-packages:

    (require 'package)
    
    (add-to-list 'package-archives
             '("melpa-stable" . "http://stable.melpa.org/packages/") t)
    (add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/") t)
    
    (setq package-pinned-packages
          '((imenu-anywhere . "melpa-stable")
            (spaceline . "melpa-stable")
            (clj-refactor . "melpa-stable")
            (cider . "melpa-stable")
            (clojure-mode . "melpa-stable")
            (linum-relative . "melpa-stable")
            (aggressive-indent . "melpa-stable")
            (evil-leader . "melpa-stable")
            (evil-visualstart . "melpa-stable")
            (evil-jumper . "melpa-stable")
            (evil-snipe . "melpa-stable")
            (evil . "melpa-stable")
            (evil-commentary . "melpa-stable")))