| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Side-buffer display for gloss entries plus the picker shown when an
online fetch returns multiple candidates.
The major mode `gloss-mode' derives from `special-mode' so `q' quits
the window for free. Two pure helpers handle the formatting:
`gloss-display--format-candidate' renders a definition plist as a
single-line "[source] text" row for `completing-read', truncating with
an ellipsis when the row would exceed 80 chars.
`gloss-display--render-entry' produces the term, an underline matching
the term length, a blank line, then the body.
The picker maps the user's choice back to the original plist via an
alist, returning nil on `C-g' rather than letting the quit signal
propagate. `gloss-display-show-entry' opens the buffer in a
40%-width side window on the right, idempotent on repeat calls for the
same term.
All 88 tests pass, including 23 new tests across format-candidate
(full N/B/E), render-entry (N/B/E), pick-definition (mocking
completing-read at the boundary), and a show-entry smoke test that
mocks display-buffer to keep batch runs windowless.
|