<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title><![CDATA[Joar von Arndt - emacs]]></title>
<description><![CDATA[Joar von Arndt - emacs]]></description>
<link>https://joarvarndt.se//tag-emacs.html</link>
<lastBuildDate>Mon, 11 May 2026 15:52:39 +0200</lastBuildDate>
<item>
  <title><![CDATA[Vibe-coding Brings the Power of Emacs to Everything]]></title>
  <description><![CDATA[
 <h2 class="post-subtitle"></h2>
<hr>

<p class="dcap">
One of the first use-cases I found for <span class="small-caps">llm</span>s back when <i>Chat<span class="small-caps">gpt</span></i> first
released was automating the creation of citations, or rather the
transformations of citations structured in one way into <code>.bib</code>-files
that can be used to create a wide variety of uniform citations in
\(\LaTeX\) documents. <span class="small-caps">llm</span>s are <i>fantastic</i> for this sort of work, where
some sort of messily structured data needs to be transformed into some
other form that is then useful. As <span class="small-caps">llm</span>s become cheaper and cheaper it
becomes easier and easier to make data become useful. The benefits of
this is obvious to the point of it being the main strength of what is
perhaps the world&rsquo;s oldest continuously developed software project;
<span class="small-caps">gnu</span> Emacs.
</p>

<p>
Much of software engineering is <a href="https://joarvarndt.se/cl-workflows">piping</a> that transforms data from one
form to another, where we can then process it, ingest it, or present
it in some interesting and beneficial way. This is true regardless of
the underlying nature of that data. In Emacs there are primarily two
forms of this data: <a href="https://en.wikipedia.org/wiki/Lisp_(programming_language)">lisp</a> code and <a href="https://joarvarndt.se/text">text</a>. Ardent lisp wizards will
object on the basis that one of the core strengths of lisp is that it
does not discriminate between lisp as a program qua list of
instructions and lisp as a data structure due to its simple syntax.<sup><a id="fnr.1" class="footref" href="#fn.1" role="doc-backlink">1</a></sup>
The classic <span class="small-caps">unix</span> environment also made use of this compatibility made
possible by a common language of text.
</p>

<p>
Emacs is a lisp interpreter that comes with a text editor and tools to
evaluate elisp code written in said editor. This simple basis allows
Emacs to very quickly and easily be extended. While other programs
(and even text editors specifically) may offer theoretically similar
capabilities<sup><a id="fnr.2" class="footref" href="#fn.2" role="doc-backlink">2</a></sup> through scripting languages and <span class="small-caps">api</span>s they do not offer
the truly <i>free</i> experience that only a few Emacs-like programs build
their experience upon. Most code written in Emacs is not packaged or
distributed anywhere, but is made up of small and opinionated changes
and functions that are likely not maintained in any way. This means
that each Emacs user&rsquo;s computing experience is personally tailored to
his or hers own preferences.
</p>

<p>
The second of the four freedoms (freedom #1) of free software is the
&ldquo;the freedom to study how the program works, and change it to make it
do what you wish&rdquo;. In practice this only means access to the source
code under a free-software license. But Emacs takes this much further;
instead of a merely &ldquo;negative&rdquo; freedom (freedom <i>from</i> proprietary
restrictions) it adopts a positive approach, where the user is
directly given the tools and documentation<sup><a id="fnr.3" class="footref" href="#fn.3" role="doc-backlink">3</a></sup> to change each and every
part of the Emacs source code.
</p>

<p>
Emacs, <span class="small-caps">unix</span>, and modern <span class="small-caps">llm</span>s all make use of the unique strengths of
text. Emacs however goes much further in this regard than the standard
<span class="small-caps">unix</span> system, and in many regards can be seen as an extension and
intensification of it. <a href="https://christiantietze.de/posts/2026/02/complete-feedback-loop-in-emacs/">Tietze</a> pointed out recently how the textual
representations of almost all data in Emacs is &ldquo;completes computing&rdquo;
through the universality of text and primarily the <i>text buffer</i>.
</p>

<p>
If the costs of creating software goes to zero due to continuing
advancements in <span class="small-caps">llm</span>s it would bring this quality that Emacs has to all
software. The restrictions of proprietary software has always been an
invention by monopolistic software companies wishing to add a shackle
on what is really just a bunch of abstract logical statements. That
this has been maintained is impressive, but it can not do so under the
onslaught of code produced by <span class="small-caps">llm</span>s.
</p>

<p>
Trivially creating <a href="https://joarvarndt.se/xournal-emacs">quick and simple programs</a> that serve the user is
Emacs&rsquo; greatest strength, and it is something that will be accessible
to everyone, no matter their experience in software creation. One will
be able to make small little applications that serve yourself, and
because of its low cost will naturally freely share them with friends,
colleagues, and family members. It is, to repeat a often-used
<a href="https://joarvarndt.se/email">sentiment</a> of mine, a revolution in the field of software development —
a dramatic return to the older state of affairs, albeit now aided by
the lessons of the time in between. In this case it is a return to the
times before &ldquo;free software&rdquo;, when specifying that a given software
was free to use, share, and modify was not necessary but expected and
normal.
</p>

<p>
To reiterate, vibe coding and <span class="small-caps">llm</span>s have two great strengths:
</p>

<ol class="org-ol">
<li>Easily creating, recreating, and modifying small programs that do
not need to be maintained and are tailored for the user&rsquo;s needs.</li>
<li>Formatting roughly structured data into ways that fit the user&rsquo;s
needs, or writing small scripts that do so.</li>
</ol>

<p>
The consequence of these two strengths is a renaissance of free
software development where the user become free to construct their
computing environment however they see fit. &ldquo;Emacs is a great
operating system, if only it came with a decent text editor&rdquo; goes the
famous quip; Emacs is of course not a operating system in the strict
sense,<sup><a id="fnr.4" class="footref" href="#fn.4" role="doc-backlink">4</a></sup> but it does allow for the almost complete reshaping of
one&rsquo;s interactions with a computer — being able to replace most other
use-facing applications. <span class="small-caps">llm</span>s extend this freedom to outside the frame
of Emacs and into almost every part of the software stack. ❦
</p>
<div id="footnotes">
<h2 class="footnotes">Footnotes: </h2>
<div id="text-footnotes">

<div class="footdef"><sup><a id="fn.1" class="footnum" href="#fnr.1" role="doc-backlink">1</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
Simple in the sense of this quote by Leonardo da Vinci:
</p>

<blockquote>
<p>
A poet knows he has achieved perfection not when there is nothing left
to add, but when there is nothing left to take away.
</p>
</blockquote>

<p class="footpara">
This simplicity does not mean that it is impossible to construct
elaborate or complex programs in lisp — in fact it is one of the most
<i>expressive</i> programming languages. Rather it refers to the basic axioms
inferred from the nature of prefix notation and the structure of the
abstract syntax tree itself.
</p></div></div>

<div class="footdef"><sup><a id="fn.2" class="footnum" href="#fnr.2" role="doc-backlink">2</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
What matters in theory is in fact not very interesting. Many
languages and processes are Turing-complete, and could thus be used to
create any other program, but what actually matters is the ease and
manner of creating such a program.
</p></div></div>

<div class="footdef"><sup><a id="fn.3" class="footnum" href="#fnr.3" role="doc-backlink">3</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
Emacs has extensive manuals, but most of all it is its nature as
the &ldquo;self-documenting editor&rdquo; that gives it this quality.
</p></div></div>

<div class="footdef"><sup><a id="fn.4" class="footnum" href="#fnr.4" role="doc-backlink">4</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
In that it does not facilitate the interaction between software
and hardware.
</p></div></div>


</div>
</div>
]]></description>
  <category><![CDATA[emacs]]></category>
  <category><![CDATA[technology]]></category>
  <link>https://joarvarndt.se/free-vibes.html</link>
  <guid>https://joarvarndt.se/free-vibes.html</guid>
  <pubDate>Sun, 01 Mar 2026 00:00:00 +0100</pubDate>
</item>
<item>
  <title><![CDATA[Handwritten notes in Emacs using Xournal++]]></title>
  <description><![CDATA[
 <h2 class="post-subtitle"></h2>
<p class="dcap">
My girlfriend recently bought a <a href="https://frame.work/se/en/laptop12">Framework 12</a> laptop<sup><a id="fnr.1" class="footref" href="#fn.1" role="doc-backlink">1</a></sup> with a
correspoding stylus and, influenced by my ravings about the power of
<span class="small-caps">gnu</span> Emacs, wants to take handwritten digital notes on it for her
engineering and mathematics classes and then organise them in <a href="https://orgmode.org/">org-mode</a>. I see a younger version of myself clearly in her, and of course
want to help her attain the vision she has for her own Emacs
system. At the same time I am a strong believer in that you should not
try and <i>learn</i> Emacs, but that it should be molded to your own personal
desires. For that reason I try to act in merely an advisory capacity,
while helping whenever she asks.
</p>

<p>
At first we discovered an old package named <a href="https://gitlab.com/vherrmann/org-xournalpp">org-xournalpp</a> that seems
to fit perfectly. It creates xournal++-specific links that opens the
corresponding xournal file whenever clicked, and they are rendered
like inline images in the org-mode buffer. We had some trouble getting
Emacs to load the file after installing with the new built-in <code>:vc</code>
keyword for <code>use-package</code> (it worked fine on my machine, but not hers)
but after installing it the inline previews would not be
displayed. Worse yet, running the included <code>org-xournalpp-mode</code> (that
tries to render the images) would cause Emacs to freeze.
</p>

<p>
But how hard can it be to implement your own version of this
functionality? Org-mode already has the ability to display inline
images (as I am <a href="https://joarvarndt.se/notes">well familiar with</a>) and xournal++ can export to
both <code>.png</code> and <code>.svg</code> formats. For this we wrote a small function that
uses <code>xournalpp</code> to export a given file to png format and then inserts a
link to it in the buffer.
</p>

<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span class="org-keyword">defun</span> <span class="org-function-name">create-png-xournal-file</span> (<span class="org-type">&amp;optional</span> only-export)
  <span class="org-doc">"Creates a png from a xournal file and inserts it into the buffer."</span>
    (<span class="org-keyword">interactive</span> <span class="org-string">"P"</span>)
    (<span class="org-keyword">let</span> ((file-name (expand-file-name
                      (file-name-sans-extension
                       (read-file-name <span class="org-string">".xopp file to convert: "</span>)))))
      (shell-command (format <span class="org-string">"xournalpp --create-img=%s.png %s.xopp"</span>
                             file-name file-name))
      (<span class="org-keyword">unless</span> only-export
       (kill-new (concat <span class="org-string">"[["</span> file-name <span class="org-string">".png"</span> <span class="org-string">"]]"</span>))
       (yank)
       (org-display-inline-images))
      (org-redisplay-inline-images)))

  (<span class="org-keyword">bind-key</span> <span class="org-string">"C-&#246;"</span> 'create-png-xournal-file)
</pre>
</div>

<p>
If <code>org-startup-with-inline-images</code> is <code>t</code> this is then immediately
rendered as an image in the buffer. If called with a prefix argument
(usually <code>C-u</code>) this skips the insertion part and calls
<code>org-redisplay-inline-images</code> to get an updated version.
</p>

<p>
The experience of imagining functionality that you wish was possible
and in an afternoon creating a program (even one as small as a single
11-loc function) that fulfills your requirements is something that you
rarely get outside of Emacs. Even in other free software, few programs
open themselves so fully to introspection and modification. Something
as simple as the <code>*scratch*</code>-buffer, with its use as a quasi-persistent
<span class="small-caps">repl</span>, invites creative solutions and problem solving — not to mention
the self-documenting capabilities of <code>C-h</code> and docstrings.
</p>

<p>
While I am not one of those users insistent on reducing the number of
packages installed<sup><a id="fnr.2" class="footref" href="#fn.2" role="doc-backlink">2</a></sup>, there is a certain perspective that you should
be emphasised; You can easily make do with home-grown functionality
that builds on packages you already have installed, or the rich
functionality that already comes with Emacs. ❦
</p>
<div id="footnotes">
<h2 class="footnotes">Footnotes: </h2>
<div id="text-footnotes">

<div class="footdef"><sup><a id="fn.1" class="footnum" href="#fnr.1" role="doc-backlink">1</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
For the short period she&rsquo;s had it now it seems like a great
product, but I still prefer the philosophy of <a href="https://mntre.com/index.html"><span class="small-caps">mnt</span> Research</a>. It is
however good enough that I do not have any issues with linking to it.
</p></div></div>

<div class="footdef"><sup><a id="fn.2" class="footnum" href="#fnr.2" role="doc-backlink">2</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
My current count as of writing this is 134. 
</p></div></div>


</div>
</div>
]]></description>
  <category><![CDATA[technology]]></category>
  <category><![CDATA[emacs]]></category>
  <link>https://joarvarndt.se/xournal-emacs.html</link>
  <guid>https://joarvarndt.se/xournal-emacs.html</guid>
  <pubDate>Mon, 15 Dec 2025 00:00:00 +0100</pubDate>
</item>
<item>
  <title><![CDATA[Productive Note-taking]]></title>
  <description><![CDATA[
 <h2 class="post-subtitle"></h2>
<nav id="table-of-contents" role="doc-toc">
<h2>Table of Contents</h2>
<div id="text-table-of-contents" role="doc-toc">
<ul>
<li><a href="#orgd01e3f3">Introduction</a></li>
<li><a href="#orgfa8729a">Revolutionary Notes</a></li>
<li><a href="#orgab52b5f">Implementation</a></li>
</ul>
</div>
</nav>
<div id="outline-container-orgd01e3f3" class="outline-2">
<h2 id="orgd01e3f3">Introduction</h2>
<div class="outline-text-2" id="text-orgd01e3f3">
<p class="dcap">
After initially starting to use Emacs back in high school merely for
programming, I naturally began to use it for other tasks such as
document preparation and note-taking. This introduced me to the
surprisingly large overlap between Emacs users and people generally
interested in &ldquo;productivity&rdquo; workflows.
</p>

<p>
This is not all that surprising however. It is partly due to how good
Emacs&rsquo; ecosystem has become for these specific types of tasks (things
like <a href="https://orgmode.org/manual/Agenda-Commands.html">Agenda</a>, <a href="https://www.orgroam.com/">org-roam</a>, <a href="https://protesilaos.com/emacs/denote">denote</a>, and <a href="https://github.com/kaorahi/howm">howm</a> — even org-mode itself — were
all created for these uses) but on a more fundamental level Emacs
allows you to work with any form of text not just efficiently, but
also in a way that is entirely customised to your own preferences and
comforts.
</p>

<p>
As I became more proficient in Emacs and read more perspectives on how
other people organised their notes, I tried to evaluate my views on
note-taking that I had held before. You may have an idea of what it
means to be productive, but this post is instead about another form of
productivity, one that does not have to rely on the powers of <span class="small-caps">gnu</span>
Emacs, but instead of the agent itself, the author.
</p>

<p>
Productivity qua measurement is the amount of goods (or products) that
are produced per unit of time. For this reason it has become common
for people to link improvements in productivity to the aspect of time
specifically. But productivity is even more innately linked to the
product itself, and it is this aspect that I would like to focus on
here.
</p>

<p>
What I choose to call <i>productive</i> note-taking is fundamentally anchored
in not the rate at which one produces notes, or even the quality of
the notes, but instead in mental model that one uses when producing
them. Advocates for Zettelkästen-based systems argue that notes should
form a mental (or sometimes digitally represented) web of thoughts
that links each &ldquo;note&rdquo; with its equals. What I propose here is instead
a form of notes that are different in that they are meant to develop
not some separate bank of data, but to develop the cognitive abilities
of the author, while still creating a tangible work.
</p>
</div>
</div>
<div id="outline-container-orgfa8729a" class="outline-2">
<h2 id="orgfa8729a">Revolutionary Notes</h2>
<div class="outline-text-2" id="text-orgfa8729a">
<p>
The word <i>revolution</i>, while evoking signs of violent rebellion, has its
roots in the term for turning. It of course still means this (as in
the phrase &ldquo;revolutions per minute&rdquo;, <span class="small-caps">rpm</span>) and it is in this sense that
I mean revolutionary notes. I have used it in this sense <a href="https://joarvarndt.se/email.html">before</a>, and
am quite fond of this mixture of images — of a dramatic change that
returns to some earlier state, albeit with new experiences and ideas.
</p>

<p>
I have taken notes almost daily during my many years in the education
system, but have undertaken a more critical view of my use of notes
during the first half of this decade. Almost a year ago I published <a href="https://joarvarndt.se/notes.html">a
piece of writing</a> on my evolving experiments with a Zettelkasten
system, implemented using org-roam. Writing that piece I
subconsciously knew that as soon as it was published I would move away
from the implementation I was writing about into a more holistic
direction, although I was unsure of what shape that would take. After
finishing a course in <i>Contemporary Warfare</i> I feel like I finally have
what I can coherently describe as a solution — to the extent that it
exists as a vestige of my mind.
</p>

<p>
Productive note-taking is productive in the ways that it emphasises
and highlights the importance of the end <i>product</i>. It is note-taking
for the aim of production of a given work, not for the aid of
remembrance or recollection. While these latter elements may play a
part in the production of the work, they are not in and of themselves
goals.
</p>

<p>
When I was still studying mathematics, I noticed a sharp decrease in
my understanding when I redoubled my efforts to produce more
comprehensive notes to help me study. Where I had before been able to
keep pace with the best of my peers, I had now fallen behind to the
middle of the pack. This seemed paradoxical to me — how can studying
harder result in a worse performance? The answer seems obvious now, I
was prioritising the production of more and more notes over my
understanding of the subject material. It is this sort of activity
that productive note-taking seeks to avoid.
</p>

<p>
Sara Imari Walker <a href="https://www.noemamag.com/the-death-of-the-scientist">writes in <span class="small-caps">noema</span></a> about how <span class="small-caps">ai</span> systems fail to fulfill
the role of the scientist because science is a &ldquo;fundamentally
intersubjective&rdquo; act — where theories (as symbolic representations)
are argued out and decided upon in the process of free discourse. When
writing, communicating, and debating we are constantly refining,
creating, and recreating our ideas, performing science as a societal
dialogue. This intersubjective discussion is what things like
journaling try and emulate — and it is also what I propose notes can
do.
</p>
</div>
</div>
<div id="outline-container-orgab52b5f" class="outline-2">
<h2 id="orgab52b5f">Implementation</h2>
<div class="outline-text-2" id="text-orgab52b5f">
<p>
How does one create notes as products? This is a difficult question to
answer generally, and will depend on a variety of factors such as the
subject material, learning method, audience, and personal
preferences. What all techniques should share in common is a
centrality in all activity being motivated by the creation of some
final work.
</p>

<p>
The work that spawned the concrete formula of a productive workflow is
my collection of notes on contemporary warfare. The exam for that
course was structured as an essay about any one of a selection of
broad topics, and in place of literature we were allowed 30 pages (15
sheets) of notes, written either by hand, printed, or a combination of
the two, covering whatever information we wanted<sup><a id="fnr.1" class="footref" href="#fn.1" role="doc-backlink">1</a></sup>.
</p>

<p>
This meant that my studies did not just consist of me reading
Clausewitz all day trying to memorise every word or phrase — the goal
was for me to get a good enough understanding of Clausewitz, Mahan,
and many other thinkers so that I could condense their theories into
this one document. Doing this required a complete understanding of the
topics.
</p>

<p>
Proponents of Zettelkästen often emphasises the ability for their
constructs to function as &ldquo;second brains&rdquo; — perfectly recording and
remembering information that our feeble flesh brains so easily
forgets. But as a philosopher<sup><a id="fnr.2" class="footref" href="#fn.2" role="doc-backlink">2</a></sup> my goal is not to create as much
recorded information as possible, it is for me as an individual to
understand and master the world around me. Having information written
down is useless if I do not remember it, and if I remember it there is
no point in writing it down. <a href="https://monadnock.net/seneca/84.html">Seneca writes</a>
</p>

<blockquote>
<p>
We should see to it that whatever we have absorbed should not be
allowed to remain unchanged, or it will be no part of us. We must
digest it: otherwise it will merely enter the memory and not the
reasoning power.
</p>
</blockquote>

<p>
Productive notes are then not principally meant for consumption, but
instead their initial omission prompts their creation. The author is
required to go out into the world and obtain the relevant knowledge to
produce the work — either through reading the scraps of knowledge left
behind by those who came before<sup><a id="fnr.3" class="footref" href="#fn.3" role="doc-backlink">3</a></sup>, or through creating new
knowledge by living as an agent in the world.
</p>

<p>
Performing this approach does not require any specific hardware or
software since it emphasises the primacy of the authors mind over the
— ironically — product. You can do this with a pen and paper, text
files (written in whatever markup you want), a <span class="small-caps">wysiwyg</span> editor like
Microsoft&rsquo;s <i>Word</i> or even using Zettelkasten. Writing short notes is
also not &ldquo;forbidden&rdquo; as long as they are meant to help record the
information required for implementing the final product.
</p>

<p>
There are no constraints on the shape of the end product either. It may
be in the form of a text document (written in whatever style you would
like), an <a href="https://joarvarndt.se/email.html">email</a>, an interpretive dance, or a physical structure. If
you want a more concrete example <a href="https://joarvarndt.se/samtida-krigf%C3%B6ring.pdf">here</a> are my notes on contemporary
warfare in <span class="small-caps">pdf</span> form<sup><a id="fnr.4" class="footref" href="#fn.4" role="doc-backlink">4</a></sup>. They are written as a single <code>.org</code>-file with a
header for each lecture/topic, and with a few quotes from selected
other works.
</p>

<p>
<a href="https://www.joanwestenberg.com/i-deleted-my-second-brain-692aa40d59d5f06dd5131e43/"><span class="small-caps">ja</span> Westenberg</a> wrote about their experience with building a &ldquo;second
brain&rdquo;, and the anxiety that comes with an ever growing amount of
information that you have to work through and make use of in some way:
</p>

<blockquote>
<p>
The more my system grew, the more I deferred the work of thought to
some future self who would sort, tag, distill, and extract the gold.
</p>

<p>
That self never arrived.
</p>
</blockquote>

<p>
Steve Krouse accuractely points out that <a href="https://blog.val.town/vibe-code">vibe code is legacy code</a> —
code that no-one understands. In the same way notes or written works
that are merely <i>vibed</i> (either written with <span class="small-caps">llm</span>s, copied from a primary
source, or not mentally processed in another way) turn into legacy
information that has to be painfully worked through in order to
actually master the information contained within (to <i>extract the gold</i>,
to use Westenberg&rsquo;s phrasing).
</p>

<p>
The point of productive notes is to make this a unnecessary. I could
easily delete my whole <code>~/Documents/Notes</code> directory today and continue
on with my life, without any feelings of remorse or anxiety, because
the truly important information is that which I already remember. If I
forget something I simply have to search for it again, and in the
process will likely discover new interesting things about the universe
through my lived experience.
</p>

<p>
There is however a reason that I have not deleted my notes directory —
there is genuine value in recorded information — but one has to be
careful to avoid falling into intellectual atrophy. Being discomforted
by having to retread old paths is a conscious method for intellectual
growth. If recording facts was all that was required then one&rsquo;s notes
should merely consist of written down conversations with <span class="small-caps">llm</span>s.
</p>

<p>
If this approach seems like something trivial to you — great! You
might already be doing what I have merely described. It is once again
this that I mean by the revolutionary quality of this technique; it is
a return to the original state and intention of note-taking.
</p>

<p>
If you disagree with me vehemently, have some constructive criticism,
or have some examples of you doing this or anything similar, feel free
to <a href="mailto:joarxpablo@vonarndt.se">email me</a>. ❦
</p>
</div>
</div>
<div id="footnotes">
<h2 class="footnotes">Footnotes: </h2>
<div id="text-footnotes">

<div class="footdef"><sup><a id="fn.1" class="footnum" href="#fnr.1" role="doc-backlink">1</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
If this seems like a very large degree of freedom it is because
the exam has been recently changed from a take-home essay where one
has full access to both the relevant literature and the internet as a
whole. The change was a natural consequence of <span class="small-caps">llm</span> use (or at least
perceived <span class="small-caps">llm</span> use).
</p></div></div>

<div class="footdef"><sup><a id="fn.2" class="footnum" href="#fnr.2" role="doc-backlink">2</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
The word philosopher has its origins in the Greek words for &ldquo;lover
of wisdom&rdquo; (philos — lover, sophos — wise).
</p></div></div>

<div class="footdef"><sup><a id="fn.3" class="footnum" href="#fnr.3" role="doc-backlink">3</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
This is what is properly called <i>research</i>, the searching not for
new groundbreaking knowledge but &ldquo;re-&rdquo;treading the paths others have
already walked.
</p></div></div>

<div class="footdef"><sup><a id="fn.4" class="footnum" href="#fnr.4" role="doc-backlink">4</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
Beware! They are (almost entirely) written in Swedish and also
have some wicked spelling mistakes that I did not manage to catch
prior to printing due to having some issues with <code>hunspell</code> on <span class="small-caps">gnu</span> Guix.
</p></div></div>


</div>
</div>
]]></description>
  <category><![CDATA[university]]></category>
  <category><![CDATA[emacs]]></category>
  <category><![CDATA[technology]]></category>
  <link>https://joarvarndt.se/productive-notes.html</link>
  <guid>https://joarvarndt.se/productive-notes.html</guid>
  <pubDate>Mon, 08 Dec 2025 00:00:00 +0100</pubDate>
</item>
<item>
  <title><![CDATA[Decentralized Personal Computing]]></title>
  <description><![CDATA[
 <h2 class="post-subtitle"></h2>
<hr>

<p class="dcap">
I have a few different computers. Those machines have different
capabilities, form factors, portability, hardware, and software — and
yet I still want to do roughly the same work on them. While most of
the work I do is with text — reading, writing, editing, programming —
Sometimes I want to work on one specific machine because I might need
a dedicated graphics card or I need the machine to fit in my
pocket. The solution to this is to have work sync automatically
between my machines.
</p>

<p>
This is not a unique problem to have — some common solutions include
Microsoft Windows&rsquo; <i>Active directory</i> or doing all your work through
cloud-based offerings like Google&rsquo;s <i>Drive</i> or Microsoft&rsquo;s
<i>Sharepoint</i>. There are however a few issues with these solutions. They
are almost by definition insecure since they entail sending my data to
a third party&rsquo;s computer<sup><a id="fnr.1" class="footref" href="#fn.1" role="doc-backlink">1</a></sup>. Services like <a href="https://proton.me/drive">Proton drive</a> or <a href="https://koofr.eu/">Koofr</a> at
least do the bare minimum of encrypting your files so that only you
can access them, but they still keep you reliant on someone else&rsquo;s
infrastructure, and you have to be able to connect to their services
in order to access <i>your</i> data.
</p>

<p>
A better workflow would be (to be able) to work entirely offline and
then sync those changes semi-periodically when I am online again. I do
not want to have to think about if a machine is connected to the
internet or what work I have done on it earlier (or not done). I
simply want to pick up (or sit down at) a computer and keep going with
whatever I was doing before — all without relying on a centralized
host. This of course requires all machines to have their own copy of
the data, and for those machines to sync changes to that data between
themselves.
</p>

<p>
This syncing functionality can be offered through a lot of different
services or systems. I personally use <a href="https://syncthing.net">Syncthing</a> for this, but you
could just as well use <a href="https://en.wikipedia.org/wiki/Rsync">rsync</a> paired with <a href="https://en.wikipedia.org/wiki/Cron">cron</a> jobs to sync your files
securely over <code>ssh</code>. Syncthing is cross platform (so I can use it on
android, <span class="small-caps">gnu</span>/Linux, and theoretically Microsoft Windows) and doesn&rsquo;t
rely on port forwarding (and so it doesn&rsquo;t matter what network I am
connected to).
</p>

<p>
If you want to use <code>rsync</code> and sync to your phone I would probably use
something like <a href="https://tailscale.com">tailscale</a> paired with <a href="https://termux.dev/en/">termux</a> to run your cron
jobs. That way you get a single ip address to hardcode into your <code>rsync</code>
scripts and you can move across networks and use your phone&rsquo;s cellular
connection. I actually use tailscale myself (even though it is not
free software) to speed up discovery between devices.
</p>

<p>
Tailscale also allows me to <code>ssh</code> quickly between machines to transfer
files that aren&rsquo;t in my general work-related folders. This is usually
stuff that <i>allows</i> me to perform my work (like dotfiles or other
configuration). It pairs wonderfully with <span class="small-caps">gnu</span> Emacs&rsquo; <a href="https://www.gnu.org/software/tramp/"><span class="small-caps">tramp</span></a> since
machines ssh-ing over tailscale don&rsquo;t need any further authentication
(they are authenticated through the tailnet) and it also means I don&rsquo;t
have to expose port 22 to the open internet.
</p>

<p>
I have five different machines that each keep a complete copy of all
of my critical files:
</p>

<ol class="org-ol">
<li><i>Parana</i>.
This is my server. It does not hold any centralised role in my
network, but is configured to serve content to the open web and
maintain high uptime. Runs Debian stable.</li>
<li><i>Nile</i>.
My desktop computer. Like Parana this is located at my home. This
is a more high-powered device meant for user-facing
interaction. Runs Arch linux.</li>
<li><i>Yukon</i>.
A larger, higher performance laptop that acts as a portable
workstation when I am away from home for longer periods of
time. Runs Debian testing.</li>
<li><i>Danube</i>.
A small, durable, and low-power<sup><a id="fnr.2" class="footref" href="#fn.2" role="doc-backlink">2</a></sup> laptop that I can easily toss
into my bag. This is probably one of my most used devices because
it has a nice keyboard and long battery life. Runs <span class="small-caps">gnu</span> Guix.</li>
<li><i>Yangtze</i>.
My phone. In this context it mostly acts as a music player and a
way for me to access my grocery list. Runs lineage<span class="small-caps">os</span>.</li>
</ol>

<p>
One of the biggest advantages to this approach is that not only is the
general state of the files kept in sync, but I have five different
machines located in different places that all have copies of my
data. This means I can maintain the integrity of my data even if I
lose my phone (1/5), my laptop is stolen (1/5), or my home burns down
when I am away (usually 3/5). I can also wipe my computers — something
I do semi-regularly — without worrying about losing anything of
importance on them. My desktop and server both have high uptime, so
there is always some node on the network that is mirroring
changes. Critically I am still able to automatically sync files
between my phone and laptop when my home network is offline<sup><a id="fnr.3" class="footref" href="#fn.3" role="doc-backlink">3</a></sup>.
</p>

<p>
It is however inevitable that conflicts occur when syncing files
between machines that are not always online. Thankfully there is a
tried-and-tested program that fits with this offline workflow on a
distributed number of machines; <a href="https://git-scm.com/">git</a>.
</p>

<p>
Git is very useful not just as a collaborative development tool, but
also for singular users. Syncthing has an integrated way of dealing
with this by retaining copies of files and renaming them. This is
good, but it is still an annoying hassle to deal with. Using git is a
lot nicer (partly because I can use <a href="https://magit.vc">magit</a> to resolve problems) but git
also allows me to see the history of the edits that I have made. Most
of my git repositories are not kept on any external server like
<a href="https://github.com">github&rsquo;s</a> or <a href="https://codeberg.org">codeberg&rsquo;s</a>, but instead only exist in this pseudo-<span class="small-caps">lan</span>/<span class="small-caps">vpn</span>
that my devices all interact through.
</p>

<p>
All my machines (yes, even my phone) also posses its own copy of my
configuration files for <span class="small-caps">gnu</span> Emacs, and so the way that I interact with
my computers is always tailor-made for my preferences and
workflows. Because of Emacs I work almost exclusively with files in
plaintext (usually formatted using <a href="https://karl-voit.at/2021/11/27/orgdown/">orgdown</a>). Working with plaintext of
course makes using git very straightforward, but I still use git for
non-plaintext tasks.
</p>

<p>
Git is harder to use in non-plaintext contexts, but in my experience
most binary files do not change often enough to experience many
conflicts. That might differ for you however, and you might
require some other custom solution.
</p>

<p>
The end result of this system is that each machine becomes an
old-school terminal that interacts with a broader computing system,
although one that does not require a centralised server or even a
network connection to operate! While all my machines possess complete
records of the data and are fully empowered to make arbitrary changes
(I am the only user after all) no single computer encompasses the
whole of the computing environment. I can always discard one element
of the network for another<sup><a id="fnr.4" class="footref" href="#fn.4" role="doc-backlink">4</a></sup>.
</p>

<p>
This approach not only maintains your own sovereignty over your data,
it doesn&rsquo;t cost anything and also allows you to make use of your
preëxisting storage for a continuos backup solution. It doesn&rsquo;t stop
you from accidentally wiping a given file from all of your machines of
course, so adding some sort of air-gapped backup is also necessary.
</p>

<p>
The modern day computer is increasingly less personal. Smartphones
today act more like network terminals than real computing platforms
(even though they are many times more powerful than old
supercomputers). Building a decentralized system in this fashion is
one way of maintaining a computer that is still intimately personal
while still offering the advantages of network storage and automatic
backups. It allows you to make your own choice about what software to
use and how to use that software, and is therefore free in the true
essence of free software — and of the enlightenment idea of freedom it
is based on. ❦
</p>
<div id="footnotes">
<h2 class="footnotes">Footnotes: </h2>
<div id="text-footnotes">

<div class="footdef"><sup><a id="fn.1" class="footnum" href="#fnr.1" role="doc-backlink">1</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
Also known as &ldquo;the cloud&rdquo;. Sending your data to another person
requires you trusting them to never get cracked or do anything
malicious with your data themselves.
</p></div></div>

<div class="footdef"><sup><a id="fn.2" class="footnum" href="#fnr.2" role="doc-backlink">2</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
When I say low-power I mean it, it only has 4Gb of <span class="small-caps">ram</span> and 128Gb
of storage. I could probably get a machine of similar performance
second hand for free.
</p></div></div>

<div class="footdef"><sup><a id="fn.3" class="footnum" href="#fnr.3" role="doc-backlink">3</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
My home internet connection is very unreliable, and suffers from
intermittent spots of downtime.
</p></div></div>

<div class="footdef"><sup><a id="fn.4" class="footnum" href="#fnr.4" role="doc-backlink">4</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
Moving between machines that are all connected to the network is
almost seamless and instantaneous, but even setting up a new computer
(after purchasing it or wiping the disk) takes only perhaps an
hour. After that using the machine is once again as simple as using
any other perfectly tailor-made computing device that I own.
</p></div></div>


</div>
</div>
]]></description>
  <category><![CDATA[technology]]></category>
  <category><![CDATA[emacs]]></category>
  <link>https://joarvarndt.se/decentralized-machines.html</link>
  <guid>https://joarvarndt.se/decentralized-machines.html</guid>
  <pubDate>Fri, 14 Nov 2025 00:00:00 +0100</pubDate>
</item>
<item>
  <title><![CDATA[Web browsing in Emacs]]></title>
  <description><![CDATA[
 <h2 class="post-subtitle"></h2>
<nav id="table-of-contents" role="doc-toc">
<h2>Table of Contents</h2>
<div id="text-table-of-contents" role="doc-toc">
<ul>
<li><a href="#org1656d32">Why would you want web browsing in a text editor?</a></li>
<li><a href="#org2cf14c7">The Emacs Web Wowser (eww)</a></li>
<li><a href="#org1f6b1df">w3m</a></li>
<li><a href="#org8912e8c">Non-text based</a>
<ul>
<li><a href="#orgb272a78">Xwidgets</a></li>
<li><a href="#orga58826a"><span class="small-caps">eaf</span></a></li>
</ul>
</li>
</ul>
</div>
</nav>
<div id="outline-container-org1656d32" class="outline-2">
<h2 id="org1656d32">Why would you want web browsing in a text editor?</h2>
<div class="outline-text-2" id="text-org1656d32">
<p class="dcap">
Emacs has a tendency to try and absorb all user-facing interactions I
have with a computer. Some people seem able to separate &ldquo;Emacs stuff&rdquo;
— like programming or using org-mode for note taking — but Emacs&rsquo;
extendability makes me want to use it for everything. For a long time
I have only really needed four different tools to do any kind of work
at a computer:
</p>

<ol class="org-ol">
<li><span class="small-caps">gnu</span> Emacs (with my personal config).</li>
<li>Tailscale to connect to my other machines.</li>
<li>Syncthing so that I have local access to my files<sup><a id="fnr.1" class="footref" href="#fn.1" role="doc-backlink">1</a></sup>.</li>
<li>A web browser (usually Firefox).</li>
</ol>

<p>
Quickly getting these four things up and running is usually my first
priority when setting up a new machine, and they require different
amounts of work. Critically Firefox requires a <span class="small-caps">gui</span> environment in
order to run, but it&rsquo;s really quite unnecessary to get a desktop
environment or tiling window manager up and running — and dealing with
their conflicting keybinds — when all I&rsquo;m going to be doing is working
in Emacs perhaps 80% of the time, finding information or reading docs
in Firefox 15% of the time, and using a stray terminal the remaining
5% (something I can easily replace with one of Emacs&rsquo; many terminal
and shell solutions). This is why I like using <code>exwm</code><sup><a id="fnr.2" class="footref" href="#fn.2" role="doc-backlink">2</a></sup>. Rather than
using Emacs&rsquo; window manager capabilities to manage all your X windows
it allows you to stay continually within Emacs and just treat any
stray non-Emacs <span class="small-caps">gui</span> programs within the same system. The solution then
seems to try and subsume web browsing into my preëxisting
workflow. There are many solutions to this, but I prefer ones that
work with <i>text</i> as the primary medium as that is what Emacs is best
oriented to work with.
</p>
</div>
</div>
<div id="outline-container-org2cf14c7" class="outline-2">
<h2 id="org2cf14c7">The Emacs Web Wowser (eww)</h2>
<div class="outline-text-2" id="text-org2cf14c7">
<p>
<code>eww</code> is probably the most well-known of Emacs&rsquo; web browsing solutions,
chiefly because it comes included with it. It is also the one I have
the most experience with. I first came across <code>eww</code> as a consequence of
reading about all of the crazy features included in Emacs by default
like Tetris and Gnus. This isn&rsquo;t very surprising; web browsers are
some of the largest ubiquitous user-facing applications, so the fact
that Emacs ships with one as a tangential feature is very
surprising. However, these visions of browsing the web are often
quickly crushed when one uses <code>eww</code> for the first time. It does not load
any <span class="small-caps">css</span>, so websites do not look like one is accustomed to, and a lot
of javascript functionality is non-functional.
</p>

<p>
I expect this experience — or at least something like it — to be
somewhat universal amongst those who have even tried using <code>eww</code>. The
modern web is built around these technologies, and going without them
might seem almost impossible. But there is a place for <code>eww</code> in a modern
workflow. The strength of Emacs is its power for <i>working with text</i>,
and most media I interact with in a web browser <i>is</i> text. Emacs then is
really the perfect environment for this. Reading and rewriting the
content of web pages side-by-side using the same key-chords and
user-interface allows for minimal context friction. But there are
serious downsides, primarily ugly formatted headers and <i>images</i>. Most
of the time <code>eww</code> can figure out the main readable content using the
<code>eww-readable</code> function, bound to <code>R</code> by default. It&rsquo;s meant to strip out
long &ldquo;navigation menus and the like&rdquo;. In my experience it is either
hit or miss. For some web pages like <a href="https://en.wikipedia.org/wiki/French_Revolution">wikipedia</a> it seems to work well
(but only for some pages), but for others like <a href="https://github.com">github</a> it just strips
out the entire page. Thankfully it is bound to a convenient key and
its easy to switch between the two views quickly. Images are probably
one of the first things that stops people from using <code>eww</code>, with large
ones causing the site to jump around as they cover the whole screen
and then disappear. I solved this using <a href="https://github.com/jdtsmith/ultra-scroll">ultra-scroll</a>, which provides
scrolling smoother than you could ever imagine in Emacs. It also
allows you to scroll intuitively over images, rendering them as you
would expect in a traditional browser like Firefox. With a slow
network connection <code>eww</code> can have some problems with blocking, but this
can be remedied by setting <code>eww-retrieve-command</code>:
</p>

<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span class="org-keyword">setq</span> eww-retrieve-command
      '(<span class="org-string">"chromium"</span> <span class="org-string">"--headless"</span> <span class="org-string">"--dump-dom"</span>))
</pre>
</div>

<p>
<code>eww</code> is written by <a href="https://lars.ingebrigtsen.no">Lars Ingebrigtsen</a> of <code>gnus</code> fame. It uses the <code>shr</code>
(simple <span class="small-caps">html</span> Renderer) program written in elisp to render <span class="small-caps">html</span>. He
originally wrote <code>shr</code> to read <code>elfeed</code> entries in Emacs and <code>eww</code> is merely
the addition of browsing (or wowsing) capability built on top of
it. <code>shr</code>&rsquo;s elisp nature is why it can sometimes struggle with
complicated site layouts, but in my experience it is usually fast
enough, especially with native compilation.
</p>

<p>
Generally <code>eww</code> can be surprisingly powerful, but most of its power
(like Emacs itself) comes from its tight integration with other
tooling and extensibility with elisp, rather than any amazing workflow
it has built for you in advance. There is very little to learn, but a
lot to master.
</p>
</div>
</div>
<div id="outline-container-org1f6b1df" class="outline-2">
<h2 id="org1f6b1df">w3m</h2>
<div class="outline-text-2" id="text-org1f6b1df">
<p>
<code>w3m</code> can some sense be seen as the &ldquo;hardcore&rdquo; version of text-based web
browsing in Emacs. <code>w3m</code> relies on the eponymous <span class="small-caps">tui</span> program to render
web pages in a way similar to <i>Lynx</i>, allegedly the world&rsquo;s oldest
continually-maintained web browser. <code>w3m</code> even comes with lynx bindings
by default, although you can also change them to the included
&ldquo;info-like&rdquo; ones. It allows for tabs, bookmarks, and other features
one would expect in a modern browser. It also relies on interpreting
the raw <span class="small-caps">html</span> to format the page, rather than rendering <span class="small-caps">css</span>. Like <code>eww</code>
it also does not support javascript. Like I alluded to earlier, this
is both a blessing and a curse, and reading just straight text can be
very nice, both from a therapeutic minimalist way and a way to
minimize context-switching. It is also nice and async by default,
since it uses an external binary to fetch websites, not that it takes
very long to load to begin with since it&rsquo;s not running any heavy
javascript. One nice difference between <code>w3m</code> and <code>eww</code> is also that
the arrow keys navigate to the next link in the page by default, and
the text in the buffer will resize itself whenever the buffer is
resized<sup><a id="fnr.3" class="footref" href="#fn.3" role="doc-backlink">3</a></sup>, something that is very handy if you&rsquo;re using a package
like <a href="https://github.com/roman/golden-ratio.el">golden-ratio</a> that
resizes windows depending on focus.
</p>
</div>
</div>
<div id="outline-container-org8912e8c" class="outline-2">
<h2 id="org8912e8c">Non-text based</h2>
<div class="outline-text-2" id="text-org8912e8c">
<p>
While I prefer text-based browsers that fit more seamlessly into the
rest of Emacs, there are other solutions for more traditional browser
experiences.
</p>
</div>
<div id="outline-container-orgb272a78" class="outline-3">
<h3 id="orgb272a78">Xwidgets</h3>
<div class="outline-text-3" id="text-orgb272a78">
<p>
Since version 25 Emacs has had the ability to be compiled with
xwidgets support, and to render complete web pages through webkit. To
do this merely add the <code>--with-xwidgets</code> flag to Emacs when compiling,
and then run <code>M-x xwidget-webkit-browse-url</code> to surf the web! Sadly this
doesn&rsquo;t work very well at the moment, as you&rsquo;ll quickly realize if you
were to do the above. There is apparently a bug in the xwidget library
<code>webkitgtk</code> that causes Emacs to abort. Worse yet its status is <code>wontfix</code>
since <span class="small-caps">gnu</span> Emacs seems to be the only program affected by it thanks to
its old and strange ways of doing things. Upon crashing Emacs links to
a <i>22 year old</i> <a href="https://gitlab.gnome.org/GNOME/gtk/-/issues/221">bug
report</a> that had its last message sent five years ago, so I&rsquo;m not
exactly holding out hope (but maybe a good project to work on for
someone?). It seems to work with version 2.40 of <code>webkitgtk</code> so try
and use that if you&rsquo;re having issues. Sadly I have not gotten it to
work but I keep seeing people mentioning xwidgets as an option so it
might work on some machines.
</p>
</div>
</div>
<div id="outline-container-orga58826a" class="outline-3">
<h3 id="orga58826a"><span class="small-caps">eaf</span></h3>
<div class="outline-text-3" id="text-orga58826a">
<p>
Getting a non-text browser in the text-based environment of Emacs
requires working around Emacs&rsquo; systems. <span class="small-caps">eaf</span> (Emacs Application
Framework) does this through creating an exterior python system that
then hooks into Emacs to run a number of programs, chief among them a
webkit-based browser.
</p>

<p>
The largest problem I have with the <span class="small-caps">eaf</span>&rsquo;s browser is not really with
the browser itself, although it is a bit unstable, but instead with
the <span class="small-caps">eaf</span> itself. Being part of this large group of packages that feel
very external to Emacs they are troublesome to install and maintain as
part of a workflow. Installing <span class="small-caps">eaf</span> (something you&rsquo;re probably only
doing for the browser) asks you individually if you&rsquo;d like to install
things like a git client, system monitor, file browser, terminal,
multiple demos, and <a href="https://github.com/orgs/emacs-eaf/repositories">numerous other things</a>. Some of these things <i>are</i>
impressive and useful, but I&rsquo;d rather explicitly say what I&rsquo;d <i>like</i> to
install instead of having a Y/N on each program. Imagine having to do
that for every <span class="small-caps">elpa</span> package when first launching Emacs! <span class="small-caps">eaf</span> is of
course nowhere near that level, but it&rsquo;s still a baffling design
decision. It also makes it way less portable, since I can&rsquo;t describe
what <span class="small-caps">eaf</span> programs I want to install (although I can for which ones I
want to <i>use</i>) in a declarative way. It also has a few issues with
javascript that feel like deal-breakers for a graphical browser, I&rsquo;d
rather go all-the-way with a text-based browser like <code>eww</code> or use a
fully functional graphical browser like firefox. ❦
</p>
</div>
</div>
</div>
<div id="footnotes">
<h2 class="footnotes">Footnotes: </h2>
<div id="text-footnotes">

<div class="footdef"><sup><a id="fn.1" class="footnum" href="#fnr.1" role="doc-backlink">1</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
I can use tailscale to edit the files remotely using <code>TRAMP</code>, but
that is usually pretty slow since my home network is very
unreliable. Much easier to just sync &ldquo;asynchronously&rdquo; when the network
feels like it.
</p></div></div>

<div class="footdef"><sup><a id="fn.2" class="footnum" href="#fnr.2" role="doc-backlink">2</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
<code>exwm</code> has other issues, namely around multi-monitor setups. They
make sense and are probably sacrifices I would have made had I created
<code>exwm</code>, but I don&rsquo;t really like working with frames instead of
windows. It becomes another layer of friction, even if I&rsquo;m still
working within Emacs.
</p></div></div>

<div class="footdef"><sup><a id="fn.3" class="footnum" href="#fnr.3" role="doc-backlink">3</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
To try and replicate this behaviour in <code>eww</code> you have to run
<code>(eww-reload t)</code>, by default bound to <code>C-u g</code>, to refresh the buffer and
reformat it. You can probably run it in a hook whenever you resize
windows, but I don&rsquo;t care to do that.
</p></div></div>


</div>
</div>
]]></description>
  <category><![CDATA[emacs]]></category>
  <link>https://joarvarndt.se/eww.html</link>
  <guid>https://joarvarndt.se/eww.html</guid>
  <pubDate>Mon, 12 May 2025 00:00:00 +0200</pubDate>
</item>
<item>
  <title><![CDATA[A Cohesive Note-taking and Academic Workflow in Emacs]]></title>
  <description><![CDATA[
 <h2 class="post-subtitle"></h2>
<nav id="table-of-contents" role="doc-toc">
<h2>Table of Contents</h2>
<div id="text-table-of-contents" role="doc-toc">
<ul>
<li><a href="#org72cea53">Why Emacs?</a></li>
<li><a href="#orgc7f989a">Mathematics in Emacs</a></li>
<li><a href="#org122ecab">Humanities and the social sciences</a></li>
<li><a href="#orgda08850">Deliverables</a>
<ul>
<li><a href="#org35ceb03">Group work</a></li>
</ul>
</li>
<li><a href="#org9e7b7bd">Conclusion</a></li>
</ul>
</div>
</nav>
<div id="outline-container-org72cea53" class="outline-2">
<h2 id="org72cea53">Why Emacs?</h2>
<div class="outline-text-2" id="text-org72cea53">
<p class="dcap">
I have been using <span class="small-caps">gnu</span> Emacs for about three years now. I initially
began using it after completing a semester of introductory programming
classes exclusively in <span class="small-caps">gnu</span> Nano, with a series of shell scripts to
compile and run <code>C#</code> code, and to set up a trio of terminals; one for
code editing, one for compilation, and one to actually run the <span class="small-caps">cli</span>
program I was writing. I had practically created my own little system
for terminal multiplexing. This might sound like hell, and in
hindsight it was. I was not even aware of some of the abilities of
nano to perform syntax highlighting, display line numbers, indent
lines <i>et cetera</i>. I merely needed something quickly to write text in,
and was horrified at my classmates who had to sit idly and wait for
visual studio to start or restart after crashing, it did not help that
visual studio was not even available in platform of my choice. In the
beginning I only needed to write short programs, simple loops, input
and output and the like, and so the simplicity of nano was not in any
way a burden — in some ways it was even a boon due to its quick
startup time and lack of clunky <span class="small-caps">ui</span>. But eventually I found it annoying
having to create and resize my layout of terminals and writing long
commands to get Microsoft&rsquo;s Windows-centric tooling to compile on
Linux became a chore. So I created little scripts to optimize my
workflow. Nothing incredibly complex mind you, just little fixes here
and there. When what is called &ldquo;fall break&rdquo; in Sweden came around I
decided to ditch Nano entirely. I had friends who used Vim, but being
a staunch hipster I decided I couldn&rsquo;t copy them, at least not without
trying the alternatives.
</p>

<p>
And so I started out with <span class="small-caps">gnu</span> Emacs. The approach of an environment I
could extend <i>in-situ</i>, rather than having to deal with a multitude of
different tools obviously appealed to me greatly, having done so
earlier using shell scripts. I completed my assignments much faster
than I was expected to, and used the extra time in class to read <a href="https://www.gnu.org/software/emacs/manual/html_node/eintr/index.html">An
Introduction to Programming in Emacs Lisp</a> from within Emacs, making me
more and more inclined to extend and shape Emacs to my own
needs. Eventually I found out about <a href="https://orgmode.org/">org-mode</a> and started to use it for
very simple notes, quickly jotting down grocery list and project
outlines. The big threshold came when I discovered the in-built
functionality for \(\LaTeX\) exports. I had some early encounters with
latex, but most of my knowledge was limited to what it was
conceptually and how to write <code>\frac{}{}</code>. However, the default <code>article</code>
class that is used when exporting from org-mode looks very nice, at
least compared to what I was writing in LibreOffice or Google Docs. It
is of course possible to get a similar quality in output from a
<span class="small-caps">wysiwyg</span><sup><a id="fnr.1" class="footref" href="#fn.1" role="doc-backlink">1</a></sup> editor, but the amount of time you&rsquo;d have to put in to do
so is much larger than simply writing the text in org-mode and
pressing <code>C-c C-e l p</code>. This of course does not have any impact on the
quality of output, but as a fan of typography I like to think that a
nicely formatted document enhances ones Aristotelian <i>ethos</i>, in that
your credibility as a writer is improved in the eyes of the
reader. Emacs therefore became relevant in not just my programming
classes and microcomputer classes, but also all classes that involved
some sort of essay or technical writing — Swedish, English, religious
studies, history, engineering, and management. But there were two main
subject that took up a considerable portion of my time where I had to
put my cohesive Emacs workflow aside and resort to traditional
techniques: physics and mathematics.
</p>
</div>
</div>
<div id="outline-container-orgc7f989a" class="outline-2">
<h2 id="orgc7f989a">Mathematics in Emacs</h2>
<div class="outline-text-2" id="text-orgc7f989a">
<p>
For taking notes I started out with a simple <code>notes.org</code> file,
separating subject and topics organically with headers. I would
recommend other to do the same. Initially, simply writing things down
is the goal, and any optimisations will likely result in a <a href="https://xkcd.com/1205/">net loss</a>. I
was inspired by Gilles Castel&rsquo;s next-to famous <a href="https://castel.dev/post/lecture-notes-1/">series</a> of blog posts on
his note taking in LaTeX and vim, particularly his emphasis on &ldquo;no
delay [being] acceptable&rdquo;. Of course, there are significant deviations
in mine and Castel&rsquo;s approaches and, to be perfectly honest, I think
his notes are of a far superior quality. The primary difference is in
medium; while the mathematics are written in latex, I prefer to write
prose in the much lighter syntax of org mode or markdown, no <code>\emph</code> for
me. Instead, I use <code>org-latex-preview</code> and <code>org-fragtog</code> to display latex
inline and use the org documents themselves as notes instead of
exporting them to <span class="small-caps">pdf</span>. Here is an example of a quick step-by-step way
to solve first order differential equations using the integrating
factor:
</p>


<figure id="org6307b2f">
<img src="https://joarvarndt.se/IntegerandeFaktor.png" alt="IntegerandeFaktor.png">

<figcaption><span class="figure-number">Figure 1: </span>Image detailing the appearance of a section of latex and prose.</figcaption>
</figure>

<p>
While Karthink has <a href="https://karthinks.com/software/latex-input-for-impatient-scholars/#fnref:5">shown</a> that you absolutely do not need to rely on
writing snippets as Castel does, I still take that approach. Karthink
relies heavily on <a href="https://www.gnu.org/software/auctex/">auctex</a>, an amazing suite for writing latex in Emacs,
but most auctex functionality can not be used directly in
org-mode. <a href="https://github.com/cdominik/cdlatex">cdlatex</a>, by the same author as org-mode, is however very
useful through the <code>org-cdlatex-mode</code> minor mode. It allows for
auto-completion of commonly written things like \(^{\text{super}}\) /
\(_{\text{sub}} \text{-scripts}\) and Greek letters. It also creates a
&ldquo;just press tab whenever you want to continue writing&rdquo; workflow that
will move point in or out of delimiters and complete symbols. This
combined with a liberal set of custom expanding templates using
<a href="https://github.com/joaotavora/yasnippet">yasnippet</a> creates a fast and coherent system since yasnippet also uses
<code>TAB</code> as a key by default, meaning that you can spam it throughout
writing, only thinking about the math conceptually as you&rsquo;re listening
to the lecturer.
</p>

<p>
But Emacs is not limited to writing mathematics merely in a
documentary fashion, but also in a practical one. While theoretical
mathematics operate on the syntax of math itself (algebraically),
physics is often times interested in the actual values of the
operations. For this I often quickly wrote mathematics in polish
notation directly, also known as Emacs lisp. I find algebra difficult
in polish notation, and so I usually do it in latex first, only
performing the last numerical calculation in lisp.
</p>


<figure id="orga2c8fe7">
<img src="https://joarvarndt.se/LatexPhysics.png" alt="LatexPhysics.png">

<figcaption><span class="figure-number">Figure 2: </span>Algebra being written in latex, while an org-mode elisp block performs the final calculation to 91°C.</figcaption>
</figure>

<p>
This is what I would call the &ldquo;killer app&rdquo; of org-mode compared to
other note taking applications like obsidian or pure \(\TeX\)
files. Being able to instantly tap into a programming language is
really powerful, but it also <i>feels</i> very powerful, even when doing
trivial things. Quickly being able to jot down numerical calculations
(and having them written down for future reference) is quite useful.
While I am sure one can write notes in Jupyter notebooks and other
computational documents I have yet to hear of someone do
this<sup><a id="fnr.2" class="footref" href="#fn.2" role="doc-backlink">2</a></sup>. Emacs&rsquo; configurability means that one can easily adapt it to
one&rsquo;s own needs rather than either writing your own incomplete tooling
or learning someone else&rsquo;s workflow.
</p>
</div>
</div>
<div id="outline-container-org122ecab" class="outline-2">
<h2 id="org122ecab">Humanities and the social sciences</h2>
<div class="outline-text-2" id="text-org122ecab">
<p>
After high school I have taken a break from the hard sciences and
studied a few different subjects at Stockholm University and the
Swedish Defence University. What strikes me as fundamentally different
is that while mathematics builds on itself very clearly, where you
directly use earlier knowledge to explore new topics, the social realm
is a lot more &ldquo;flat&rdquo;. One can jump directly into Foucault&rsquo;s
postmodernism or Hegel&rsquo;s Phenomenology and, while of course missing
valuable context, still enjoy a degree of understanding. Comparatively
it is quite difficult to get any sort of a grasp for quantum
chromodynamics without firm knowledge of the structure of the atom. I
also felt that studying depended much more on obtaining a breadth of
ideas and perspectives rather than sitting down and mastering whatever
new topic the lecture had covered. This then called for a radically
different approach.
</p>

<p>
I ditched my former monolithic &ldquo;one large file&rdquo; approach and instead,
somewhat reluctantly I admit, began using <a href="https://www.orgroam.com/">Org roam</a>. I was critical
toward the preaching I observed being done by users of various
Zettelkästen systems and felt like the idea of a &ldquo;second brain&rdquo;
encompassing all your knowledge were useless. Having used the system
for almost a year now I still feel the same way. It is quite useful to
be able to link ideas, since broad concepts and actors often show up
in multiple areas<sup><a id="fnr.3" class="footref" href="#fn.3" role="doc-backlink">3</a></sup>.
</p>


<figure id="orgd8a5e56">
<img src="https://joarvarndt.se/ui-graph.png" alt="ui-graph.png">

<figcaption><span class="figure-number">Figure 3: </span>My org-roam-ui appearence the morning of 2025-02-10, after roughly 9 months of use. I find the graph useless in practice, but fun to see develop. It is still a net-positive in my life.</figcaption>
</figure>

<p>
I also took inspiration from Gregory Stein to create an org-mode
<a href="https://cachestocaches.com/2020/3/org-mode-annotated-bibliography/">bibliography</a> that combines notes of books and articles with their
respective <code>bibtex</code> entries. Here I am back to the monolithic file
approach, with each book or article read merely separated into
different broad categories<sup><a id="fnr.4" class="footref" href="#fn.4" role="doc-backlink">4</a></sup>. I have quite a backlog of saved <code>.pdf</code>
files that I would like to convert to this new bibliography, but I do
not have the time to do it all manually. To start I instead just asked
an <span class="small-caps">llm</span> to convert my hand-written citations for coursework into <code>bibtex</code>
entries and sorted them into the file. I will let it grow organically
from there.
</p>


<figure id="orgf8cffab">
<img src="https://joarvarndt.se/bibliography.png" alt="bibliography.png">

<figcaption><span class="figure-number">Figure 4: </span>A list of org-mode headers separating my topics, with the ones in &ldquo;Nuclear Weapons&rdquo; and &ldquo;Economics&rdquo; open, also showing the summary of <i>The Economic Weapon: The Rise of Sanctions as a Tool of Modern War</i>.</figcaption>
</figure>
</div>
</div>
<div id="outline-container-orgda08850" class="outline-2">
<h2 id="orgda08850">Deliverables</h2>
<div class="outline-text-2" id="text-orgda08850">
<p>
Academia is in the end a forum for the exchange of new ideas, and the
most efficient mode for the spread of ideas <a href="https://graydon2.dreamwidth.org/193447.html">is text</a>. While we may see
some change in the structure of academic writing, particularly for
those less experienced, as a result of large-scale <span class="small-caps">llm</span> usage I doubt
that text will be dethroned as the primary mode of communication for
human society, but this is really a subject too deep to cover in a
text about using Emacs as a student. For the time being writing
reports and essays is still relevant to one&rsquo;s daily life. I of course
do this in org-mode, simply adding some latex headers to the document
when I am done:
</p>

<div class="org-src-container">
<pre class="src src-org"><span class="org-org-document-info-keyword">#+title:</span> <span class="org-org-document-title">The Meiji Restoration and Modernisation of Japan
</span><span class="org-org-document-info-keyword">#+subtitle:</span> <span class="org-org-document-info">IR1.1 Seminar 1 Preparatory Assignment
</span><span class="org-org-document-info-keyword">#+author:</span> <span class="org-org-document-info">Joar von Arndt
</span><span class="org-org-meta-line">#+options: toc:nil</span>
<span class="org-org-meta-line">#+latex_header: \usepackage[a4paper, top=2in, bottom=2in, left=1.7in, right=1.7in]{geometry}</span>
<span class="org-org-meta-line">#+latex_header: \usepackage[activate={true,nocompatibility},final,tracking=true,kerning=true,spacing=true,factor=1100,stretch=10,shrink=10]{microtype}</span>
<span class="org-org-meta-line">#+latex_header: \usepackage[T1]{fontenc}</span>
<span class="org-org-meta-line">#+latex_header: \usepackage{lmodern}</span>
</pre>
</div>

<p>
For longer assignments I usually use a two-column layout. I tweak the
values for the margins when I am done writing and ready to submit or
print so that the text nicely fits the page, since I think it looks
more &ldquo;complete&rdquo; and planned out that way. Otherwise I just write
plainly in org-mode, using footnotes for citations.
</p>
</div>
<div id="outline-container-org35ceb03" class="outline-3">
<h3 id="org35ceb03">Group work</h3>
<div class="outline-text-3" id="text-org35ceb03">
<p>
I do not have a good system for incorporating this to group work,
since most people do not know org-mode (or even markdown!) and
collaboration in real-time can be tricky. If I worked with technically
minded people I might use <code>git</code>, but even it requires some setup and
work. Instead I use — and would recommend others do too — Typst, and
its corresponding web app <a href="https://typst.app/">typst.app</a>. It has easy collaboration,
beautiful real-time previews for all users and most importantly of
all, a markup that is far nicer than latex&rsquo;s. I used it for my
<i>gymnasiearbete</i> (diploma project) and found it to be a lovely
experience. I would recommend anyone thinking about using overleaf or
the like to instead use typst. The only reason I don&rsquo;t do the same is
because I still prefer the syntax-light approach of org-mode.
</p>

<p>
For presentations I am a fan of suckless&rsquo; <a href="https://tools.suckless.org/sent/">sent</a>, both because it places
emphasis on me as the presenter but also because you can create
presentations ludicrously fast. That allows me to iterate quickly and
spend more time thinking about the actual content rather than fiddling
with what&rsquo;s going to be on the screen behind me.
</p>
</div>
</div>
</div>
<div id="outline-container-org9e7b7bd" class="outline-2">
<h2 id="org9e7b7bd">Conclusion</h2>
<div class="outline-text-2" id="text-org9e7b7bd">
<p>
Emacs is a tremendously useful tool, and I hope that this either
serves as a motivation for beginning to use Emacs (showing of what can
be done in it) or to inspire someone else to take inspiration in their
own daily activities. I was prompted to writing this by Daniel
Pinkston&rsquo;s talk at <a href="https://emacsconf.org/2024/talks/students/">EmacsConf 2024</a>, and saw an earlier version of
myself in him. I particularly want to emphasize that one approach does
not fit all, not even when it comes to personal preference. Some
lifestyles/subjects require different techniques, and so you should
both experiment and iterate continuously to see what works for
you. This is in-line with the Emacs philosophy of complete and instant
extensibility, and so I therefore could not imagine a better platform
to be writing or taking notes in. ❦
</p>
</div>
</div>
<div id="footnotes">
<h2 class="footnotes">Footnotes: </h2>
<div id="text-footnotes">

<div class="footdef"><sup><a id="fn.1" class="footnum" href="#fnr.1" role="doc-backlink">1</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
What-you-see-is-what-you-get 
</p></div></div>

<div class="footdef"><sup><a id="fn.2" class="footnum" href="#fnr.2" role="doc-backlink">2</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
Are you someone who does this? Feel free to email me about this
and tell me about your workflow, I am always interested in hearing how
other people perform these tasks.
</p></div></div>

<div class="footdef"><sup><a id="fn.3" class="footnum" href="#fnr.3" role="doc-backlink">3</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
Like Marxism! Is there any field where there hasn&rsquo;t been an
attempt at the application of Marxism? There&rsquo;s even <a href="https://en.wikipedia.org/wiki/Mathematical_manuscripts_of_Karl_Marx">Marxist
mathematics</a>.
</p></div></div>

<div class="footdef"><sup><a id="fn.4" class="footnum" href="#fnr.4" role="doc-backlink">4</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
Each entry does however have an org-id so that it can link and be
linked to by other org-roam nodes.
</p></div></div>


</div>
</div>
]]></description>
  <category><![CDATA[university]]></category>
  <category><![CDATA[emacs]]></category>
  <link>https://joarvarndt.se/notes.html</link>
  <guid>https://joarvarndt.se/notes.html</guid>
  <pubDate>Mon, 10 Feb 2025 00:00:00 +0100</pubDate>
</item>
<item>
  <title><![CDATA[Colophon]]></title>
  <description><![CDATA[
 <h2 class="post-subtitle"></h2>
<nav id="table-of-contents" role="doc-toc">
<h2>Table of Contents</h2>
<div id="text-table-of-contents" role="doc-toc">
<ul>
<li><a href="#orgf216832">Philosophy</a></li>
<li><a href="#orgb159c19">Fonts</a></li>
<li><a href="#org04095b9">Inspirations</a></li>
<li><a href="#orgfd0cfd0">Static website generation</a>
<ul>
<li><a href="#org9ccc948">Sidenotes</a></li>
<li><a href="#org86ac22a">Small caps</a></li>
</ul>
</li>
<li><a href="#org5210a9c">Hosting</a></li>
</ul>
</div>
</nav>
<hr>

<p class="dcap">
I think every personal blog that is somewhat custom built should have
documentation written on its design philosophy and implementation. I
see this as an extension of the free-software ideal; you should not
only be <i>allowed</i> but also <i>able</i> to extent and modify another program to
your needs. It is also useful as a way to discover other peoples&rsquo;
inspirations and influences, as well as finding unique sources of
inspiration for your own website.
</p>
<div id="outline-container-orgf216832" class="outline-2">
<h2 id="orgf216832">Philosophy</h2>
<div class="outline-text-2" id="text-orgf216832">
<p>
This site exists in the overlap between a landing page, a traditional
blog, a <i>hypomnemata</i>, and what is called a &ldquo;digital garden&rdquo;. I
originally used the domain merely to host services and small programs
over the open internet, and to have a place to point to and say &ldquo;this
is where you can find me online&rdquo;. I started writing things because I
found that certain topics kept coming up in discussion with the people
around me, and I wanted to summarise my thoughts on them. A website
was the perfect place for that.
</p>

<p>
I write many pieces concurrently, and publish them either when I feel
they are finished or when my motivation has drained and I feel like I
need to &ldquo;just get it out there&rdquo;. In some cases I also get a large
boost of energy and write a post in even just a day or two, although I
often try and stop myself from publishing immediately in order to let
my thoughts simmer for a bit.
</p>

<p>
I then expand on topics if I come up with new perspectives or need to
respond do a new development. In this way posts exist in a space
between being mere ephemeral blog posts that were written at a given
time and a continually rewritten and updated page. I try to avoid
changing the main theses of a post after initial publication — even if
I have come to disagree with myself over time — and so they still
reflect the version of myself when they were first written.
</p>

<p>
The website is written in <a href="https://www.gnu.org/software/emacs/"><span class="small-caps">gnu</span> Emacs</a> and in <a href="https://orgmode.org/">org mode</a>, because I find the
markup to be intuitive, natural, and easy.<sup><a id="fnr.1" class="footref" href="#fn.1" role="doc-backlink">1</a></sup>
</p>
</div>
</div>
<div id="outline-container-orgb159c19" class="outline-2">
<h2 id="orgb159c19">Fonts</h2>
<div class="outline-text-2" id="text-orgb159c19">
<p>
The primary font used is Sabon. Code uses the <a href="https://github.com/flowchartsman/greybeard">Greybeard</a> font. The
headers are all typeset in the beautiful <a href="https://www.virgileflores.com/davinci">DaVinci</a> by the <span class="small-caps">nyc</span> creative
bureau <i>Virgile Flores</i>. For 中文 (and other <span class="small-caps">cjk</span> languages) I use <a href="https://fonts.adobe.com/fonts/adobe-kaiti">Kai Ti</a>
since the default Noto font installed on many devices clashed quite a
lot with the thin serif fonts I otherwise use.
</p>

<p>
I jump quite often between fonts, especially
for the serif font for body text. In this way having a website is
quite useful; it allows me to experiment widely with design in an
actual production environment.
</p>
</div>
</div>
<div id="outline-container-org04095b9" class="outline-2">
<h2 id="org04095b9">Inspirations</h2>
<div class="outline-text-2" id="text-org04095b9">
<p>
I generally took a lot of inspiration from others using the same
tooling as me, as well as from <a href="https://gwern.net">Gwern</a>, <a href="https://maggieappleton.com/">Maggie Appleton</a> and various
other blogs and homepages I have read over the years. The colour
scheme is a slightly adapted version of Protesilaos Stavrou&rsquo;s <a href="https://protesilaos.com/emacs/modus-themes">modus
themes</a> (for the light theme) and the <a href="https://github.com/paradise-theme/paradise">paradise theme</a> (for the
dark). I find them visually pleasing, and the Modus theme is very
accessible to those with impaired vision. I have used them in Emacs
for a long time, and so they fit nicely on my desktop when looking at
my site.
</p>

<p>
The one-rule <span class="small-caps">css</span> implementation of the drop caps is taken from <a href="https://michal.sapka.pl/">Michał
Sapka</a>, while the font files were downloaded from Gwern using a quick
<code>curl</code>-script I had an <span class="small-caps">llm</span> write.<sup><a id="fnr.2" class="footref" href="#fn.2" role="doc-backlink">2</a></sup> The font is &ldquo;Baroque Initials&rdquo;,
more information <a href="https://joarvarndt.se/latex">here</a>. The indented paragraphs were inspired by <a href="https://miroallard.com">Miró
Allard</a>.
</p>

<p>
The little arrows following external links (of which there have been
quite a lot in this section) are from <a href="https://alexwennerberg.com/">Alex Wennerberg</a>, whose simple
design I find admirable. Using email as a comment system was taken
from <a href="https://marcel.io/posts/new-blog-features-hover-cards-comments-library-improvements">Marcel Wichmann</a>.
</p>
</div>
</div>
<div id="outline-container-orgfd0cfd0" class="outline-2">
<h2 id="orgfd0cfd0">Static website generation</h2>
<div class="outline-text-2" id="text-orgfd0cfd0">
<p>
The blog is generated using Bastian Bechtold&rsquo;s <a href="https://github.com/bastibe/org-static-blog">org-static-blog</a>. I have
an <code>elisp</code> file that runs the necessary configuration code and acts like
a declarative configuration for the deployment of the static site. It
looks like this:
</p>

<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span class="org-keyword">setq</span> org-static-blog-publish-title <span class="org-string">"Joar von Arndt"</span>)
(<span class="org-keyword">setq</span> org-static-blog-publish-url <span class="org-string">"https://joarvarndt.se/"</span>)
(<span class="org-keyword">setq</span> org-static-blog-publish-directory <span class="org-string">"~/Documents/blog"</span>)
(<span class="org-keyword">setq</span> org-static-blog-posts-directory <span class="org-string">"~/Documents/blog/posts/"</span>)
(<span class="org-keyword">setq</span> org-static-blog-drafts-directory <span class="org-string">"~/Documents/blog/drafts/"</span>)
(<span class="org-keyword">setq</span> org-static-blog-enable-tags t)
(<span class="org-keyword">setq</span> org-static-blog-enable-og-tags t)
(<span class="org-keyword">setq</span> org-static-blog-image <span class="org-string">"https://joarvarndt.se/vonArndtCrestWhite.png"</span>)
(<span class="org-keyword">setq</span> org-static-blog-use-preview t)
(<span class="org-keyword">setq</span> org-static-blog-no-comments-tag <span class="org-string">"nocomment"</span>)
(<span class="org-keyword">setq</span> org-static-blog-enable-tag-rss t)
(<span class="org-keyword">setq</span> org-static-blog-index-length 6)
(<span class="org-keyword">setq</span> org-static-blog-preview-link-p t)
(<span class="org-keyword">setq</span> org-static-blog-preview-ellipsis <span class="org-string">"&lt;span class=\"ellipsis\"&gt;Continue Reading&lt;/span&gt;"</span>)
</pre>
</div>

<p>
These are all simple configuration values that are unique to
<code>org-static-blog</code>, and where most of the values are themselves unique to
this blog specifically.
</p>

<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span class="org-keyword">setq</span> org-export-with-toc t)
(<span class="org-keyword">setq</span> org-export-with-broken-links t)
(<span class="org-keyword">setq</span> org-export-with-smart-quotes t)
(<span class="org-keyword">setq</span> org-export-with-section-numbers nil)
(<span class="org-keyword">setq</span> org-image-actual-width nil)

<span class="org-comment-delimiter">;; </span><span class="org-comment">For syntax highlighting of code (Like this).
</span>(<span class="org-keyword">setq</span> org-src-fontify-natively t)
(<span class="org-keyword">setq</span> org-html-htmlize-output-type 'css)
(<span class="org-keyword">setq</span> org-src-preserve-indentation t)
</pre>
</div>

<p>
<code>org-static-blog</code> uses org-mode&rsquo;s built-in <span class="small-caps">html</span> export functionality for
much of the &ldquo;dirty work&rdquo;, and these variables are used for all
org-mode exports. The latter part allows Emacs to transform its own
syntax highlighting into <span class="small-caps">css</span> classes that I can then highlight with
<span class="small-caps">css</span> variables depending on dark/light theme. This is all done at the
rendering stage, meaning things like <a href="https://highlightjs.org/">highlight.js</a> are
unnecessary. Without setting these variables Emacs will hard-code the
current Emacs theme colours into the <span class="small-caps">html</span>.
</p>

<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span class="org-keyword">setq</span> org-static-blog-display-git-date t)
(<span class="org-keyword">setq</span> org-static-blog-title-link nil)

(<span class="org-keyword">setq</span> org-static-blog-hidden-directory <span class="org-string">"~/Documents/blog/hidden/"</span>)
</pre>
</div>

<p>
These are variables used in my own <a href="https://codeberg.org/Joar/org-static-blog">custom fork</a> of
<code>org-static-blog</code>. This toggles the display of the &ldquo;last edited&rdquo; date at
the top of the post page, derived from when the <code>.org</code>-file was last
changed. All the original org-mode files are uploaded to the website,
and can be accessed by navigating to
&ldquo;<a href="https://joarvarndt.se/posts/postname.org">https://joarvarndt.se/posts/postname.org</a>&rdquo;.
</p>

<p>
By default <code>org-static-blog</code> renders the post title of each page as a
link pointing to itself. I found this quite distracting as it means
displaying responsive changes whenever the title is hovered over. This
variable thus disables that functionality.
</p>

<p>
The hidden directory acts as a sort of middle-ground between drafts
and posts; I have the drafts directory marked in the <code>.gitignore</code> file
and can therefore not use git to track changes made to files in that
directory, but I do not want pages like <a href="https://joarvarndt.se/subscribe">subscribe</a>, <a href="https://joarvarndt.se/about">about</a>, or the <a href="https://joarvarndt.se/links">link
page</a> to show up in the archive page as a proper &ldquo;post&rdquo;. For this I
use the hidden directory.
</p>

<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span class="org-keyword">setq</span> org-static-blog-preview-start <span class="org-string">"&lt;p class=\"dcap\"&gt;"</span>)
</pre>
</div>

