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.
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.
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.
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!
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.
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.
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!
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.
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!
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.
Wait, I was praising all the docs,
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!
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.