The value of Emacs pre-made configurations
I was watching this video on the System Crafter's YouTube channel during which he considers whether or not using a pre-made Emacs config is a good thing. He has several good points on both the pros and cons sides of things. I won't mention all of them, you should go watch the video for that, but here are a few things that resonated with me.
Pros
Makes getting started easier. I know from experience, configuring Emacs to do cool stuff can be a bit of a daunting challenge when first starting. I've been using Emacs for a number of years, hand-coding my configuration and trying to get it to do the cool things I saw others doing on various videos. Now it is something I enjoy a bit more, but I eventually ditched my hand-coded configuration and went with a pre-built config for a while (more on this in a moment). Things worked out of the box in a nice clean way. So, even though I “started” kind of in the middle of my experience, this reasoning makes sense to me.
Better integration between different packages. If there is one thing I have struggled with and have seen in posts on reddit and stackoverflow, its the many ways to do really common things, like completion (ac or company?), fuzzy stuff (ivy, helm, consult, selectrum, counsel…??), language tools for software development (slime, sly, lsp… ???). A lot of the pre-built configurations just make decisions on these and then make them work.
Often there are more learning resources. Yes. In the cases I've reviewed (and by reviewed, I mean the ones whose documentation I read when I was deciding which one might be most to my way of thinking and working), there has been fairly good to amazingly good documentation. The approach is usually how to work with the configuration to make the smallest changes needed to make it “yours” and leave the rest alone. Each claims to provide sane defaults, which I find largely to be true for some definition of sane.
Cons
It might convince you that vanilla Emacs is too hard to use. The idea here lines up with the next one. Basically, if you look at the code base for most of the pre-made configurations, they are not small. So, it may lead you to believe this is the minimal viable source needed to actually configure Emacs to be usable. This is not true. A good friend of mine has been using Emacs for a number of years and his configuration is very short. He doesn't configure a lot of the whiz-bang features so popular in other IDEs, editors or even within Emacs itself. Works fine for him. Emacs, without any configuration or additional packages is still a very powerful tool. It just depends on what you are used to and what your expectations are. The more “things” you expect Emacs to do, the more you need to do to configure Emacs to work that way.
Specialized configurations can make things more confusing. One of the arguments both for and against using a pre-made configuration is that it gives you a way to see how someone else put things together so you can learn from it and then, eventually, write your own. But trying to read the code for some of the pre-made configurations can be just like those tween choose-your-own adventure books from the 1980's. Trying to understand why something works in that configuration but not so much when you try to write it in your own custom configuration can be confusing. It definitely requires you to learn a lot, but can lead to enough frustration to rage-quit from time to time. Additionally, you need things like a pre-made configuration provides to easily navigate through a call stack in source code when you are reading it.
My journey
I started using Emacs a long time ago, I was fascinated by the Lisp family of languages and thought using Emacs would help me learn and use that particular language. While that is absolutely true, Emacs Lisp is just another dialect and knowing it is not the same as knowing Common Lisp or Scheme. But I digress.
I was also very interested in how productive people were when using Emacs and I wanted to that for myself as well. I did learn enough Emacs Lisp to sort-of make things kinda work and I was generally happy with most of my work flow being in Emacs and jumping out to other tools for more hard-core editing. I just kept coming back to Emacs because I found myself more comfortable here.
I started with Prelude
I really wanted some of the features I'd seen in other IDEs and editors, and so I researched a few of the pre-built configurations and settled on prelude by the venerable Bozhidar Batsov. It should be noted, at the time I was looking, there weren't that many pre-built configurations. Spacemacs was around, I think Doom Emacs was just getting traction, the Emacs Starter Kit existed… those are the ones I recall reviewing. I didn't do an exhaustive search, so there might have been others. I chose prelude
because I wanted something as close to vanilla Emacs as possible and something whose code I could use as an example to learn from. I didn't want Vi in Emacs, I can use Vi if I really want that experience, so nothing against Vi, just not what I wanted to use. I didn't want a bunch of hijacking macros around things like package.el
. And I didn't want a literate configuration. Org mode is super cool, and I definitely find it to be one of the most useful packages I use, but I wanted my configuration to be straight code. I can write comments in my code just as well as writing text around code snippets, and with hide-show-mode
I can collapse things if I want to. I wanted to be able to use the existing features of Emacs and maybe a few well integrated packages. I got that from prelude
.
And then I wrote my own
After using it for a while, and learning from how it was written, I wrote my own configuration. I setup how my configuration was organized in much the same way that prelude
did it, although without quite the same level of sophistication. My only complaint was the 19 seconds it took to startup. That was something I just thought I'd have to live with in the post-prelude world.
And then I did it again
I started seeing a lot of people moving their configuration to use-package most often citing the simplicity of configuration and the speed at which Emacs was starting. So, I took the plunge and rewrote my entire configuration using use-package
to install, load and configure the packages I was using. For fun, I went back to using prelude
, reconfigured a few things, and got my start time to around 4 seconds which compares favorably with my current configuration that starts in just over 2 seconds. Slow by some people's standard, but I start it in daemon mode and the use emacsclient
so I don't keep starting/restarting Emacs, and starting emacsclient
is nearly instantaneous. Still, I think there are a few things I could tweak a bit to get the prelude
version to start faster and shave off a couple (or more) of those seconds.
So those pre-made configurations have value
From my experience, I learned a lot from starting over with my configuration by using prelude
and then growing back into a personal configuration heavily inspired by how prelude
is written. I have also looked at the source for Spacemacs and Doom Emacs and even Emacs Starter Kit and there is a lot to learn from those as well. I think the “pros” they provide out weigh the “cons” enough to recommend them. I would suggest identifying what you would want from Emacs, then reviewing the goals and source code for several pre-built configurations before just jumping on one and being frustrated that it doesn't do feature x in some way you think it should. Try looking on the Emacs Wiki for a list of pre-made configurations that might make sense to you.
And Bozhidar, if you happen to come across this page, thank you very much for your work on Prelude. I've learned a lot.
Tags: #emacs