Published 2025-10-10
tag(s): #overblown-minor-annoyances #random-thoughts #emacs
Usually when I start thinking about something like this, it means I will do it sooner or
later. It happened with moving the site to a proper server, changing my keyboard keycaps,
revisiting all my Emacs keymaps[1], and a long etc if I keep going back
in time.
In some cases it takes me a few days, in others even months...but I eventually do it.
Let's take a look at my considerations for and against use-package
.
Everyone else is using it. Which is not a minor thing: most packages provide
a use-package
declaration to install and configure them.
It abstracts away repetitive code, in particular around keymaps and bindings. Also hooks I
guess. It also helps with package dependencies and conditional loading, thanks
to :after
, :if
, etc.
And finally, probably the biggest selling point, it makes lazy-loading of packages the default experience.
When I moved my configuration to use-package
, I expected it to become shorter or
more "compact". But I remember once I was done, I didn't feel like my init file was much
different. If anything, it read a bit more cluttered.[2]
I recall I even considered reverting all the changes, but figured I would give it some time.
use-package
abstracts away a lot of repetitive code, as with any abstraction,
sometimes you have to really think about what happens under the covers to understand why
something works/doesn't work.
And some newer keymaps macros and functions don't work directly in use-package
yet. I figure support will be added very soon, and that those kind of "core" changes aren't
common, but still.
We have to normalize things being "because I feel this way about it".
These aren't objective reasons. They might be wrong, and eventually I read something that
makes me reconsider. They might only apply to my use cases. Or maybe is just a matter of taste
about code and style.
In any case, I am open to feedback about them! :)[3]
The network effect of use-package
is not very relevant to me lately, as I only
have installed about 4 external packages.
I've read a few times people suggesting their init file is more organized
with use-package
, but I find that mine is about the same. I used to organize the
packages alphabetically...and I still do.
I think I would lean into splitting my config into smaller files, maybe, which is orthogonal
to use-package
.[4]
And finally, the big one. Lazy loading helps with init times, which should matter to me, since
my work laptop runs Windows. 🙄
Except that I start Emacs once in a while, and I am more bothered by some features that don't
work right away. Example, I try to find-file
using TRAMP syntax, but TRAMP isn't
loaded.
I mean, I have to fix my config to load it, but this case in particular, I am not calling any
command or binding. So a simple (require 'tramp)
in my init would work.
And once I go down that line of thinking, I figure, why not change this or that other block
too to be just a couple function calls and keymap-set
...and well, here I am,
arguing for changing everything.
Combined to also feeling that I'd rather wait 2, 3 or 10 seconds more once,
than have a little stutter when I invoke something in a package that wasn't loaded yet. And
yes, this mostly applies to my work laptop, but I am not maintaining two sets of
configs.[5]
For a while now I've been wary of the sins we developers commit in the name of not repeating
code, or to reduce our typing effort.
You know what? I will take some repetition and boilerplate, if it means the code is more
straightforward to reason about.
Up to what point, you might ask? When is too much repetition worse than an abstraction?
And I say...I don't know, it depends on the case :)
Which is another thing I have been thinking about (and maybe will write about) for a couple
months now: let's embrace "it depends". Not everything needs a hard rule or to be applied
consistently. It's OK to adjust to the circumstances, or to change your stance based on some
parameters.
And when is it "adjusting your stance to the circumstances", and when is it "you are just an
inconsistent mess"? Well...it depends. =P
use-package
-style blocks.use-package
this very weekend. Forecast
says it will be rainy ;)