Cask Domain Specific Language

This document provides a reference on the DSL.

Package metadata

Function package name version description

Declare a package with the given name, version and description:

(package "ecukes" "0.2.1" "Cucumber for Emacs.")

All arguments are strings. The version must be a version understood by Emacs’ built-in version-to-list.

Function package-file file

Declare a package by taking the package metadata from the given file. Relative filenames are relative to the directory of the Cask file.

The package name will be the name of the given file, sans directory and extension. The description is taken from the very first line of file. The version and the run-time dependencies are taken from the library headers of file. See Library Headers(elisp) for details about library headers

Function package-descriptor file

Declare all package metadata directly by specifying a package descriptor contained in file with name given by file

See Multi-file Packages for examples on defining packages with the define-package function.

Package contents

Function files &rest patterns

The files to include in the package built by cask package. The patterns have the same format as the :files in an MELPA recipe, as Cask uses the same library to build packages.

Each pattern in patterns is either a simple glob pattern as string or an expression (target pattern...). In the former case, all files matching the pattern (relative to the directory of the Cask file) are included at the top-level of the package. :defaults may be used as the first pattern to explicitly include the default patterns. This allows subsequent patterns to append to the defaults.

In the latter case, target is the unqualified target directory within the package, each pattern describes the contents of the package under the target directory recursively.

Hence, the pattern (“*.el” (“resources” (“snippets” “*.snippet”))) would include all .el files from the project root in the package root, and all .snippet files from the project root in the directory resources/snippets under the package root.


Function depends-on package-name &optional minimum-version
Function depends-on package-name :fetcher repourl &optional :ref hash :branch name :files patterns

Specify a dependency of this package.

package-name is the name of a package which is a dependency of this package.

In the first variant, install the package from a package archive (see source), optionally requiring a minimum-version.

In the second variant, install the package from a VCS repository. Replace fetcher with any of the following: :git, :bzr, :hg, :darcs, :svn or :cvs. repourl is the repository URL to install the package from.

ref and branch specify the commit hash or branch name to install from. If both are omitted, default to the master branch.

files gives the files from the repository to include in the package, in the same format as files. If omitted, try to take the files from the Cask file of the repository.

Function development &rest body

Scope all depends-on expressions in body to development.

Development dependencies are installed with cask install, but are not included in package descriptors generated by cask pkg-file and cask package.

Function source alias
Function source name url

Add a package archive to install dependencies from.

In the first variant, add a built-in package archive. In the second variant, add a package archive with the given name, and the given url.

Cask includes the following built-in package archives:


The standard GNU ELPA archive at


Unlike an interactive Emacs, Cask does not enable any archive by default. Hence, you must explicitly add the gnu archive if you need it.

An archive of stable versions built automatically from upstream repositories, at
An archive of VCS snapshots built automatically from upstream repositories, at
An archive of packages uploaded by users and maintainers, at
An archive providing packages for Sunrise Commander, at

An archive providing packages for Org Mode, at

Note that unlike the gnu archive, which also provides an org package, this archive provides the org-plus-contrib package, which installs additional extensions for Org Mode maintained by the Org Mode maintainers, which are not included in the standard gnu packages for copyright reasons.