<p>
I have written a function that applies the <code>dcap</code> class to the first
normal paragraph in a post, but adding such a class means that the
default &ldquo;<code>&lt;p&gt;</code>&rdquo; value will match the <i>second</i> paragraph instead of the
first. This change thus needs to be made.
</p>

<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span class="org-keyword">setq</span> org-static-blog-page-header
      <span class="org-string">"&lt;meta name=\"Joar von Arndt\" content=\"Joar von Arndt\"&gt;
       &lt;meta name=\"referrer\" content=\"no-referrer\"&gt;
       &lt;meta name=\"viewport\" content=\"initial-scale=1,width=device-width,minimum-scale=1\"&gt;
       &lt;link href=\"static/style.css\" rel=\"stylesheet\" type=\"text/css\" /&gt;
       &lt;link rel=\"icon\" href=\"static/favicon.ico\"&gt;
       &lt;link rel=\"me\" href=\"https://github.com/JanJoar\" /&gt;
       &lt;link rel=\"me\" href=\"https://gravatar.com/speedilyrunaway0201f99245\" /&gt;
       &lt;link rel=\"pgpkey\" href=\"/key.pub\"&gt;
       &lt;link rel=\"webmention\" href=\"https://webmention.io/joarvarndt.se/webmention\" /&gt;
       &lt;script src=\"static/sidenotes.js\" defer&gt;&lt;/script&gt;
       &lt;script src=\"static/comments.js\" defer&gt;&lt;/script&gt;
       &lt;link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/katex@0.16.33/dist/katex.min.css\" integrity=\"sha384-fgYS3VC1089n2J3rVcEbXDHlnDLQ9B2Y1hvpQ720q1NvxCduQqT4JoGc4u2QCnzE\" crossorigin=\"anonymous\"&gt;
       &lt;script defer src=\"https://cdn.jsdelivr.net/npm/katex@0.16.33/dist/katex.min.js\" integrity=\"sha384-YPHNAPyrxGS8BNnA7Q4ommqra8WQPEjooVSLzFgwgs8OXJBvadbyvx4QpfiFurGr\" crossorigin=\"anonymous\"&gt;&lt;/script&gt;
       &lt;script defer src=\"https://cdn.jsdelivr.net/npm/katex@0.16.33/dist/contrib/auto-render.min.js\" integrity=\"sha384-JKXHIJf8PKPyDFptuKZoUyMRQJAmQKj4B4xyOca62ebJhciMYGiDdq/9twUUWyZH\" crossorigin=\"anonymous\"
       onload=\"renderMathInElement(document.body);\"&gt;&lt;/script&gt;"</span>)

