feat(emacs): some text

This commit is contained in:
Pavel Korytov 2023-04-07 23:59:08 +03:00
parent 9518c83a0d
commit b3e1afe229
4 changed files with 282 additions and 22 deletions

View file

@ -1,5 +1,5 @@
+++
title = "Charts test"
title = "900 days of Emacs"
author = ["Pavel Korytov"]
date = 2023-02-02
tags = ["emacs"]
@ -7,12 +7,91 @@ 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"]
+++
Hello world
<style>
.quote-title {
margin-left: 24px;
}
</style>
> Poof I made my free-time disappear
<p class="quote-title">- <a href="https://elken.dev">Ellis Kenyő</a>, on being called an "elisp mage"
Little did I know when on the fateful day of **<span class="timestamp-wrapper"><span class="timestamp">[2020-10-09 Fri]</span></span>** I had installed [GNU Emacs](https://www.gnu.org/software/emacs/). I wasn't thinking about the [ethical aspects](https://www.gnu.org/philosophy/philosophy.html) of free software, [aesthetics of Lisp](https://www.webofstories.com/play/marvin.minsky/44), or these other things with which an occasional layperson explains to him or herself how an almost [half a century old](https://www.jwz.org/doc/emacs-timeline.html) program can still be in [active use](https://emacsconf.org/2022/talks/survey/).
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](https://sqrtminusone.xyz/configs/emacs/). 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](https://zettelkasten.de/), 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, I am writing this document because I happen to have a lot of data about how I use Emacs, mostly from projects called [ActivityWatch](https://activitywatch.net/) and [WakaTime](https://wakatime.com/). So, primarily I am curious myself --- how much time did all of that actually take?
Also, every now and then I see Emacs people discussing their journeys through the Elisp-land, or a potential newcomer wondering whether this rabbit hole is worth investigating. If this applies to you, then you might find something interesting in the structure of my effort.
<noscript>
Also, I use a lot of JavaScript here, but it's all open source. The only 3rd party library is the MIT-licensed <a href="https://www.chartjs.org/">chart.js</a>. So you need to enable JavaScript if you want to see the charts and some of the numbers that are dynamically calculated.
</noscript>
## Everything goes into Emacs {#everything-goes-into-emacs}
It makes sense to begin with the evolution of the place of Emacs in my PC usage. Fig. 1 shows that as a Gantt chart.
<canvas id="chart-emacs-history"></canvas>
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.
<canvas id="chart-emacs-screen-time"></canvas>
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](https://github.com/zevlg/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](https://i3wm.org/) to [EXWM](https://github.com/ch11ng/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... that's a lot.
## Time spent in Emacs {#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](https://wakatime.com/faq#timeout). 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](https://wakatime.com/developers/#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](https://wakatime.com/faq#exporting), 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](https://wiki.systemcrafters.net/community/chat-with-us/) Discord server, [emacs.ch](https://emacs.ch/) (a Mastodon instance), or whatever else. So treat the numbers below as an upper bound.
<canvas id="chart-emacs-time"></canvas>
<canvas id="chart-emacs-time-stacked"></canvas>
The categories are as follows:
- **Config** (<span data-num="config_hours_total">[REDACTED]</span> total hours, <span data-num="config_hours_percent">[REDACTED]</span>% of all time)<br />
Time spent on the actual Emacs configuration.
- **Emacs Packages** (<span data-num="package_hours_total">[REDACTED]</span> total hours, <span data-num="package_hours_percent">[REDACTED]</span>% of all time)<br />
Time spent in other Emacs Lisp files, i.e. writing my packages or debugging other packages. See the packages section.
- **Org Mode** (<span data-num="orgmode_hours_total">[REDACTED]</span> total hours, <span data-num="orgmode_hours_percent">[REDACTED]</span>% of all time)<br />
Time spent in my `org-mode` project, which is mostly [org-journal](https://github.com/bastibe/org-journal), [org-roam](https://www.orgroam.com/) and project management. By the way, guess the month in which I read [Sönke Ahrens' book](https://www.soenkeahrens.de/en/takesmartnotes) about Zettelkasten.
- **sqrtminusone.xyz** (<span data-num="sqrt_hours_total">[REDACTED]</span> total hours, <span data-num="sqrt_hours_percent">[REDACTED]</span>% of all time)<br />
Time spent doing something with this strage website.
- **Other Code** (<span data-num="other_code_hours_total">[REDACTED]</span> total hours, <span data-num="other_code_hours_percent">[REDACTED]</span>% of all time)<br />
Doing something marginally useful in Emacs, which is mostly work, education and a few personal projects that aren't related to Emacs.
- **Misc** (<span data-num="misc_hours_total">[REDACTED]</span> total hours, <span data-num="misc_hours_percent">[REDACTED]</span>% of all time)
Time spent in Emacs but not in an actual project (i.e. accounted by ActivityWatch but not WakaTime). These are things like reading RSS, writing emails, using messengers, doing some idle experimentation in scratch buffers, etc.
## Numbers {#numbers}
- Total time on Config: <span data-num="config_hours_total">[REDACTED]</span>
- Total time on Config:
- Total time on Packages: <span data-num="package_hours_total">[REDACTED]</span>
- % time on Config: <span data-num="config_hours_percent">[REDACTED]</span>
- Hours on `org-journal-tags`: <span data-num="org-journal-tags_total">[REDACTED]</span>
@ -21,12 +100,6 @@ Hello world
## Charts {#charts}
<canvas id="chart-emacs-history"></canvas>
<canvas id="chart-emacs-time"></canvas>
<canvas id="chart-emacs-time-stacked"></canvas>
<canvas id="chart-emacs-config-size"></canvas>
<canvas id="chart-emacs-vim-config-size"></canvas>

View file

@ -1,26 +1,79 @@
#+HUGO_SECTION: posts
#+HUGO_BASE_DIR: ../
#+TITLE: Charts test
#+TITLE: 900 days of Emacs
#+DATE: 2023-02-02
#+HUGO_TAGS: emacs
#+HUGO_DRAFT: true
#+HUGO_CUSTOM_FRONT_MATTER: :scripts '("/js/chart.js" "/js/chartjs-adapter-date-fns.bundle.min.js" "/js/chartjs-plugin-datalabels.js" "/js/2023-04-14-emacs.js")
Hello world
#+begin_export html
<style>
.quote-title {
margin-left: 24px;
}
</style>
#+end_export
* Numbers
- Total time on Config: @@html:<span data-num="config_hours_total">[REDACTED]</span>@@
- Total time on Packages: @@html:<span data-num="package_hours_total">[REDACTED]</span>@@
- % time on Config: @@html:<span data-num="config_hours_percent">[REDACTED]</span>@@
- Hours on =org-journal-tags=: @@html:<span data-num="org-journal-tags_total">[REDACTED]</span>@@
- Total time on Vim config: 39 hours
#+begin_quote
Poof I made my free-time disappear
#+end_quote
* Charts
@@html:<p class="quote-title">- <a href="https://elken.dev">Ellis Kenyő</a>, on being called an "elisp mage"@@
Little did I know when on the fateful day of *[2020-10-09 Fri]* I had installed [[https://www.gnu.org/software/emacs/][GNU Emacs]]. I wasn't thinking about the [[https://www.gnu.org/philosophy/philosophy.html][ethical aspects]] of free software, [[https://www.webofstories.com/play/marvin.minsky/44][aesthetics of Lisp]], or these other things with which an occasional layperson explains to him or herself how an almost [[https://www.jwz.org/doc/emacs-timeline.html][half a century old]] program can still be in [[https://emacsconf.org/2022/talks/survey/][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 [[https://sqrtminusone.xyz/configs/emacs/][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 [[https://zettelkasten.de/][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, I am writing this document because I happen to have a lot of data about how I use Emacs, mostly from projects called [[https://activitywatch.net/][ActivityWatch]] and [[https://wakatime.com/][WakaTime]]. So, primarily I am curious myself --- how much time did all of that actually take?
Also, every now and then I see Emacs people discussing their journeys through the Elisp-land, or a potential newcomer wondering whether this rabbit hole is worth investigating. If this applies to you, then you might find something interesting in the structure of my effort.
#+begin_export html
<noscript>
Also, I use a lot of JavaScript here, but it's all open source. The only 3rd party library is the MIT-licensed <a href="https://www.chartjs.org/">chart.js</a>. So you need to enable JavaScript if you want to see the charts and some of the numbers that are dynamically calculated.
</noscript>
#+end_export
* Everything goes into Emacs
It makes sense to begin with the evolution of the place of Emacs in my PC usage. Fig. 1 shows that as a Gantt chart.
#+begin_export html
<canvas id="chart-emacs-history"></canvas>
#+end_export
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.
#+begin_export html
<canvas id="chart-emacs-screen-time"></canvas>
#+end_export
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 [[https://github.com/zevlg/telega.el][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 [[https://i3wm.org/][i3]] to [[https://github.com/ch11ng/exwm][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... that's a lot.
* 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 [[https://wakatime.com/faq#timeout][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 [[https://wakatime.com/developers/#heartbeats][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 [[https://wakatime.com/faq#exporting][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 [[https://wiki.systemcrafters.net/community/chat-with-us/][System Crafters]] Discord server, [[https://emacs.ch/][emacs.ch]] (a Mastodon instance), or whatever else. So treat the numbers below as an upper bound.
#+begin_export html
<canvas id="chart-emacs-time"></canvas>
#+end_export
@ -29,6 +82,30 @@ Hello world
<canvas id="chart-emacs-time-stacked"></canvas>
#+end_export
The categories are as follows:
- *Config* (@@html:<span data-num="config_hours_total">[REDACTED]</span>@@ total hours, @@html:<span data-num="config_hours_percent">[REDACTED]</span>@@% of all time)\\
Time spent on the actual Emacs configuration.
- *Emacs Packages* (@@html:<span data-num="package_hours_total">[REDACTED]</span>@@ total hours, @@html:<span data-num="package_hours_percent">[REDACTED]</span>@@% 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* (@@html:<span data-num="orgmode_hours_total">[REDACTED]</span>@@ total hours, @@html:<span data-num="orgmode_hours_percent">[REDACTED]</span>@@% of all time)\\
Time spent in my =org-mode= project, which is mostly [[https://github.com/bastibe/org-journal][org-journal]], [[https://www.orgroam.com/][org-roam]] and project management. By the way, guess the month in which I read [[https://www.soenkeahrens.de/en/takesmartnotes][Sönke Ahrens' book]] about Zettelkasten.
- *sqrtminusone.xyz* (@@html:<span data-num="sqrt_hours_total">[REDACTED]</span>@@ total hours, @@html:<span data-num="sqrt_hours_percent">[REDACTED]</span>@@% of all time)\\
Time spent doing something with this strage website.
- *Other Code* (@@html:<span data-num="other_code_hours_total">[REDACTED]</span>@@ total hours, @@html:<span data-num="other_code_hours_percent">[REDACTED]</span>@@% 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* (@@html:<span data-num="misc_hours_total">[REDACTED]</span>@@ total hours, @@html:<span data-num="misc_hours_percent">[REDACTED]</span>@@% of all time)
Time spent in Emacs but not in an actual project (i.e. accounted by the [[https://github.com/ActivityWatch/aw-watcher-window][window watcher]] of ActivityWatch but not WakaTime, which watches for projects). These are things like reading RSS, writing emails, using messengers, doing some idle experimentation in scratch buffers, etc.
* Numbers
- Total time on Config:
- Total time on Packages: @@html:<span data-num="package_hours_total">[REDACTED]</span>@@
- % time on Config: @@html:<span data-num="config_hours_percent">[REDACTED]</span>@@
- Hours on =org-journal-tags=: @@html:<span data-num="org-journal-tags_total">[REDACTED]</span>@@
- Total time on Vim config: 39 hours
* Charts
#+begin_export html
<canvas id="chart-emacs-config-size"></canvas>
#+end_export

View file

@ -0,0 +1,33 @@
[
{"date_trunc":"2020-10-01T00:00:00Z","percent":0.20421706158872063},
{"date_trunc":"2020-11-01T00:00:00Z","percent":0.2656396332934231},
{"date_trunc":"2020-12-01T00:00:00Z","percent":0.328156158373562},
{"date_trunc":"2021-01-01T00:00:00Z","percent":0.30293494692052564},
{"date_trunc":"2021-02-01T00:00:00Z","percent":0.29825278394208066},
{"date_trunc":"2021-03-01T00:00:00Z","percent":0.24318066017980156},
{"date_trunc":"2021-04-01T00:00:00Z","percent":0.3774396720741769},
{"date_trunc":"2021-05-01T00:00:00Z","percent":0.2907218886830386},
{"date_trunc":"2021-06-01T00:00:00Z","percent":0.37853346779023606},
{"date_trunc":"2021-07-01T00:00:00Z","percent":0.3451648046146705},
{"date_trunc":"2021-08-01T00:00:00Z","percent":0.5261220707445486},
{"date_trunc":"2021-09-01T00:00:00Z","percent":0.4095219799672908},
{"date_trunc":"2021-10-01T00:00:00Z","percent":0.3562719759085607},
{"date_trunc":"2021-11-01T00:00:00Z","percent":0.3946809530892407},
{"date_trunc":"2021-12-01T00:00:00Z","percent":0.46327503042546997},
{"date_trunc":"2022-01-01T00:00:00Z","percent":0.5318326577174478},
{"date_trunc":"2022-02-01T00:00:00Z","percent":0.4358549401255391},
{"date_trunc":"2022-03-01T00:00:00Z","percent":0.41948172412528684},
{"date_trunc":"2022-04-01T00:00:00Z","percent":0.4430246367606649},
{"date_trunc":"2022-05-01T00:00:00Z","percent":0.39880827117107315},
{"date_trunc":"2022-06-01T00:00:00Z","percent":0.39962422579568685},
{"date_trunc":"2022-07-01T00:00:00Z","percent":0.3741313993218909},
{"date_trunc":"2022-08-01T00:00:00Z","percent":0.5678526580569381},
{"date_trunc":"2022-09-01T00:00:00Z","percent":0.3912379067398905},
{"date_trunc":"2022-10-01T00:00:00Z","percent":0.3807843143331747},
{"date_trunc":"2022-11-01T00:00:00Z","percent":0.36358283951988357},
{"date_trunc":"2022-12-01T00:00:00Z","percent":0.3664672426322652},
{"date_trunc":"2023-01-01T00:00:00Z","percent":0.5015832592260838},
{"date_trunc":"2023-02-01T00:00:00Z","percent":0.48874221007685836},
{"date_trunc":"2023-03-01T00:00:00Z","percent":0.43940966116785446},
{"date_trunc":"2023-04-01T00:00:00Z","percent":0.44787489198857766}
]

View file

@ -32,6 +32,7 @@ const EMACS_DATA = {
"Passwords",
"Multimedia",
"WM",
"Messenger",
],
datasets: [
{
@ -178,6 +179,7 @@ const EMACS_DATA = {
},
],
yAxisID: "yAxis5",
...EMACS_ITEM,
},
{
label: "Google Play Music",
@ -261,6 +263,27 @@ const EMACS_DATA = {
yAxisID: "yAxis7",
...EMACS_ITEM,
},
{
label: "Telegram Desktop",
data: [
{
name: "Messenger",
span: [new Date("2022-03-22"), new Date("2023-01-07")],
},
],
yAxisID: "yAxis8",
},
{
label: "telega.el",
data: [
{
name: "Messenger",
span: [new Date("2023-01-07"), TODAY],
},
],
yAxisID: "yAxis8",
...EMACS_ITEM,
},
].map((d) => {
if (!d.backgroundColor) {
d.backgroundColor = COLORS[i];
@ -302,7 +325,7 @@ function emacsChart() {
min: new Date("2018-09"),
},
...Object.fromEntries(
[1, 2, 3, 4, 5, 6].map((i) => [
[1, 2, 3, 4, 5, 6, 7].map((i) => [
`yAxis${i}`,
{
display: false,
@ -316,7 +339,7 @@ function emacsChart() {
},
title: {
display: true,
text: "Everything goes into Emacs",
text: "Figure 1. Everything goes into Emacs",
color: "black",
font: {
size: 15,
@ -350,6 +373,59 @@ function emacsChart() {
});
}
async function emacsScreenTimeChart() {
const response = await fetch("/data/2023-03-14-emacs/emacs-screen-time.json");
const rawData = await response.json();
const data = {
labels: rawData.map((d) => new Date(d["date_trunc"])),
datasets: [
{
data: rawData.map((d) => ({
period: new Date(d["date_trunc"]),
value: d["percent"],
})),
},
],
};
const ctx = document.getElementById("chart-emacs-screen-time");
new Chart(ctx, {
type: "bar",
data,
options: {
parsing: {
xAxisKey: "period",
yAxisKey: "value",
},
scales: {
x: {
type: "time",
min: data.labels[0],
},
y: {
title: {
display: true,
text: "Ratio of direct screen time",
},
},
},
plugins: {
legend: {
display: false,
},
title: {
display: true,
text: "Figure 2. Emacs direct screen time ratio over time",
color: "black",
font: {
size: 15,
},
},
},
},
});
}
async function emacsTimeChart() {
const response = await fetch(
"/data/2023-03-14-emacs/emacs-related-time-per-month.json"
@ -421,7 +497,7 @@ async function emacsTimeChart() {
plugins: {
title: {
display: true,
text: "Emacs-related time per month",
text: "Figure 3. Structure of Emacs usage per month",
color: "black",
font: {
size: 15,
@ -481,7 +557,7 @@ async function emacsTimeChart() {
plugins: {
title: {
display: true,
text: "Emacs-related time per month (stacked)",
text: "Figure 4. Structure of Emacs usage per month (stacked)",
color: "black",
font: {
size: 15,
@ -783,6 +859,7 @@ document.addEventListener(
"DOMContentLoaded",
async function () {
emacsChart();
emacsScreenTimeChart();
emacsTimeChart();
configsChart();
packagesChart();