Executive Function as Code: Using Doom Emacs to Script My Brain
Source: Dev.to
For the first 21 years of my life…
It felt like I was fighting an uphill battle against myself—half‑abandoned projects everywhere, constantly thinking “I could and should be doing more.”
It was as if I had shipped with broken software while everyone else seemed to complete even simple tasks with ease.
The truth? I wasn’t running broken software; I was running a completely different OS.
Recently I got the documentation: ADHD.
Once I understood the specs of this environment, I realized standard tools like Notion or a phone to‑do list weren’t going to cut it. They assume a functioning environment I simply don’t have.
On my devices I was already using Doom Emacs because I’m a tech nerd who loves to tinker. So instead of trying to change myself to fit a certain tool, I decided to learn some Elisp and reshape the tool to fit me.
Below is how I weaponized my config against executive dysfunction.
Phase 0 – The Infrastructure
Before I touched a single line of Lisp, I had to solve a different problem: syncing my notes between devices.
My brain has a very small L1 cache. If I have an idea while in the kitchen but my to‑do list lives on my desktop in another room, the “latency” (and mental barrier) is high enough to kill the task. By the time I get to my desktop, the context is lost.
I tried a few solutions in the past:
- Phone‑based note‑taking apps – split notes across devices, not ideal.
- A personal Discord server – quickly became unmaintainable and unsearchable.
What I needed was a single source of truth that was available everywhere with zero friction.
Devices
- Desktop
- Laptop
- Phone (Orgzly app for Org mode)
…and a secret fourth device you’re reading this on right now: my VPS (future homelab).
Solution: Syncthing
I chose Syncthing. Before I had my VPS I considered using Syncthing directly between devices, but that would require them to be on simultaneously—rarely the case for my laptop and desktop. The VPS acts as a “cloud” hub, so even if my desktop is off, my laptop can still sync notes from the VPS.
Phase 1 – The “Energy” Index
Standard productivity advice tells you to sort tasks by deadline or importance. That works great for neurotypical brains. For me, a list of 20 “important” tasks looks like a wall of noise and triggers immediate analysis paralysis.
I realized my bottleneck isn’t time; it’s battery.
- Some days I run at 110 %.
- Some days I run at 10 %.
On a low‑energy day, seeing a big, energy‑hungry task makes me skip that task—and often the entire list.
The Solution
I modified my workflow so every task includes an ENERGY property. Instead of asking “When is this due?” I ask “How much energy will this cost me?”
I defined three energy levels:
| Level | Description |
|---|---|
| High | Complex tasks, usually requiring deep focus |
| Medium | Standard work, e.g., answering an email |
| Low | Easy tasks, e.g., cleaning up files or scheduling an appointment |
Emacs configuration
;; Map priorities
(setq org-priority-highest ?A
org-priority-lowest ?C
org-priority-default ?B)
;; Colour‑code priorities
(setq org-priority-faces
'((?A :foreground "#ff6c6b" :weight bold)
(?B :foreground "#98be65")
(?C :foreground "#51afef")))
;; Define energy levels (global property)
(setq org-global-properties
'(("ENERGY_ALL" . "Low Medium High")))
;; Colour‑code TODO states
(setq org-todo-keyword-faces
'(("TODO" :foreground "#51afef" :weight bold)
("DONE" :foreground "#98be65" :weight bold)
("WAIT" :foreground "#da8548")))
Agenda overview
The real magic happens in the agenda overview (SPC o A x). I created custom commands that sort tasks by energy cost.
When I sit down and look at my agenda I check my internal battery:
- Tired? → “Quick Wins” (Low energy)
- Focused? → “Deep Work” (High energy)
This prevents a negative spiral; even on a bad day I can usually clear some “Low Energy” items and keep moving forward.
(setq org-agenda-custom-commands
'(("x" "Overview"
((tags-todo "PRIORITY=\"A\"+ENERGY=\"Low\""
((org-agenda-overriding-header
"Quick Wins (High Impact, Low Energy)")))
(tags-todo "PRIORITY=\"A\"+ENERGY=\"High\""
((org-agenda-overriding-header
"Deep Work (Focus Required)")))
(tags-todo "PRIORITY=\"A\"+ENERGY=\"Medium\""
((org-agenda-overriding-header
"High Priority (Medium Energy)")))))))
Phase 2 – Reducing Input Latency
Forgetting (the context of) ideas is a constant struggle. Opening a file browser, navigating to the right file, and typing everything out is too much friction. I needed a way to capture ideas, tasks, and to‑dos on the fly.
Strategy 1 – org-capture
No matter what I’m doing, I can hit my custom keybind that launches emacsclient (Ctrl+Alt+e on KDE Plasma), then press SPC X inside Emacs. A custom capture window appears, asking for the type of thought I want to capture.
Example: choose a to‑do (t). I’m then prompted for five bits of vital information:
- Priority
- Task name
- Tag (free‑form)
- Deadline
- Energy level
This forces me to assign a priority and energy level at capture time, keeping the workflow tight and low‑latency.
(The rest of the original text continues with additional strategies and refinements; they remain unchanged in spirit.)
Executive Function as Code – Doom Emacs + ADHD
Phase 2 – Capture Templates
I needed a quick way to add tasks without breaking my flow. The following org-capture templates let me drop a task, idea, or project straight into the appropriate file with the right metadata (priority, energy level, deadline, etc.).
(setq org-capture-templates
'(("t" "Todo" entry (file+headline "~/org/inbox.org" "Tasks")
"* TODO [#%^{Priority|A|B|C}] %^{Task Name} %^g\nDEADLINE: %^t\n:PROPERTIES:\n:ENERGY: %^{Energy?|Low|Medium|High}\n:END:\n")
("i" "Idea/Note" entry (file+headline "~/org/inbox.org" "Notes")
"* %?\n%U\n")
("p" "Project Task" entry (file+headline "~/org/projects.org" "Projects")
"* TODO [#%^{Priority|A|B|C}] %^{Task Name} [/]\nDEADLINE: %^t\n:PROPERTIES:\n:ENERGY: %^{Energy?|Low|Medium|High}\n:END:\n")))
Enter fullscreen mode → Exit fullscreen mode
Phase 3 – Visual Tweaks
I’m prone to digital sensory overload, so I keep my UI minimal. I use the Catppuccin (mocha) theme because it’s low‑contrast and pleasant to look at. The biggest visual improvements are the fonts:
- Monospace (
Fira Code) for code blocks. - Variable‑pitch (
Fira Sans) for regular text, to separate “human language” from “computer language” and reduce cognitive load.
;; Fonts
(setq doom-font (font-spec :family "Fira Code" :size 16 :weight 'semi-light)
doom-variable-pitch-font (font-spec :family "Fira Sans" :size 17))
;; UI
(setq doom-theme 'catppuccin)
(setq display-line-numbers-type t) ;; Set to nil if you prefer no line numbers
Enter fullscreen mode → Exit fullscreen mode
I also use Zen mode to center the text and hide the modeline when I need deep focus (e.g., while writing this blog post).
Conclusion – “Works on My Machine!”
These tweaks don’t “cure” ADHD, and there will still be days when I ignore the agenda or can’t tackle low‑energy tasks. However, because everything lives in plain‑text files synced via Syncthing, the system is resilient and non‑judgmental. When I return after a break, all my data is still there, waiting.
I stopped fighting my brain’s operating system and started writing software patches instead. For the first time in 21 years, it feels like I finally have root access.
Feel free to steal my config! My Doom Emacs dotfiles are in my Nix configuration repository.
Thank you for reading! I’m planning a follow‑up post on how I use org-roam in a similar style—stay tuned.
If you have questions or need help, you can find my Discord link on the homepage. Always happy to assist! ;3
Read the original article on my blog here.