This is similar to this question but the answer there seems to be deprecated.
Let's say I'm using a layer and want hack the code of a particular package that layer is using. How do I go about it?
To better illustrate what I want to accomplish in general, I present a specific example.
I try to get the spotify layer to work, but the current master branch in the helm-spotify package uses a deprecated web API. There is a pull request to fix this and I want to try it and maybe contribute something. My problem is, that I can not get the local copy of helm-spotify to load.
What I tried was to switch to the develop branch of spacemacs:
git branch --track develop origin/develop
git checkout develop
In ~/.emacs.d/layers/spotify/packages.el
I changed from
(setq spotify-packages '(spotify helm-spotify))
To
(setq spotify-packages
'(
spotify
(helm-spotify :location local)
))
And pulled the helm-spotify repository to ~/.emacs.d/layers/spotify/local/helm-spotify
When I restart spacemacs I get
File error: Cannot open load file, no such file or directory, multi
In when I look into helm-spotify.el there is:
(require 'multi)
So my guess is, that when installing helm-spotify from melpa the dependency on multi gets resolved prior to loading helm-spotify but of course not anymore when I use a local copy of helm-spotify.
So my questions are:
- How do resolve dependencies when using a local package?
- Or should I do this completely differently from what I described?
I also tried, without success, to add multi to dotspacemacs-additional-packages and to spotify-packages:
(setq spotify-packages '(
multi ;; I added this
spotify
(helm-spotify :location local) ;; I modified here
))
;; I added this
(defun spotify/init-multi ()
(use-package multi))
;; the rest is as it was
(defun spotify/init-spotify ()
(use-package spotify
:config (spacemacs/set-leader-keys
"amsp" 'spotify-playpause
"amsn" 'spotify-next
"amsN" 'spotify-previous
"amsQ" 'spotify-quit)))
(when (configuration-layer/layer-usedp 'spacemacs-helm)
(defun spotify/init-helm-spotify ()
(use-package helm-spotify
:config (spacemacs/set-leader-keys
"amsg" 'helm-spotify))))
in packages.el. Also tried without adding multi to dotspacemacs-additional-packages.
package.el(the built-in Emacs module) doesn't really seelocal/helm-spotifyas a package. The way to resolve it is manually, and you are in the right direction. Can you add more detail how you tried to addmulti? It's not clear if you added it toadditional-packagesandspotify-packagesat the same time, or tried them separately. Havingmultiinspotify-packagesand aspotify/init-multifunction inpackages.el(without usingadditional-packages) should be enough – bmag Feb 20 '16 at 20:48recipeinstead oflocal. e.g.(helm-spotify :location (recipe <recipe specs>))– bmag Feb 20 '16 at 20:51multitodotspacemacs-additional-packageswith no success. The error is the same. I updated my question to reflect thepackages.elI'm using. Thanks for your effort! – Dimitri Schachmann Feb 20 '16 at 21:04recipeinstead oflocal(it should take care of the multi dependency for you), or move themulticonfiguration to a separate layer and make sure that layer is listed beforespotifyindotspacemacs-configuration-layers(the layer list) – bmag Feb 20 '16 at 21:40