I do not open an editor to write code. I open a Lisp machine that happens to have my project in it.
That sentence sounds like a slogan until you use a configuration where it is literally true. In heks-emacs every module is an Emacs Lisp file, the key scheme is a data table, the documentation of the keys is written from that table, the package set is a lock file in the repository, and the checks that hold all of it together are Guile programs run through Maak. When something is wrong I can read the form that decides it, change it, and evaluate it in the running session. Nothing in the workflow is a setting I cannot see.
This post is about how that works day to day, why it is built the way it is, and why I think the result is a small repayment of a debt to the GNU Project and to Richard Stallman’s argument about software freedom. It is also honest about the price, because a configuration this size is not free to own.
The workshop, not the tool #
Most editors are programs you configure. Emacs is a program you inhabit. The difference is not aesthetic. It is architectural: Emacs ships an interpreter, and the editor is written in the language that interpreter runs. That means the boundary between the editor and my configuration is imaginary. A function I write is as real as one that ships with Emacs; a keymap I build is the same kind of object as the global map; a buffer I create is the same kind of object as the one showing this article.
heks-emacs leans on that rather than hiding it. The repository is a directory of small modules, one per topic, loaded in an order init.el declares. The modules are grouped by what a person does rather than by what Emacs calls things: core, UI and palettes, development, Org and knowledge, shell and system, search and navigation, mail, music and maps, writing and rendering, the libraries, and AI. A module owns one subject, and the module declarations say which key topics it may bind.
That rule is enforced, which is what makes it a design instead of a convention. maak modules reads the declarations, the modules on disk, and the keys the configuration actually binds, and fails when a module has no declaration, when a declaration has no module, when a key is bound under a topic its own module did not claim, or when a topic has nobody to answer for it. The manual is not the authority. The code is, and the manual is written from it.
One grammar for every key #
The key scheme is the part I would rebuild first if I had to start again.
Everything the configuration adds lives under C-c. The next letter names the topic, and the letter after that names the action. The action letters mean the same thing under every topic:
| Letter | Meaning |
|---|---|
a |
apply an action, or add something |
b |
build |
c |
show the callers of this definition |
d |
debug, or the difference between two things |
e |
evaluate |
f |
format |
g |
go to: a definition, an implementation, a location |
h |
explain: the documentation of what is at point |
i |
insert |
k |
kill: stop a process or a server |
l |
lint, or list the problems |
m |
a menu, or turn the mode on and off |
n |
new, or next |
o |
open |
p |
preview, or previous |
r |
run, or open a REPL |
s |
send to a REPL, or switch |
t |
test |
u |
update |
v |
view, or validate |
w |
write, or work on |
x |
execute a script |
So C-c i f and C-c j f both format, but they format different things: one is the buffer, formatted by whoever knows how, and the other is a JVM file, formatted by its own tool. The alphabet is the grammar; the topic is the noun; the action is the verb. Once you have pressed a dozen of them you can guess keys you have never used, which is the whole point of a grammar.
Two details make it learnable rather than merely consistent. which-key is taught the same tables, so C-c is explained while it is being typed, in the words of the topic. And C-c h d echoes the sentence of the key at point wherever one is reading a key: C-c n f: a note, found by title. The key reference is generated from the bindings with maak keys-update and checked with maak keys, so a key that means two things, a binding whose command does not exist, a topic nobody documented, and a key with no sentence of its own all fail the check. The documentation cannot drift from the keymap because the same run writes one and tests the other.
A working day #
What does that actually look like between waking up and pushing a branch?
Starting the session #
Emacs starts as a daemon from the compositor, so the first frame appears with the dashboard already there. early-init.el turns off the built-in package manager, hides the menu bar, tool bar and scroll bars before the first frame is drawn, and sets the frame-resize behaviour that makes a larger font stop costing startup time. Then Elpaca bootstraps, the bridge file is read, and the modules load in the declared order.
The bridge file matters more than it sounds. heks-linux-bridge.el or cask-and-cons-bridge.el sets the fonts, the palette, the notes directory and the checkout directory before any module is configured, because the modules read those values while they are being set up. If the bridge ran later, every module that looked at heks/notes-dir would have configured itself around nil. The order is the configuration.
Finding the project #
The project is where the work is, so the configuration treats it as a first-class thing rather than a directory. The dev-project module owns the project’s tasks, EditorConfig, Maak, Terraform and SQL, and the project’s Maak file is one key away. When I open a file from a repository, the matching environment is already described in that repository: a manifest.scm for Guix, a flake.nix for Nix, a maak.scm for the tasks. Emacs does not have to guess how the project builds; the project says.
Writing code #
Languages get the same three layers everywhere: a major mode for editing, a language server through Eglot for understanding, and Flymake for the findings I have to fix. Tree-sitter does the structural work where there is a grammar for it. Formatters are wired so that the formatter and the linter agree; when they disagree, every line gets reported twice and the buffer becomes noise.
For Guile and Guix the language server is not a language server at all: it is Geiser talking to a running Guile, which is better, because a REPL is a more honest description of a Lisp than a static index. Common Lisp goes through SLY and SBCL for the same reason. C and GTK 4 go under gdb with GTK’s warnings fatal and the GTK inspector one key away; Kotlin, Java and Spring Boot go under the JVM debugger. All of them through the same C-c b session keys, so debugging a new language is learning a language, not learning a new interface.
For the three Lisps I edit most – Scheme, Emacs Lisp and Common Lisp – the formatter, the linter and the language server are one program of mine: sift. It is one Guile executable with no C dependency, and the configuration uses the sift on PATH, or the launcher in ~/Hacking/sift/bin/sift when the checkout is the only copy. A Scheme buffer has three sift surfaces at once: Flymake runs sift lint --stdin --format=json on the buffer’s own text, saved or not; Eglot starts sift lsp, which publishes the same diagnostics, fixes and formatting over the protocol; and heks/sift-drift-backend marks the lines sift format would rewrite – the drift sift check, and so a pipeline running sift ci, fails a build over. The Flymake backend stands aside while the server manages the buffer, so the same line is never reported twice. C-c g a applies the fix of the rule at point, C-c g A every fix, C-c g H explains the rule, and C-c g f formats with the same executable the build runs. That equality is the point: a buffer and CI disagreeing about what “formatted” means is a category of annoyance that stops existing when they are the same program.
Asking the editor about itself #
Three keys answer questions that would otherwise send me to a search engine:
C-c h asays what Emacs, palette, font, modules and version are running.C-c h twalks the five keys a new reader needs, as a buffer of buttons that run the keys they show.C-c ! dis the doctor: every program the modules expect, its version, and what each module does without it.
The doctor’s list is data (heks/doctor-programs), and maak doctor holds the installation page to it. Adding a module that needs a program means adding the program to the list; the manual then says so, or the check fails.
Notes, tasks and the agenda #
Notes are plain Org files in a folder. That is the whole database. There is no sqlite file to rebuild, no UUID in every link, and nothing that stops working if Emacs does. A note lives in a topic folder, so ls tells you what the knowledge base is about. A link is a relative path, so grep can follow it and a static site generator can read it. Titles are read from the files, backlinks are a search, and index pages are generated from what is in the folder.
Everything is under C-c n: capture from anywhere, find by title, today’s agenda, the week’s agenda, the backlinks of this note, the graph. The task inbox is a file, the habits are a file with repeaters, contacts and birthdays are files, bookmarks are files. From a terminal, the n command in heks-bash reads and writes the same formats, and writes index pages byte-identical to the ones Emacs writes. Two front ends, one format, no server in the middle.
Everything else a day needs #
Mail is Gnus, IRC is Circe, the shell is Eshell with a prompt that shows user, host, path and Git branch, aliases for the things I actually type, and project shells opened next to the code they belong to. There is a map, a fretboard for looking up a chord, and a pile of small commands that keep a five-second annoyance from being a five-second annoyance every day. That last category is most of what a personal configuration is, and pretending otherwise is how configurations become unusable.
Document preview is C-c r p: a Markdown file, an Org note, an OpenAPI specification or a plain text file rendered as a themed HTML page with no network. C-c r P turns the same document into a deck. Both are the configuration doing something a proprietary tool would normally do, inside the program I already have open, from the same buffer I am editing.
A configuration that checks itself #
The feature I am proudest of is not a feature. It is the ladder of checks.
| Task | What it proves |
|---|---|
maak lint |
Every Elisp file parses, and the module list in init.el matches the modules on disk. Fast, and needs nothing installed. |
maak keys |
No key means two things, every topic is documented, every binding’s command exists. |
maak modules |
Every module is declared, and no key is bound outside the topic its module owns. |
maak doctor |
The programs the modules expect are the programs the manual lists. |
maak lock |
Every queued package is in the lock, with a ref. |
maak render |
The Markdown renderer, as a pure function from a string to HTML. |
maak contrast |
No face goes invisible in any installed palette. |
maak test |
The ERT suite. |
maak golden |
The renderers still produce the pages they produced last time. |
maak verify |
The configuration installs, loads the way Emacs loads it, and its invariants hold. |
maak check |
All of the above, in the order that fails cheapest first. |
Two of these deserve a longer look.
maak contrast reads each palette’s own face specs – the colours it writes for a true-colour display, not the batch frame’s, which is a text terminal with eight colours – and computes the contrast between every foreground and the background behind it. Body text is held to WCAG AA, at 4.5:1. The separators, which are this configuration’s own blend rather than a palette’s, are held to a visible 1.5:1. A face a palette painted nearly invisible is repainted at load by heks/set-readable-faces, and the check reads the colour it ends up with, so a correction that stops working fails here. This is what makes “nothing goes invisible when you switch palette” a fact instead of a hope.
maak verify is the slow one: it installs the configuration and then loads it in a batch Emacs the way startup does, asserting that every module loaded, that a fold covers a whole definition, that a checker survives a tool’s decorated output, that nothing breaks without Guix, that a Markdown file renders, and that an OpenAPI file is read and checked. The others are cheap enough to run while working. maak verify is the one you run before sending a patch.
The pattern repeats across the project: the check that validates a thing and the task that writes it are the same program, so the answer to “the document is out of date” is never “edit the document”. maak keys-update writes the keybindings reference from the key tables. maak modules-update writes the module table from heks/module-declarations. maak doctor-update writes the programs the modules expect into the installation page. maak stats refreshes the numbers in the README from a batch Emacs. Documentation is an output of the build, not a second copy of the truth.
Packages that come back the same #
Elpaca manages the packages, and the package set has a lock in the tree: src/elpaca-lock.eld, one recipe per package, each pinned to a :ref. init.el puts the lock in front of Elpaca’s menu functions, so a package is resolved from the commit the repository pinned before MELPA is asked. A clone on another machine builds the set this repository says, not the set MELPA is serving that afternoon.
Adding a package is two steps: use-package it, then maak lock-update. A bump is maak packages-update, not maak lock-update on its own, because a recipe with a :ref is pinned and Elpaca skips a pinned package rather than updating it. Writing the lock again from a machine that was never updated would record the commits that were already there. The task moves the installed lock aside, runs Elpaca’s own update over every package, puts the lock back whether the run succeeded or not, and writes the refs it installed. It refuses to fetch while a recipe is still pinned or while a source sits on a detached HEAD, because the fast-forward merge needs a branch. HEKS_PACKAGES_DRY=1 asks those two questions and stops, which is how the guards are tested without paying for the update.
What a bump looks like is git diff src/elpaca-lock.eld: one commit per package, which is the shape a lock file is for. The bootstrap, elpaca and elpaca-use-package, is not in the lock, because it is read before the lock is; its recipe in init.el is its pin.
The editor I actually run #
I run GNU Emacs built from the upstream master branch: pure GTK, native compilation ahead of time, Tree-sitter, ImageMagick. At the time of writing that is 32.0.50. The manual has a page for the build: the checkout from Savannah, the dependencies and their package names on openSUSE and Debian, the flags with the reason each is there, the install and the uninstall, the rebuild loop, and what to do when the distribution moves a library the binary was linked against.
The price is honest. A distribution’s Emacs is built for everybody; mine is built for me. Nothing else on the machine updates it, and a distribution that moves a library ahead of it takes it down until I rebuild. That is the same trade as running a Lisp I can change: the artifact is mine, so its maintenance is mine too. The difference is that this one pays me back every day, because a bug in master fixed upstream can be in my hands the same day, and because the build is the one the configuration is developed against rather than an approximation of it.
Plain files, and why that is the point #
There is a theme running through all of this that is easy to miss because it is not a feature. The notes are files. The tasks are a file. The key scheme is a table in a file. The lock is a file. The documentation is generated from files. There is no service to keep running, no database to migrate, no proprietary store holding the state of my own work.
That has consequences worth stating plainly:
- Everything can be read with the tools that already exist.
grep,git diff,lessand a text editor that is not Emacs all understand the knowledge base. - Everything can be reviewed. A refactor of the whole notes tree is a reviewable diff. A package bump is a diff. A key change is a diff plus the generated reference.
- Everything can be thrown away and rebuilt. Titles come from the files. Index pages are generated. Backlinks are a search. Search is a search. Nothing depends on state that cannot be recreated from the source.
- Everything survives the program that made it. If Emacs disappeared tomorrow, the notes would still be Org files, the tasks would still be Scheme, and the keys would still be a table somebody could read.
That last property is not a hypothetical for me. It is the difference between using a tool and being a tenant of one.
What Stallman and the GNU Project have to do with it #
heks-emacs is a GNU Emacs configuration. That is not a coincidence of tooling; it is a consequence of taking the Free Software Foundation’s argument seriously.
The argument, in the shortest form that is still honest, is that software is a set of rules for your own machine, and that a user who cannot read, change, redistribute or improve those rules is not fully in control of the machine. The four freedoms are not a licence checklist; they are a description of what ownership means when the thing owned is executable text. Stallman has spent forty years making a specific claim: that convenience purchased with control is a bad trade, and that the alternative has to be built rather than wished for. Emacs, GCC, Guile, Guix and the rest of the GNU system are that alternative, built.
I write my configuration in Emacs Lisp because the program is one I can change while it runs. I use GNU Guile for the tasks because it is GNU’s extension language and because a build file should be a program, not a configuration format. I use GNU Guix for environments because it makes the dependency graph explicit and lets me pin it in the repository. I name the system GNU/Linux, not Linux, and I say free software rather than open source, because the distinction is the argument: open source describes a development model, free software describes what the user is allowed to do. The site you are reading is built the same way, from Org files, by an Emacs Lisp program, and it degrades without JavaScript rather than requiring it.
There are smaller forms of the same respect, and they add up:
- The fonts are libre. The palettes are libre. The tools are libre. A configuration that spends its day in a proprietary text stack is making a claim it does not believe.
- Releases are tagged, signed where the project signs, and published with sources. The Guix channel is OpenPGP-authenticated, not merely downloaded; its history is verified against an introduction and a maintainer fingerprint.
- The manual is part of the work, not an afterthought. GNU projects have always been judged by their documentation, and a generated reference that cannot drift is the Emacs tradition of self-documentation taken seriously.
- Nothing is hidden behind an account. There is no telemetry I added to this configuration, no login to edit a file, and no network call where a local computation would do.
Honoring Stallman does not require agreeing with everything he has ever said, and I do not. It requires taking the central question seriously: who gets to change this, and what happens to the person who cannot? The answer in this repository is that the person can change it, and the configuration is arranged so that they can find where. That is a small thing to do with a text editor. It is also the whole thing, done at the scale one person can actually control.
The AI question, answered in public #
A configuration written in 2026 has to say where it stands on AI, and this one says it in a written policy rather than in a shrug.
heks-emacs has two front ends: GPTel for asking a question about what is at point, and ECA for a chat that reads and edits the project. Both talk to one of two accounts, and the account is a property of the project rather than of the checkout: heks/ai-provider resolves to a provider, HEKS_AI_PROVIDER names one outright, and C-c x P writes the choice into the project’s own .dir-locals.el as a value that may only be one of the two known providers. A directory-local file is data; a setting that can only name copilot or deepseek is one that cannot run code.
The key never lives in the repository. It is looked for in DEEPSEEK_API_KEY, in a GPG-encrypted file outside the checkout, or in an auth-source entry, in that order, and a missing key is an error naming all three rather than a request that comes back as a 401. The environment variable is not the recommended place, because Emacs here is a daemon started by the compositor: a line in ~/.profile never reaches it, and what is exported is inherited by every process it starts.
The policy is the part that matters. A human is the author of record and is accountable for every commit. Test-driven development is required for every behaviour change. An agent runs the checks and records the commands and their output, and a red suite, a dirty tree or a checklist nobody ran is not a merge. An agent never weakens a test, edits CI to get a green run, or changes the licence or the policy without a person’s agreement.
That is the same standard I would apply to any other tool: it may make me faster, but it may not take away my ability to read, test and change what it produced. A tool that makes the code less mine is not a tool I want in the workshop, however clever it is.
What it costs #
I would not trust a post like this without the bill.
The configuration is more than 140 packages, more than 500 functions, more than 180 tests and more than thirty palettes. That is a lot of surface, and surface needs maintenance: a package that changes an API, a language server that starts returning decorated output, a palette that repaints a face the contrast check then has to repair. The checks are what make the maintenance tractable, but the checks are also work. maak verify is slow. maak packages-update can fail on a package that has moved, and the failure is a real afternoon. Building Emacs from master means being your own distributor.
The payoff is not that the configuration is perfect. It is that when it is wrong, I can find the form that is wrong. That property is worth a weekend a year, and it is the reason I keep the whole thing in one place instead of spreading it across a dozen dotfiles and a package manager I do not control.
Starting from here #
If you want to try it rather than read about it:
git clone https://github.com/jjba23/heks-emacs.git
cd heks-emacs
maak install-emacs-config
That copies the configuration into ~/.emacs.d, where src/init.el reads it and Elpaca installs the packages on the first start. If you would rather read first, the sequence that explains the design is: the manual, then the keybindings reference, then the module table, then maak check. The manual is generated from the same tables the checks use, so it is the shortest honest path into the configuration.
If you take one idea away, take the one that survives the specifics: a tool you can change while it runs is a different kind of tool from one you can only configure. Emacs has been that kind of tool for forty years because the GNU Project insisted that it could be. Building on it is the least I can do, and the most useful thing I own.
The rest of this series is about the parts around the editor: the environments the projects are built in, the task file that runs them, and how the results are packaged for the distributions.