From 6102ef81e7cc8af7cf847906cbc1bb27fc8a75e5 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Thu, 30 Apr 2026 00:02:27 -0500 Subject: feat: implement gloss-display UI layer 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. --- tests/test-gloss-display--show-entry-smoke.el | 1 + 1 file changed, 1 insertion(+) (limited to 'tests') diff --git a/tests/test-gloss-display--show-entry-smoke.el b/tests/test-gloss-display--show-entry-smoke.el index 07d7a97..cbadf2f 100644 --- a/tests/test-gloss-display--show-entry-smoke.el +++ b/tests/test-gloss-display--show-entry-smoke.el @@ -12,6 +12,7 @@ ;;; Code: (require 'ert) +(require 'cl-lib) (require 'gloss-display) (defmacro gloss-test--with-display-buffer-mocked (&rest body) -- cgit v1.2.3