Back to the schedule
Previous: NonGNU ELPA Update
Next: Introducing N-Angulator

Manual Package Management in The Era of Repositories - Why and How

Dhavan (codingquark)

Duration: 7:49

If you have questions and the speaker has not indicated public contact information on this page, please feel free to e-mail us at and we'll forward your question to the speaker.


Emacs now has many package repositories - enought to have conflicts and arguments about. The packages are becoming big, they depend on many other packages and it is not easy to keep track of what all is being installed in our Emacsen. An aggressive way out of this is to use Yet Another Package and install all elisp code manually - with borg1.


  • 5-10 minutes: (brief description/outline)
    1. What are we trying to solve?
    2. What is borg?
    3. How to use it?
    4. Assimilate a package for demo


Hello, my name is Dhavan, also known as codingquark! I started out learning Emacs without knowing I had to plug things in to make it work. Eventually I had to learn to set up ELPA. Since then I’ve used MELPA and Debian apt sources. Recent discussions about ELPA, NonGNU ELPA, MELPA, etc. made me reconsider what I was doing with my Emacs.

[00:00:28.590] I am not the kind of person to mindlessly ram things into my emacs. I like to ponder, to understand, to have a level of control and mindfulness about my Emacs. It is not just a matter of trying things out, it is about living an examined life as the Greeks would say; or sutta as Buddhists would say. Such an Emacs is an Emacs worth having.

[00:00:59.860] This pursuit of mine brought me to learn about borg. And I am going to share with you how to use it. I believe the approach of using borg for package management is not for everyone. It involves knowing git, it involves looking into source code and reading makefiles. Sure, anyone can learn should they be motivated so, but people have different priorities. This is what is working for me right now.

[00:01:29.056] Here is what we are going to do. We'll set up Debian, install dependencies, set up borg, install a package, and make sure it installs all the docs. Let’s get started! Would it not be amazing if we could start out with just Debian and basic tools? For borg, we need git, build-essential, and something to build docs. Nothing more!

[00:02:00.499] Now that we have the OS setup, it is time to clone what is called a “seed”. A seed will speed our process up by providing things like magit, epkg, auto-compile, etc. We will soon be using epkg and magit. The docs cover how to start without a seed, but for the purposes of a short demo, seeds are better. I started with a seed for my own dot emacs. It is fairly slim.

[00:02:32.890] As you can see, borg uses git URLs and /not/ HTTPS URLs. Make sure you have your ssh keys set up on GitHub, GitLab, etc.

[00:02:43.989] Bootstrapping is like cloning a dot emacs, but it only comes with a useful dot git submodules file. We get a Makefile that has targets like help and bootstrap-borg. There will be more targets after we finish the bootstrapping process. Then, we need to clone all the git modules, which is also done by a make target. This time, it will not just pull the git submodules, but will also run various things like auto-compilation, Info doc installation, etc. Good thing we installed texinfo earlier!

[00:04:08.282] Now that we have borg bootstrapped, let’s see how to “assimilate” a drone. Well, that’s just a borg way of saying how to install a new package. We get to work from inside Emacs now. Borg has excellent info docs, should you ever be having questions. I earlier talked about using a seed. Borg docs go into details of what that means. I encourage you to read the docs.

[00:04:40.190] Let’s try to install lsp-mode. Examining lsp-mode with epkg’s helper function, we can see details of the package, dependencies required, and so on. epkg uses sqlite database. Now you know why I installed sqlite in the OS preparation step! Well, lsp-mode has way too many dependencies for this demo. Note how one is naturally led to take a peek at the innards of the packages in this simple workflow. As I said, it is about being mindful!

[00:05:37.270] Okay, instead of lsp-mode, let’s take a look at Prot’s excellent modus-themes. No extra dependencies needed. That is perfect! The themes have great docs and our philosopher friend is good at writing. Alright, first, we clone the package. This allows us to inspect the code, should we want to. Well, you /should/. Upon inspecting the code, we ask borg to assimilate the package. This will load the code in our Emacs and make the package available for use. but where are they? To install the docs, we need to instruct borg about where to find them. To do this, we edit the gitmodules file and add the details. There they are! We have our docs! Alright, we have assimilated a package. After sufficient testing, we can commit it as a part of our own dot emacs, which is a drone of our borg collective. Since all the packages are git submodules, we get to use magit (all hail magit!) and borg’s helper functions to commit the code. Now create your own dot el file and hack away!

[00:07:38.758] So that is it. I hope you enjoyed the talk and I will be hanging out in IRC if you have any questions. Thank you, and bye.

Back to the schedule
Previous: NonGNU ELPA Update
Next: Introducing N-Angulator