(<span class="org-keyword">setq</span> org-static-blog-post-comments
      <span class="org-string">"&lt;div class=\"comment-by-email\"&gt;
         &lt;form class=\"comment-by-email-form\"&gt;
           &lt;textarea id=\"comment-by-email-textarea\"
             placeholder=\"Write a comment\"&gt;&lt;/textarea&gt;
           &lt;button type=\"submit\"&gt;Send&lt;/button&gt;
         &lt;/form&gt;
       &lt;/div&gt;"</span>)
</pre>
</div>

<p>
This is quite self-explanatory, it formats the header for each page so
that the correct <span class="small-caps">css</span>, javascript, favicons <i>et cetera</i> are loaded. While
the website does make use of javascript I have as an utmost priority
that it should be accessible and readable without it. There are really
only three elements that require javascript:
</p>

<ol class="org-ol">
<li>Comments, who quite simply creates a <code>mailto:</code> -link that is filled
in with the appropriate information (including recipient, subject
header, and content inserted on the website). All of this can of
course be done manually by emailing me the old-fashioned way.</li>
<li>Client-side \(\LaTeX\) rendering using \(\KaTeX\). This should be
possible to render server-side and therefore remove, but I have yet
to build a way to do so using my <span class="small-caps">ssg</span>. A project for the future.</li>
<li>Sidenotes. I cover this further down.</li>
</ol>

<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span class="org-keyword">setq</span> org-static-blog-page-preamble <span class="org-string">"&lt;div class=\"header\" role=\"banner\"&gt;
                                     &lt;a href=\"https://joarvarndt.se/\" class=\"home-link\"&gt;&lt;img id=\"themeImageHeader\" src=\"vonArndtCrestBlack.png\" class=\"header-img\" alt=\"Crest\" width=\"50\"&gt;&lt;/a&gt;&lt;/div&gt;"</span>)

