<feed xmlns='http://www.w3.org/2005/Atom'>
<title>gloss/tests/test-gloss--add-flow-smoke.el, branch main</title>
<subtitle>Emacs glossary lookup with Wiktionary fallback
</subtitle>
<id>https://git.cjennings.net/gloss/atom?h=main</id>
<link rel='self' href='https://git.cjennings.net/gloss/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/gloss/'/>
<updated>2026-04-30T12:27:44+00:00</updated>
<entry>
<title>refactor: rework gloss-add UX to single side-window buffer</title>
<updated>2026-04-30T12:27:44+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-04-30T12:27:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/gloss/commit/?id=9e90517a98785c450cd13cd940bd1787a4771529'/>
<id>urn:sha1:9e90517a98785c450cd13cd940bd1787a4771529</id>
<content type='text'>
The previous shape opened a regular (non-side) buffer for body input
and showed the saved entry in the side window after C-c C-c. That
left an extra window split during the typing phase and a side popup
the user didn't ask for.

New shape, modeled on `org-capture':

- `gloss-add' renders the term and underline as a read-only header in
  *gloss-add: TERM*, leaves the body region beneath it editable, and
  pops the buffer in the side-window slot. Point lands at the body
  start so the user can type immediately.
- `gloss-add-finish' reads the body via the `gloss-add--body-start'
  marker, saves with source `manual', kills the buffer, closes the
  side window, and echoes `gloss-add: saved TERM' for confirmation.
- `gloss-add-abort' kills the buffer and closes the side window.
- The shared `gloss--add-cleanup' helper handles kill + window-close
  for both finish and abort.

Read-only header uses text properties (`read-only', `front-sticky',
`rear-nonsticky') rather than narrowing, so the user can't escape the
restriction with `C-x n w'.

`gloss--add-finish-internal' no longer calls show-entry — the save
is its only responsibility. The display decision (show or not) is
the caller's, which lets `gloss-add-finish' choose "save and close"
while `gloss-lookup' still chooses "save and show."

The previous saved-window-config approach is dropped — the side-slot
takeover means there's nothing to restore. Layout returns to its
pre-add state on either C-c C-c or C-c C-k.

Adds `tests/test-gloss--add-flow-smoke.el' covering the four
interactive moments (open, finish, abort, empty-term guard) plus the
read-only-header invariant. Updates the
`gloss--add-finish-internal' tests to drop the show-entry assertion.

129 tests pass in 0.27s.
</content>
</entry>
</feed>
