sqrtminusone.github.io/content/posts/2023-04-14-emacs.md

14 KiB

+++ title = "900 days of Emacs" author = ["Pavel Korytov"] date = 2023-02-02 tags = ["emacs"] draft = true scripts = ["/js/chart.js", "/js/chartjs-adapter-date-fns.bundle.min.js", "/js/chartjs-plugin-datalabels.js", "/js/2023-04-14-emacs.js"] +++

Poof I made my free-time disappear

- Ellis Kenyő, on being called an "elisp mage"

Little did I know when on the fateful day of [2020-10-09 Fri] I had installed GNU Emacs. I wasn't thinking about the ethical aspects of free software, aesthetics of Lisp, or these other things with which an occasional layperson explains to him or herself how an almost half a century old program can still be in active use.

In fact, when considering using software X for anything, the most important question to me was: can X provide a better user experience? For Emacs, the answer to most of these questions turned out to be yes.

So, over that time, Emacs has become my programming environment, email client, window manager, knowledge base and a lot more. I think I ended up using Emacs for almost as many things as possible; I have even authored a few packages that implement certain parts of my workflows that weren't readily available.

Among other things, the Emacs community is responsible for my introduction to Zettelkasten, RSS, Lisps... Perhaps even my English became slightly less broken because Emacs is so text-centered. Indeed, a lot has changed over the course of these short 2.5 years.

Anyway, this post is an attempt at quantifying some aspects of that story. The numbers mostly come from projects called ActivityWatch and WakaTime.

Mostly I'm curious myself, but also every now and then I see Emacs people discussing their journeys through the Elisp-land, or a potential convert wondering whether this rabbit hole is worth investigating. If any of this applies to you, you might find something interesting in this document.

Everything goes into Emacs

As I said, I use Emacs for a lot of things, which is described in my Emacs config in more detail. Fig. 1 shows how Emacs was replacing various programs over time.

Also, unfortunately this post turned out to be rather inaccessible for those reading that with a screen-reader. I guess, if that applies to you, just mentally skip the figure references.

I did try to describe what's going on in these in the post body.

As you can see, I used Neovim for a bit more than a year. We'll get into some numbers on that later.

And it took me about 13 months to move from knowing nothing about Emacs to using EXWM.

Fig. 2 shows the dynamics of the direct screen time ratio spent in Emacs per each month, i.e. how many non-AFK seconds the Emacs window was active on average.

It's hard to distinguish any general trend here. It seems like the ratio started at 0.2 in October 2020, was oscillating around 0.3 for about 7 months, then moved closer to 0.4 until January 2023, after which jumped to 0.45-0.5.

The three peaks in September 2021 (0.526), January 2022 (0.532) and August 2022 (0.568) may match my vacations, in which I didn't have to spend time in Chrome DevTools (I do web development as my "main" job), but I'm not sure about that.

The jump is January 2023 definitely matches my adoption of telega.el instead of the official desktop client. The time redistributes rather cleanly in the detailed ActivityWatch data.

It's also interesting that switch from i3 to EXWM didn't seem to have any particularly distinguishable effects.

The mean Emacs screen time ratios are 0.39 since October 2020 and 0.47 since January 2023. So, as you might infer, Emacs is quite prominent in my PC usage.

Time spent in Emacs

Now let's turn to the structure of time spent in Emacs. Fig. 3 shows how many Emacs-hours per month I spent on what, Fig. 4 shows the same in the stacked form.

Contrary to Fig. 2, the time here is calculated with a 15-minute timeout preference, like it's done in WakaTime. For instance, if I do something in a project in Emacs for 10 minutes, then switch to something else for 10 minutes (i.e. no heartbeats in that time), then switch back to the project for 10 more minutes, this will be accounted as 30 minutes in that project.

This is mostly so because that's the default format of the WakaTime export, but I also think that's reasonable, because I may open package documentation during configuration, experiment in scratch buffers while working on a package, etc. This time really has to be included in the final tally.

Of course, this will also include all the times I was distracted to the System Crafters Discord server, emacs.ch (a Mastodon instance), or whatever else. So treat the numbers below as an upper bound.

