Emacs Eask 101 - Build tool

I’ve developed more than 50 elisp packages, and maintain 100 or more of them. Developing an elisp package isn’t easy for a beginner, especially for those who want to publish their package to an ELPA. e.g., GNU Elpa, NonGNU Elpa, MELPA, etc.
That’s why I use Eask to help me develop elisp packages. Therefore, in this article, I’m going to teach people how to use this tool to help you build your own elisp packages! 😄
🗨️ Trouble using Eask
Eask now has more than 50 commands (including hidden ones). The tool is fairly
complex so the first thing you need to know is to use --help
when have trouble
using this tool.
|
|
📦 Build the package
Here we jump right into the package development. I assumed you already know how to create Eask-file and want to use this tool effectively right a way.
I’m going to use an existing elisp package I’ve created openai.el just to show the workflow.
|
|
The project structure looks like this:
|
|
We first build the package with:
|
|
This command will create a folder dist
, and here is the result:
Noticed this is a multi-file package so it’s built into a tar
file. If we
inspect the tar
file, then this is the result:
⚙ Install it
Now you have created the package successfully, it means your package will have
no issue hosting on any ELPA
(GNU Elpa, MELPA, etc.).
People can download your package on the ELPA you like to host. The next step
is to test installing the package. It’s meaningless if people can download
your package but aren’t able to install it. We install the package with
the install
command:
|
|
The package is installed in an isolated environment, so it won’t create any side
effects to your personal configuration ~/.emacs.d/
. Here is the result:
📋 Activate in runtime
The activation test is simple, we normally want to check if your package will run correctly on your user’s machine.
|
|
You should see the following output:
|
|
Great! It means our package has been activated without any error! 😋
This step is generally optional, but it’s good to know if you will encounter any runtime errors!
👷 Compile it!
It’s time to compile your package! Compile step is the same as the install step.
The only difference is it won’t need to be built (eask package
) to test
to see if your package will install correctly. Therefore, compile step is very
helpful since we don’t always want to build the package for every change we
have made.
|
|
And yes, it compiles successfully without any errors! 😋
|
|
⚜️ Conclusion
These are the basic uses of Eask, but there are more things that Eask can do. Like lint your package, run tests suite, or package management, etc. But we can cover these within the next chapter.
This is the result of all the commands we have used in this article:
|
|