summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Szukalski <szymon@szymonszukalski.com>2026-04-10 13:05:30 +1000
committerSzymon Szukalski <szymon@szymonszukalski.com>2026-04-10 13:05:30 +1000
commit44f4506f29b937130e04c42049afe78c69b0dd28 (patch)
treedc0a8db8f4caa92c30c698afd890336499663754
parent2d8d20c50d60644c0d1de2021893bce3b04da76a (diff)
Add olivetti for org buffers
-rw-r--r--README.md4
-rw-r--r--docs/plans/2026-04-10-olivetti-org-design.md57
-rw-r--r--docs/plans/2026-04-10-olivetti-org-implementation.md129
-rw-r--r--lisp/ss-org.el2
-rw-r--r--lisp/ss-ui.el11
5 files changed, 202 insertions, 1 deletions
diff --git a/README.md b/README.md
index ee5c610..f3f2a7a 100644
--- a/README.md
+++ b/README.md
@@ -80,6 +80,7 @@ The current setup uses:
- `orderless` for flexible completion matching
- `marginalia` for minibuffer annotations
- `corfu` for in-buffer completion popups in text and Org buffers
+- `olivetti` for centered writing layout in Org buffers
- `gptel` with the GitHub Copilot backend as an experimental tool
- `dired` with a macOS-safe `ls` configuration
- `time` for the modeline clock
@@ -157,6 +158,9 @@ The capture model has two distinct paths:
uses a Year -> Day outline in `journal.org` with explicit `Tasks`, `Notes`,
and `Meetings` headings beneath each day entry.
+Org buffers enable `olivetti-mode` automatically for a centered writing layout
+in both GUI and terminal Emacs sessions.
+
Questions that come up during the day can be tracked as Org tasks under the
day's `Tasks` heading. The intended task workflow is `TODO`, `CLARIFY`,
`WAIT`, `DONE`, and `CANCELLED`: use `CLARIFY` for open questions or ambiguity,
diff --git a/docs/plans/2026-04-10-olivetti-org-design.md b/docs/plans/2026-04-10-olivetti-org-design.md
new file mode 100644
index 0000000..863ca65
--- /dev/null
+++ b/docs/plans/2026-04-10-olivetti-org-design.md
@@ -0,0 +1,57 @@
+# Olivetti Org Design
+
+## Context
+
+The configuration is modular:
+
+- `lisp/ss-ui.el` owns visual packages and interface defaults.
+- `lisp/ss-org.el` owns Org-specific setup and hooks.
+- `init.el` composes modules centrally through `ss-enabled-features`.
+
+The requested behavior is to add `olivetti-mode` to the configuration and
+enable it automatically for Org buffers in both GUI Emacs and `emacs -nw`.
+
+## Options Considered
+
+### 1. Recommended: split package ownership and activation by module
+
+- Declare and configure `olivetti` in `lisp/ss-ui.el`.
+- Enable `olivetti-mode` from `org-mode-hook` in `lisp/ss-org.el`.
+
+This matches the repository boundaries: visual package ownership remains in the
+UI module, while Org-specific behavior remains in the Org module.
+
+### 2. Put everything in `lisp/ss-org.el`
+
+- Add the package declaration and the hook together in the Org module.
+
+This is workable but muddies module boundaries by making the Org module own a
+general presentation package.
+
+### 3. Add a new writing-focused module
+
+- Introduce a dedicated module for prose layout and writing helpers.
+
+This is clean only if more writing-mode features are expected soon. For a
+single package addition, it adds unnecessary structure.
+
+## Chosen Design
+
+Use option 1.
+
+- Add `olivetti` in `lisp/ss-ui.el` with a modest body width that works in GUI
+ and terminal frames.
+- Enable `olivetti-mode` automatically in Org buffers from `lisp/ss-org.el`.
+- Do not enable it globally or for non-Org buffers.
+- Keep startup order unchanged.
+
+## Verification
+
+- Run `emacs --batch -Q --load ./init.el` from the repository root.
+- Run an actual terminal Emacs startup check with `emacs -nw` loading this
+ configuration, since batch mode alone will not catch tty regressions.
+
+## Documentation Impact
+
+`README.md` should be updated so the package list and Org behavior describe the
+new default truthfully.
diff --git a/docs/plans/2026-04-10-olivetti-org-implementation.md b/docs/plans/2026-04-10-olivetti-org-implementation.md
new file mode 100644
index 0000000..7853be3
--- /dev/null
+++ b/docs/plans/2026-04-10-olivetti-org-implementation.md
@@ -0,0 +1,129 @@
+# Olivetti Org Implementation Plan
+
+> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
+
+**Goal:** Add `olivetti` to the Emacs config and enable it automatically for Org buffers in GUI and terminal sessions.
+
+**Architecture:** Keep visual package ownership in `lisp/ss-ui.el` and Org-specific activation in `lisp/ss-org.el`. Update `README.md` so the package model and Org behavior remain accurate, then verify the hand-edited startup path in batch and terminal Emacs.
+
+**Tech Stack:** Emacs Lisp, `use-package`, Org mode, `olivetti`
+
+---
+
+### Task 1: Add the visual package setup
+
+**Files:**
+- Modify: `lisp/ss-ui.el`
+
+**Step 1: Write the failing test**
+
+For this configuration-only change, there is no existing automated test harness
+covering package declarations or minor-mode activation. Use startup
+verification as the regression check for this unit.
+
+**Step 2: Run test to verify it fails**
+
+Not applicable for this repository layout. The useful red state is the absence
+of `olivetti` configuration in the current source.
+
+**Step 3: Write minimal implementation**
+
+- Add a `use-package olivetti` declaration to `ss-ui`.
+- Set a conservative width such as `olivetti-body-width 100`.
+
+**Step 4: Run test to verify it passes**
+
+Run: `emacs --batch -Q --load ./init.el`
+Expected: startup completes without Lisp errors.
+
+**Step 5: Commit**
+
+Wait for verification and user approval before creating a commit.
+
+### Task 2: Enable Olivetti for Org buffers
+
+**Files:**
+- Modify: `lisp/ss-org.el`
+
+**Step 1: Write the failing test**
+
+Use the same configuration exception as Task 1. There is no existing targeted
+test scaffold for `org-mode-hook` behavior here.
+
+**Step 2: Run test to verify it fails**
+
+Not applicable. The current source does not add `olivetti-mode` to
+`org-mode-hook`.
+
+**Step 3: Write minimal implementation**
+
+- Extend the existing `org-mode-hook` lambda to enable `olivetti-mode`.
+
+**Step 4: Run test to verify it passes**
+
+Run: `emacs --batch -Q --load ./init.el`
+Expected: startup completes without Lisp errors.
+
+Run: `emacs -nw --eval '(progn (load-file \"./init.el\") (with-current-buffer (get-buffer-create \"*olivetti-check*\") (org-mode) (princ (if olivetti-mode \"olivetti-on\" \"olivetti-off\"))))'`
+Expected: output includes `olivetti-on`.
+
+**Step 5: Commit**
+
+Wait for verification and user approval before creating a commit.
+
+### Task 3: Update documentation
+
+**Files:**
+- Modify: `README.md`
+
+**Step 1: Write the failing test**
+
+The failing condition is documentation drift: the current README does not list
+`olivetti` or mention that Org buffers enable it automatically.
+
+**Step 2: Run test to verify it fails**
+
+Review `README.md` and confirm it lacks that behavior.
+
+**Step 3: Write minimal implementation**
+
+- Add `olivetti` to the package model.
+- Add a short note in the Org workflow description that Org buffers enable
+ `olivetti-mode` for centered writing layout.
+
+**Step 4: Run test to verify it passes**
+
+Review the updated README text for accuracy against the code.
+
+**Step 5: Commit**
+
+Wait for verification and user approval before creating a commit.
+
+### Task 4: Verify the complete change
+
+**Files:**
+- Verify only
+
+**Step 1: Write the failing test**
+
+Use the repository’s expected verification path rather than adding new tests.
+
+**Step 2: Run test to verify it fails**
+
+Not applicable before implementation.
+
+**Step 3: Write minimal implementation**
+
+No code changes in this task.
+
+**Step 4: Run test to verify it passes**
+
+Run: `emacs --batch -Q --load ./init.el`
+Expected: exits successfully.
+
+Run: `emacs -nw --eval '(progn (load-file \"./init.el\") (with-temp-buffer (org-mode) (princ (if olivetti-mode \"olivetti-on\" \"olivetti-off\"))))'`
+Expected: prints `olivetti-on`.
+
+**Step 5: Commit**
+
+Wait for verification and user approval before creating a commit.
diff --git a/lisp/ss-org.el b/lisp/ss-org.el
index f1a2274..9d8e81f 100644
--- a/lisp/ss-org.el
+++ b/lisp/ss-org.el
@@ -261,6 +261,8 @@ This is for significant navigation points only and clears forward history."
(add-hook 'org-mode-hook
(lambda ()
(setq-local org-hide-emphasis-markers t)
+ (when (fboundp 'olivetti-mode)
+ (olivetti-mode 1))
(font-lock-flush)
(font-lock-ensure))))
diff --git a/lisp/ss-ui.el b/lisp/ss-ui.el
index 79f2a0d..3dd728c 100644
--- a/lisp/ss-ui.el
+++ b/lisp/ss-ui.el
@@ -100,6 +100,14 @@
:init
(global-corfu-mode 1)))
+(defun ss-ui--setup-writing-layout ()
+ "Configure centered writing layout helpers."
+ (use-package olivetti
+ :ensure t
+ :pin melpa
+ :custom
+ (olivetti-body-width 100)))
+
(defun ss-ui-setup ()
"Initialize interface and completion behavior."
(setq inhibit-startup-message t
@@ -128,7 +136,8 @@
(setq-default fringe-indicator-alist nil)
(ss-ui--setup-modeline)
- (ss-ui--setup-completion))
+ (ss-ui--setup-completion)
+ (ss-ui--setup-writing-layout))
(provide 'ss-ui)