(<span class="org-keyword">setq</span> org-static-blog-page-postamble
      <span class="org-string">"&lt;div id=\"postamble\" class=\"status\"&gt;&lt;div class=\"footer\" role=\"contentinfo\"&gt;
       &lt;div class=\"footer-upper\"&gt;
       &lt;footer-img&gt;&lt;img loading=\"lazy\" class=\"footer-img\" id=\"themeImageFooter\" src=\"Ship-5.svg\" alt=\"Set sail on the sea of knowledge\"&gt;&lt;/footer-img&gt;
       &lt;copyright&gt;&#169; 2026 &lt;span class=\"small-caps\"&gt;ad&lt;/span&gt; / &lt;a href=\"https://en.wikipedia.org/wiki/French_Republican_calendar\"&gt;234 &lt;span class=\"small-caps\"&gt;ar&lt;/span&gt;&lt;/a&gt; Joar von Arndt&lt;/copyright&gt;
        &lt;/div&gt;
        &lt;div class=\"footer-lower\"&gt;
        &lt;nav&gt;
          &lt;ul&gt;
            &lt;li&gt;&lt;a href=\"https://joarvarndt.se/about.html\"&gt;About&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href=\"https://joarvarndt.se/archive.html\"&gt;Archive&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href=\"https://joarvarndt.se/links.html\"&gt;Your next stop&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href=\"https://joarvarndt.se/website.html\"&gt;Colophon&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
        &lt;/nav&gt;

        &lt;nav&gt;
          &lt;ul&gt;
            &lt;li&gt;&lt;a href=\"https://joarvarndt.se/now.html\"&gt;Now&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href=\"https://joarvarndt.se/subscribe.html\"&gt;Subscribe&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href=\"https://joarvarndt.se/contact.html\"&gt;Contact&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href=\"https://webmention.io/joarvarndt.se/webmention\"&gt;Webmentions&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
        &lt;/nav&gt;
    &lt;script src=\"static/theme.js\" defer&gt;&lt;/script&gt;
    &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;"</span>)
</pre>
</div>

<p>
The header and footer of each page. The header is very plain — it only
includes the heraldic achievement that acts as a &ldquo;home&rdquo; link. The
table of contents that appears on some pages (including this one) is a
part of the post itself and is generated by org-mode&rsquo;s export
functionality. It simply moves to the top of the page using <span class="small-caps">css</span> and is
not part of the header.
</p>

<p>
The footer has comparatively quite a lot going on. Its multi-column
design was inspired principally by <a href="https://www.jonashietala.se/">Jonas Hietala</a>, from whom I was also
partly inspired by the choice of using <code>git</code> to track post changes
(although the idea of tracking changes to a post came from Appleton&rsquo;s
&ldquo;planted X time ago&rdquo;). I also chose to prominently display webmentions
as a technology since they are used by an unfortunately few number of
people, and I myself often forget to check if a site does or not when
linking to them.
</p>

<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span class="org-keyword">setq</span> org-static-blog-index-front-matter <span class="org-string">"&lt;site-intro&gt;&lt;p&gt;
      This is the site of Joar Alexander Pablo von Arndt. I write about a
      variety of topics, from coverage of &lt;a href=\"https://joarvarndt.se/eww.html\"&gt;&lt;span class=\"small-caps\"&gt;gnu&lt;/span&gt; Emacs web browsing&lt;/a&gt;, to &lt;a href=\"https://joarvarndt.se/business_cards.html\"&gt;graphic
      design&lt;/a&gt; and &lt;a href=\"https://joarvarndt.se/european-tech.html\"&gt;critiques of industrial policy&lt;/a&gt;. You can &lt;a href=\"https://joarvarndt.se/subscribe.html\"&gt; subscribe here&lt;/a&gt;. If you enjoy anything written here (or disagree with me) feel free to &lt;a href=\"https://joarvarndt.se/contact.html\"&gt;tell me about it&lt;/a&gt;.
      &lt;/p&gt;
      &lt;ul class=\"org-ul\"&gt;
      &lt;li&gt;&lt;a href=\"https://joarvarndt.se/archive.html\" class=\"archive-link\"&gt;All Posts&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
      &lt;p&gt;
      My own personal favorites are the following:
      &lt;/p&gt;

      &lt;ul class=\"org-ul\"&gt;
      &lt;li&gt;&lt;a href=\"https://joarvarndt.se/end-of-history.html\"&gt;&lt;i&gt;The End of History.&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=\"https://joarvarndt.se/email.html\"&gt;&lt;i&gt;Email as a Revolutionary Medium&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=\"https://joarvarndt.se/deepseek.html\"&gt;&lt;i&gt;Deepseek is not a Chinese OpenAI&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;

      &lt;nav id=\"table-of-contents\" role=\"doc-toc\"&gt;
        &lt;h2&gt;&lt;i&gt;Itinerarium&lt;/i&gt;&lt;/h2&gt;
        &lt;div id=\"text-table-of-contents\" role=\"doc-toc\"&gt;
          &lt;ul&gt;
            &lt;li&gt;&lt;a href=\"https://joarvarndt.se/archive.html\"&gt;All Posts&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href=\"https://joarvarndt.se/about.html\"&gt;About&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href=\"https://joarvarndt.se/now.html\"&gt;Now&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href=\"https://joarvarndt.se/links.html\"&gt;Your next stop&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href=\"https://joarvarndt.se/subscribe.html\"&gt;Subscribe&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href=\"https://joarvarndt.se/website.html\"&gt;Colophon&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
        &lt;/div&gt;
      &lt;/nav&gt;
&lt;/site-intro&gt;"</span>)

</pre>
</div>

<p>
This is the hand-crafted <span class="small-caps">html</span> for the index page, that itself has no
corresponding org-mode file. It is generated on each rebuild with this
introduction and a series of posts governed by
<code>org-static-blog-index-length</code>. The <i>itinerarium</i> that acts as a sort of
site-menu is formatted like a custom table of contents for the index
page.
</p>

<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span class="org-keyword">setq</span> org-static-blog-archive-front-matter <span class="org-string">"&lt;picture&gt;
        &lt;source srcset=\"https://joarvarndt.se/bird-butterfly.webp\" type=\"image/webp\"&gt;
        &lt;source srcset=\"https://joarvarndt.se/bird-butterfly.png\" type=\"image/png\"&gt;
        &lt;img src=\"https://joarvarndt.se/bird-butterfly.png\"
          alt=\"A small bird resting amongst the branches, gazing at a flying butterfly.\"
          class=\"pictograph\"&gt;
      &lt;/picture&gt; &lt;hr&gt;"</span>)
</pre>
</div>

<p>
Finally another custom-fork-feature; archive front matter! This can be
used to display anything on the page listing all of the posts, but
here I use it to insert a beautiful illustration that I got from <a href="https://tomchalky.com/">Tom
Chalky</a>.<sup><a id="fnr.3" class="footref" href="#fn.3" role="doc-backlink">3</a></sup>
</p>

<div class="dinkus">
⁂
</div>

<p>
The above lisp code is not just a series of example code snippets, it
is directly the code that is used to build the website!  The text you
are reading right now is written as an org-mode document, and the code
blocks above are exported into a corresponding Emacs lisp file and run
as part of the build process. Because it became annoying to manually
evaluate the above code block every time I wanted to export I wrote a
quick build script, whose contents can easily be embedded<sup><a id="fnr.4" class="footref" href="#fn.4" role="doc-backlink">4</a></sup> into this
post like this:
</p>

<pre class="example" id="orge235d9e">
#+INCLUDE: "~/Documents/blog/build" src emacs-lisp
</pre>

<div class="org-src-container">
<pre class="src src-emacs-lisp">#!/usr/bin/env -S emacs -x

<span class="org-comment-delimiter">;;; </span><span class="org-comment">Code:
</span>
(package-initialize)
(message <span class="org-string">"Initialized package.el"</span>)

(<span class="org-keyword">require</span> '<span class="org-constant">org</span>)
(<span class="org-keyword">require</span> '<span class="org-constant">cal-french</span>)
(<span class="org-keyword">require</span> '<span class="org-constant">htmlize</span>)
(message <span class="org-string">"Loaded libraries"</span>)

(org-babel-tangle-file <span class="org-string">"~/Documents/blog/posts/website.org"</span>)
(load-file <span class="org-string">"~/Documents/blog/posts/website.el"</span>)

(load-file <span class="org-string">"~/programming/org-static-blog/utils.el"</span>)
(load-file <span class="org-string">"~/programming/org-static-blog/org-static-blog.el"</span>)

(org-static-blog-publish)

<span class="org-comment-delimiter">;;; </span><span class="org-comment">build ends here</span>
</pre>
</div>

<p>
This makes use of the very underused scripting capabilities of Emacs
(<code>#!/usr/bin/emacs -x</code>), allowing you to use the power of lisp combined
with Emacs&rsquo; extensive libraries. It also loads my personal <a href="https://codeberg.org/Joar/org-static-blog">fork of
org-static-blog</a> that makes some small opinionated changes (like the
git-edit and french republican dates). The french republican dates are
one of the clearest examples of the usefulness of Emacs as a standard
library — Emacs ships with a library to translate to and from the
french republican calendar.
</p>

<p>
I am a big fan of org-static-blog due to its simplicity<sup><a id="fnr.5" class="footref" href="#fn.5" role="doc-backlink">5</a></sup>,
extensibility (it is just a simple <span class="small-caps">html</span> static site generator) and
obvious org-mode support. That I wrote my own fork is testament to the
great work done by Bechtold. It is incredibly featureful, simple to
read and to modify. If you ever wonder how a given piece of <span class="small-caps">html</span> is
generated you can quickly <code>C-s</code> around in the source code (all of which
is in a single file) between function definitions and implementations.
</p>

<p>
It is also quite fast — the majority of the build script is usually
just start-up time from Emacs loading libraries — but not fast enough
to offer anything like real-time previews. Unless
<code>org-static-blog-publish</code> is called with a prefix argument<sup><a id="fnr.6" class="footref" href="#fn.6" role="doc-backlink">6</a></sup> it will
only re-render those files that have actually changed and thus doesn&rsquo;t
take very long to re-render the site. Only when tinkering with
site-wide <span class="small-caps">html</span> changes (such as for the footer) do I need to re-render
everything, and even then it just takes a few seconds.
</p>

<p>
I used to use <a href="https://gohugo.io/">Hugo</a>, a widely praised static website generator, but it
only has nominal org-mode support and requires a special non-org-mode
<span class="small-caps">yaml</span> frontmatter that I really dislike. When writing a post, I prefer
to leave formatting mostly out of it, and with my main focus on
text. Tinkering with the website&rsquo;s appearance is great fun of course,
but I like to keep the two as separate activities. Keeping them
separate means that if I improve the appearance of a new post all
previous posts also benefit. Writing any sort of special syntax also
brings me out of the experience, and that is partly why I wrote my own
javascript to create sidenotes out of basic pandoc (and therefore
org-mode) style footnotes instead of using tufte-<span class="small-caps">css</span>.
</p>
</div>
<div id="outline-container-org9ccc948" class="outline-3">
<h3 id="org9ccc948">Sidenotes</h3>
<div class="outline-text-3" id="text-org9ccc948">
<p>
The sidenotes are heavily inspired by <a href="https://gwern.net/sidenote">Gwern</a> and <a href="https://edwardtufte.github.io/tufte-css/">Tufte <span class="small-caps">css</span></a>, but the
Gwern <code>sidenotes.js</code> is not portable and seems way too complex for my
needs (it is 1150 lines long!!). In comparison, <a href="https://github.com/JanJoar/pandoc-html-sidenotes">here</a> is the the script
that creates sidenotes. It is merely 70 lines long, including
whitespace and comments. It also allows for easy reading on mobile,
vertical monitors, and <span class="small-caps">js</span>-free browsers, since if the dimensions are
not adequate for displaying sidenotes or the javascript does not run
the content does not disappear and is presented as simple
footnotes.
</p>

<p>
Tufte <span class="small-caps">css</span>&rsquo; sidenotes also appear strange when viewed through
<span class="small-caps">rss</span>-readers or text-based browsers like <a href="https://joarvarndt.se/eww">eww</a>. Moving the text only when
javascript is available preserves the structure of the raw <span class="small-caps">html</span>
documents when viewed without javascript. That Tufte <span class="small-caps">css</span> does not make
use of javascript in the first place is quite admirable, but it is a
shame that doing so breaks many of the applications where javascript
is not available. This is then a deliberate choice of using javascript
to <i>improve</i> accessibility. I could have used pure <span class="small-caps">css</span>/<span class="small-caps">html</span> sidenotes,
but doing so would likely break many non-traditional browsers.
</p>

<p>
I have however taken the liberty of inspiration from Tufte <span class="small-caps">css</span> in the
<span class="small-caps">css</span> of sidenotes and margin notes. Margin notes are written in the
form of an org-mode export block, and so have to be located at the
beginning or end of paragraph.
</p>

<div class="marginnote" id="orgd0a0c66">
<p>
This is how I write a margin note!
</p>

</div>

<pre class="example" id="orgb3b037b">
#+begin_marginnote
This is how I write a margin note!
#+end_marginnote
</pre>

<p>
I can do this since org treats &ldquo;special blocks&rdquo; as a <code>&lt;div&gt;</code> with a
synonymously named <code>marginnote</code> class when exported to <span class="small-caps">html</span>. This can
then be styled however you want using <span class="small-caps">css</span>. Margin notes are usually
not as critical in my mind as foot/sidenotes, since they serve merely
as a general guide to the text rather than an explicit pointed
&ldquo;reference&rdquo;<sup><a id="fnr.7" class="footref" href="#fn.7" role="doc-backlink">7</a></sup>. That&rsquo;s why margin notes are not displayed on mobile
devices. This is an opinionated change from Tufte <span class="small-caps">css</span>&rsquo; approach, where
margin notes are instead treated as unnumbered sidenotes when there is
no margin to display them in. Margin notes are best considered as a
sort of &ldquo;scribble&rdquo; in the margin, and attaching them to any specific
point in the text makes them merely inferior sidenotes.
</p>
</div>
</div>
<div id="outline-container-org86ac22a" class="outline-3">
<h3 id="org86ac22a">Small caps</h3>
<div class="outline-text-3" id="text-org86ac22a">
<p>
It is typographical best practice to typeset segments of capitalised
text in &ldquo;small caps&rdquo; that are the same height as lowercase text. (<span class="small-caps">like</span>
<span class="small-caps">this</span>). If you have a keen eye you will no doubt have noticed this this in the many acronyms used throughout this colophon.<sup><a id="fnr.8" class="footref" href="#fn.8" role="doc-backlink">8</a></sup> This is provided by a <span class="small-caps">css</span> option:
</p>

<div class="org-src-container">
<pre class="src src-css"><span class="org-css-selector">span.small-caps</span> {
    <span class="org-css-property">font-variant</span>: small-caps;
}
</pre>
</div>

<p>
But how do we apply this element to segments of text? Org-mode&rsquo;s
syntax does not provide for any shorthand for this sort of text, and
really we would prefer to to apply such a formatting to our beautiful
plain text. There is also the added downside of in that case having to
make changes to the large number of acronyms used in all previous
posts.
</p>

<p>
But we can instead do this using the Emacs build process. This Emacs
lisp function wraps all series of capitalised text (<span class="small-caps">a-z</span>) greater than
2 in the small-caps <code>span</code> element:
</p>

<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span class="org-keyword">defun</span> <span class="org-function-name">org-static-blog--wrap-acronyms</span> (html)
  <span class="org-doc">"Wrap sequences of multiple uppercase letters in &lt;span class=\"small-caps\"&gt; tags.
Does not wrap acronyms inside href attributes."</span>
  (<span class="org-keyword">let</span> ((result html)
        (href-values '())
        (href-counter 0)
        (case-fold-search nil))
    (<span class="org-keyword">setq</span> result (replace-regexp-in-string
                  <span class="org-string">"href=\"</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">(</span></span><span class="org-string">[</span><span class="org-string"><span class="org-negation-char">^</span></span><span class="org-string">\"]*</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">)</span></span><span class="org-string">\""</span>
                  (<span class="org-keyword">lambda</span> (match)
                    (<span class="org-keyword">let</span> ((href-content (match-string 1 match))
                          (placeholder (format <span class="org-string">"href=\"__xhref_protected_%d__\""</span> href-counter)))
                      (<span class="org-keyword">push</span> href-content href-values)
                      (<span class="org-keyword">setq</span> href-counter (1+ href-counter))
                      placeholder))
                  result))
    (<span class="org-keyword">setq</span> href-values (nreverse href-values))
    <span class="org-comment-delimiter">;; </span><span class="org-comment">Wrap all sequences of uppercase letters (optionally with &amp;/&amp;amp;, ., or - between them)
</span>    (<span class="org-keyword">setq</span> result (replace-regexp-in-string
                  <span class="org-string">"</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">(</span></span><span class="org-string">[A-Z]</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">(?:</span></span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">(?:</span></span><span class="org-string">&amp;</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">(?:</span></span><span class="org-string">amp;</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">)</span></span><span class="org-string">?</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">|</span></span><span class="org-string">[.-]</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">)</span></span><span class="org-string">?[A-Z]</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">)</span></span><span class="org-string">+</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">)</span></span><span class="org-string">"</span>
                  (<span class="org-keyword">lambda</span> (match)
                    (concat <span class="org-string">"&lt;span class=\"small-caps\"&gt;"</span> (downcase (match-string 1 match)) <span class="org-string">"&lt;/span&gt;"</span>))
                  result t))
    <span class="org-comment-delimiter">;; </span><span class="org-comment">Restore href values
</span>    (<span class="org-keyword">let</span> ((counter 0))
      (<span class="org-keyword">dolist</span> (href-val href-values)
        (<span class="org-keyword">setq</span> result (replace-regexp-in-string
                      (format <span class="org-string">"__xhref_protected_%d__"</span> counter)
                      (<span class="org-keyword">lambda</span> (_match) href-val)
                      result t))
        (<span class="org-keyword">setq</span> counter (1+ counter))))
    result))
</pre>
</div>

<p>
It is quite long and complicated merely because there are a few major
edge cases that need to be addressed, such as acronyms used within the
<code>href</code> part of links (that would otherwise break) and acronyms like <span class="small-caps">r&amp;d</span>,
<span class="small-caps">e2ee</span>, <span class="small-caps">f-150</span>, or <span class="small-caps">ww1</span> that do not consist of simple all-caps letters.
</p>

<p>
This means that I can write in all-caps in the plain-text document and
have it <span class="small-caps">rendered</span> <span class="small-caps">using</span> <span class="small-caps">small</span> <span class="small-caps">caps</span> automatically. It is also backwards
compatible with everything that I have written previously, it merely
requires a re-rendering of the <span class="small-caps">html</span>.
</p>
</div>
</div>
</div>
<div id="outline-container-org5210a9c" class="outline-2">
<h2 id="org5210a9c">Hosting</h2>
<div class="outline-text-2" id="text-org5210a9c">
<p>
The website used to be hosted on my own server at home, on an Intel
<span class="small-caps">nuc</span> machine, running at first <span class="small-caps">nginx</span> and then Caddy.<sup><a id="fnr.9" class="footref" href="#fn.9" role="doc-backlink">9</a></sup> After I
experienced a 25 day long downtime in June 2025 when I was <a href="https://joarvarndt.se/chinese_phenomenology.html">traveling
in China</a> I however decided to not host the public-facing blog from
home. These types of downtimes are not acceptable to me and my
residential internet connection is simply too unreliable to maintain a
high uptime anyways. For that reason I have moved the blog to <a href="https://www.netlify.com/">Netlify</a>
but still retain the server for hosting personal services and
experiments.
</p>

<p>
Netlify requires a git repository at one of a small list of git
forges, so I have a private repository of the blog on Github that is
automatically pushed to from the main repository <a href="https://codeberg.org/Joar/blog/">on Codeberg</a>.
</p>

<p>
I use <a href="https://www.loopia.se/">loopia</a> as my domain registrar, primarily due to having been
recommended them from someone I trust, however I have made no
significant research into alternatives myself.
</p>

<p>
I use <code>magit</code> to interact with git and push changes to the blog to a
remote repository that then causes netlify to update. ❦
</p>
</div>
</div>
<div id="footnotes">
<h2 class="footnotes">Footnotes: </h2>
<div id="text-footnotes">

<div class="footdef"><sup><a id="fn.1" class="footnum" href="#fnr.1" role="doc-backlink">1</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
Why would any markup not use &ldquo;<code>//</code>&rdquo; to <i>italicise</i> text? Markdown&rsquo;s
use of just asterisks is admirable, but unintuitive for reading in
plaintext (Does two asterisks mean italic or bold?). Org mode&rsquo;s choice
of using <code>__</code> to <span class="underline">underline</span> text is similarly elegant.
</p></div></div>

<div class="footdef"><sup><a id="fn.2" class="footnum" href="#fnr.2" role="doc-backlink">2</a></sup> <div class="footpara" role="doc-footnote"><div class="org-src-container">
<pre class="src src-sh"><span class="org-builtin">set</span> -euo pipefail

<span class="org-variable-name">BASE</span>=<span class="org-string">"https://gwern.net"</span>
<span class="org-variable-name">DESTDIR</span>=<span class="org-string">"~/Documents/blog/static/fonts/"</span>
mkdir -p <span class="org-string">"$DESTDIR"</span>

<span class="org-keyword">for</span> L<span class="org-keyword"> in</span> {A..Z}; <span class="org-keyword">do</span>
    <span class="org-variable-name">FILE</span>=<span class="org-string">"Yinit-${L}.ttf"</span>
    <span class="org-variable-name">URL</span>=<span class="org-string">"${BASE}/static/font/dropcap/yinit/${FILE}"</span>
    <span class="org-builtin">echo</span> <span class="org-string">"Downloading $FILE..."</span>
    curl --fail --location --show-error --silent --retry 3 --retry-delay 2 <span class="org-sh-escaped-newline">\</span>
         -o <span class="org-string">"${DESTDIR}/${FILE}"</span> <span class="org-string">"$URL"</span> <span class="org-sh-escaped-newline">\</span>
        &amp;&amp; <span class="org-builtin">echo</span> <span class="org-string">"Saved ${DESTDIR}/${FILE}"</span> <span class="org-sh-escaped-newline">\</span>
            || <span class="org-builtin">echo</span> <span class="org-string">"Failed to download $URL"</span>
<span class="org-keyword">done</span>
</pre>
</div></div></div>

<div class="footdef"><sup><a id="fn.3" class="footnum" href="#fnr.3" role="doc-backlink">3</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
Many of the illustrations used on this website are from them,
including the bird on the <a href="https://joarvarndt.se/about">about page</a> and the ship in the footer.
</p>

<p class="footpara">
Regarding about-page-bird, it is inserted using an org-mode
<code>#+begin_export html</code> block. It is a showcase of how powerful relying on
org-mode is, when one can directly describe things both in the light
syntax of org-down and at the same time directly access the export
language.
</p></div></div>

<div class="footdef"><sup><a id="fn.4" class="footnum" href="#fnr.4" role="doc-backlink">4</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
Embedding another file like this means that I do not have to keep
track of if it is &ldquo;up to date&rdquo; in the same way as I do not have to
keep the site configuration up to date with this documentation; this
is the configuration!
</p></div></div>

<div class="footdef"><sup><a id="fn.5" class="footnum" href="#fnr.5" role="doc-backlink">5</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
From the repository:
</p>

<blockquote>
<p>
Above all, I tried to make org-static-blog as simple as
possible. There are no magic tricks, and all of the source code is
meant to be easy to read, understand and modify.
</p>
</blockquote></div></div>

<div class="footdef"><sup><a id="fn.6" class="footnum" href="#fnr.6" role="doc-backlink">6</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
Either by running <code>C-u M-x org-static-blog-publish</code> or calling it
through Emacs lisp like this (in the build script for example):
</p>

<div class="org-src-container">
<pre class="src src-lisp">(org-static-blog-publish t)
</pre>
</div></div></div>

<div class="footdef"><sup><a id="fn.7" class="footnum" href="#fnr.7" role="doc-backlink">7</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
Even if it is not a literal reference, but it may often be,
especially when it comes to my <a href="https://joarvarndt.se/tag-university.html">academic writings</a>.
</p></div></div>

<div class="footdef"><sup><a id="fn.8" class="footnum" href="#fnr.8" role="doc-backlink">8</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
Like in <span class="small-caps">css</span>, <span class="small-caps">html</span>, <span class="small-caps">js</span>, <span class="small-caps">gnu</span> <i>et cetera</i>
</p></div></div>

<div class="footdef"><sup><a id="fn.9" class="footnum" href="#fnr.9" role="doc-backlink">9</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
I can highly recommend using Caddy as your web server; you are
going to want to use <span class="small-caps">https</span> and setting it up with <span class="small-caps">nginx</span> or Apache is
just an annoying step to have to go through. Using Caddy as a reverse
proxy is also stupidly simple.
</p></div></div>


</div>
</div>
]]></description>
  <category><![CDATA[technology]]></category>
  <category><![CDATA[website]]></category>
  <category><![CDATA[emacs]]></category>
  <link>https://joarvarndt.se/website.html</link>
  <guid>https://joarvarndt.se/website.html</guid>
  <pubDate>Mon, 30 Dec 2024 00:00:00 +0100</pubDate>
</item>
</channel>
</rss>
