0

I'm trying to contrib to a project and installed cask and did cask install and now I have a .cask folder with the deps. Now in emacs how do I evaluate a .require of one of those deps? Is there a linking step that must be done to point the resolution to the .cask folder?

5
  • If the package has its dependencies properly declared,cask install should do all the setup that is necessary. Cask then builds the load-path automatically for you so that (require ...) statements resolve when you invoke cask exec. You may need to further illustrate your circumstances, to clarify how things are not as you expect. Are you interactively working on the package within emacs? You might try starting emacs using cask emacs from within the package directory to have the desired load-path or reading though github.com/cask/cask/issues/360.
    – ebpa
    Commented Mar 29, 2018 at 13:08
  • So in my case I cloned the cider project github.com/clojure-emacs/cider. Downloaded and ran cask install and I see the .cask folder. I open up the test and try to eval the (require 'buttercup) expression and it just says cannot open load file: no such file or directory, buttercup. This is mainly so I can develop with the proper indentation as that is attached to the defs of buttercup. Otherwise the indentation is the standard lisp for function calls which aligns arguments.
    – indigo0086
    Commented Mar 29, 2018 at 14:44
  • My workflow for package development is to independently install all package dependencies like that using package-install (ex: M-x package-install buttercup). You will probably discover though that buttercup is not written with an interactive use of buttercup in mind. I would recommend using cask exec (ex: cask exec buttercup -L .) to invoke buttercup so you can be confident that dependencies for your tests are properly expressed for cask.
    – ebpa
    Commented Mar 29, 2018 at 15:10
  • Thanks, I got it working with cask emacs and will look at flycheck-cask.
    – indigo0086
    Commented Mar 29, 2018 at 15:16
  • How do i mark your answer as the appropriate one @ebpa , can't seem to do that with comments?
    – indigo0086
    Commented Mar 29, 2018 at 17:32

1 Answer 1

2

If the package has its dependencies properly declared,cask install should do all the setup that is necessary. Cask then builds the load-path automatically for you so that (require ...) statements resolve when you invoke cask exec.

Interactively evaluation / development of a package with cask-installed dependencies seems to be a shortcoming of Cask. Four options that come to mind:

  1. Not rely on the cask dependency management at all during your interactive development and install the dependencies manually via package-install or your favorite package management tool. Be sure to run your tests in an isolated environment using cask exec though.
  2. Have cask build your load-path at startup and invoke cask emacs from inside the target package directory.
  3. Adjust your load path to include the target package's dependencies under .cask.
  4. Write a helper to inspect target package dependencies and install them using package-install or your favorite package management tool.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.