aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-04-30 00:02:27 -0500
committerCraig Jennings <c@cjennings.net>2026-04-30 00:02:27 -0500
commit6102ef81e7cc8af7cf847906cbc1bb27fc8a75e5 (patch)
tree51b6baec74041c8d2d61035bf65c2c9875e9845e /tests
parent735ecf082273c0cba2f5c5dd25876e2ccd83b0f7 (diff)
downloadgloss-6102ef81e7cc8af7cf847906cbc1bb27fc8a75e5.tar.gz
gloss-6102ef81e7cc8af7cf847906cbc1bb27fc8a75e5.zip
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-gloss-display--show-entry-smoke.el1
1 files changed, 1 insertions, 0 deletions
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)