1

At some point, I found a web page that described using Cask and Pallet to configure emacs. I got that working, and life was good. I recently upgraded my version of Cask to 0.9.0, and now I find this in cask.el:

(define-obsolete-function-alias 'cask-initialize nil "22.1"
  "In particular, I would not =require cask= in your dot.emacs
since cask is now largely a command-line tool independent of
whatever you do within emacs.  If you are calling
=cask-initialize= in your dot.emacs or harken back to the bygone
era of [[https://github.com/rdallasgray/pallet][pallet]], I'm
afraid you're on your own.")

My .emacs does indeed have (require 'cask "/path/to/cask.el") (cask-initialize))

Given that the most recent change in pallet is 6 years ago, it's clear that I've fallen behind current practices. However, when I search for things like "emacs cask without pallet", all I find is advice on how to configure emacs with cask and pallet.

I was able to get things working with

(let* ((cask-source-list '("~/.cask/cask.el" "/usr/local/share/emacs/site-lisp/cask/cask.el"))
       (cask-source (cl-find-if #'file-exists-p cask-source-list)))
  (when cask-source
    (require 'cask cask-source)
    (cask--initialize)))

(Note the double dash in the initialize call.) However, since the comment specifically advises against requiring cask, I feel this is still not current best practice.

What is the current best practice for managing packages?

I am happy with either "go to this web page, which explains it" or "add these three lines to the start of your .emacs".

If the answer is "don't use cask; use this [link here] instead", that also works, especially if there is a simple way to migrate my installed packages to the new system.

1
  • Your question may be interpreted as starting opinionated responses - however, take a look at this github.com/progfolio/elpaca, this package is already built-in into Emacs 29.
    – Ian
    Jul 13, 2023 at 8:20

1 Answer 1

0

Cask is no longer intended to be package management tool, it's more of a bundler for dependency management. Think Python virtual environments. Or for a developer to test an Emacs package with different combinations of Emacs and dependent packages, as in a CI environment. There's a known issue with respect to the docs, and they mention it in the faq.


Emacs has it's own package manager package.el. It's basic but gets the job done. The afore mentioned Elpaca is a big improvement.

El-get is a popular option and has been around a while. It uses package.el on its backend. I have no experience with it though.

use-package is a macro to help you configure and load packages in your ~/.emacs.d/init.el, and uses package.el on the backend too. It's authored by one of the Emacs maintainers, who claims it's "not a package manager".

straight.el is a package manager built on top of use-package.

leaf.el "leaf.el is yet another use-package". Reading about it, it sounds like a re-implemented use-package with similar keywords and semantics. Could be an interesting option for current users of use-package.

1
  • I personally use use-package. Simple and does what I want. I rarely need to "manage" packages. I just need them loaded and configured.
    – nega
    Jul 13, 2023 at 19:55

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.