The categories are as follows:

  • Config ([REDACTED] total hours, [REDACTED]% of all time)
    Time spent on the actual Emacs configuration.
  • Emacs Packages ([REDACTED] total hours, [REDACTED]% of all time)
    Time spent in other Emacs Lisp files, i.e. writing my packages or debugging other packages. See the packages section.
  • Org Mode ([REDACTED] total hours, [REDACTED]% of all time)
    Time spent in my org-mode project, which is mostly org-journal, org-roam and project management. By the way, guess the month in which I read Sönke Ahrens' book about Zettelkasten.
  • sqrtminusone.xyz ([REDACTED] total hours, [REDACTED]% of all time)
    Time spent doing something with this strange website.
  • Other Code ([REDACTED] total hours, [REDACTED]% of all time)
    Doing something marginally useful in Emacs, which is mostly work, education and a few personal projects that aren't related to Emacs.
  • Misc ([REDACTED] total hours, [REDACTED]% of all time) Time spent in Emacs but not in an actual project (i.e. accounted by the window watcher of ActivityWatch but not WakaTime, which watches for files). These are things like reading RSS, writing emails, using messengers, doing some idle experimentation in scratch buffers, etc.

[REDACTED]% of time spent to configuration is actually less than I expected. Unsurprisingly, the first month has the highest value of about 20% (I used Emacs without WakaTime for a few days).

By the way, I spent just 39.0 hours configuring Neovim, although the number is probably not representative anymore because Neovim changed a lot over these 2 years.

Switching from Neovim

The period of my switching from Neovim to Emacs seems particularly interesting. Fig 5 zooms in on that; the switch is represented by "Other Code (Emacs)" replacing "Other Code (Vim)".

It seems like getting from zero to somewhat productive took me about 11.1 hours over 4 days of just playing with Emacs, and one day with 3.8 hours on configuring and 4.4 hours on coding, apparently alternating between the two.

Configuration

Now, let's see where these [REDACTED] hours went into.

Configuration sizes are a fairly common topic in Emacs discussions. I'd guess mine falls into the category of the longest, although maybe I'll do some research on that one day. Fig. 6 shows how my config size changed over time.

So, my Emacs.org is [REDACTED] lines long, and the resulting init.el is [REDACTED] lines long.

As you can see, I switched to literate configuration pretty early on; so far I didn't regret it. It's also interesting how the two sizes diverged as I was writing more elaborate commentary.

I also never had any substantial issues with maintaining that configuration. Perhaps Emacs Bankruptcies are just not that common nowadays.

For the sake of completeness, let's compare that to my Neovim usage. Fig. 7 shows the config size dynamics for the first 400 days of using both programs.

As I said, Neovim seems to have changed a lot since the last time I was using it, so my number of [REDACTED] init.vim lines may no longer be relevant. Still, it's pretty interesting.

Emacs packages

Working with Emacs packages was an interesting experience, not least because it was my first experience with Lisp. Fig. 8 shows the structure of the [REDACTED] hours I spent on that.

Unsurprisingly to me, my org-journal-tags tops the chart with [REDACTED] hours. The most interesting part was implementing set logic on the org-journal entities in order to make a kind of query engine. But I use that package all the time.

The second place, "Unknown project", stands for Emacs Lisp files that didn't belong to any project, which should be mostly built-in Emacs files.

My elfeed-summary ([REDACTED] hours), lyrics-fetcher ([REDACTED] hours) and reverso ([REDACTED] hours) are also among the packages that I use almost daily. So I don't regret investing time in developing any of those.

org-roam

It's not directly related to Emacs, but I include it here because it's highly unlikely that I would have heard the term "Zettelkasten" outside the Emacs space.

And although I mentioned Sönke Ahrens' book, I think the website called zettelkasten.de would be a better resource if you're curious what it's all about. And I was initially made curious by this stream of David Wilson.

Fig. 9 shows the dynamics of my org-roam nodes count over time.

A significant fraction of my [REDACTED] hours spent on Org Mode went there.

Some observations

So, as I said, I started from the point of zero experience with Lisp. I had a Bachelor's degree (now Master's) in software engineering, but I don't feel like it has helped me in any direct sense. At most, it exposed me to different kinds and concepts of programming, but I am confident that it's anything but a prerequisite, as also shown by the story of Protesilaos.

The number of [REDACTED] total hours of configuration may seem huge, but I don't think it's that much over 2.5 years and in comparison to the alternatives. For instance, it would take 6th place from the top if placed among my job projects. Also, my AntennaPod shows 196.9 hours of podcasts played since December 2021, and some of my friends report having spent thousands of hours on video games.

And keep in mind that I use Emacs almost as extensively as it gets. You might as well spend much less time figuring it out for a more limited use case. So, at least in my view, this weighs against describing Emacs usage in terms of sunk cost fallacy.

However, my story is consistent with the perception of a steep learning curve in the Emacs community. 19.3 hours over 5 days to get started is definitely a lot.