diff options
185 files changed, 13420 insertions, 15302 deletions
diff --git a/.claude/rules/locating-craig.md b/.claude/rules/locating-craig.md new file mode 100644 index 000000000..c327e3fa9 --- /dev/null +++ b/.claude/rules/locating-craig.md @@ -0,0 +1,48 @@ +# Locating Craig + +Applies to: `**/*` + +When a task needs to know where Craig physically is — a local guide, "what's +near me", travel logistics, the timezone or weather for his actual spot, +distance to an appointment — don't ask him. Run the `whereami` command and read +the result. + +## The Rule + +`whereami` scans nearby WiFi access points and geolocates the machine it runs +on. That only tracks *Craig* on the machine that travels with him: **velox**, +his laptop. On any other machine (ratio, the desktop) it reports that machine's +fixed location, not Craig's, so the result is only meaningful on velox. + +The gate is the machine, stated positively: + +1. Check the host with `uname -n`. +2. **On velox** — run `whereami` whenever location matters, instead of asking. + Treat its reverse-geocoded address as Craig's current location. +3. **Any other host** — don't trust `whereami` as Craig's location. Fall back to + asking, or to known context (trip notes, calendar, reminders). + +Prefer running it over asking — Craig confirmed he'd rather the agent just +check. The output gives coordinates, a reverse-geocoded address, and an +OpenStreetMap link; WiFi-centroid drift of a block or two is normal. + +## When whereami can't answer + +If `whereami` fails — no WiFi to scan, no network, the geolocation API or its +BeaconDB fallback unreachable — it can't locate Craig. Fall back to asking or to +known context, exactly as on a non-velox host. Never fabricate or guess a +location from a stale reading. + +## Keep the location out of shared artifacts + +A reverse-geocoded address is personal data. It can drive a task, but it must +not leak into anything team-visible — commit messages, PR descriptions, tickets, +or public docs (see the content-scope rule in `commits.md`). + +## Why + +Craig travels with velox, so on that machine the agent can know his location for +free rather than interrupting to ask. The command and its design (WiFi BSSID +scan → Google Geolocation API with a BeaconDB fallback → OSM reverse-geocode) +were built 2026-06-24 specifically to replace useless cellular-IP lookup that +reported the carrier gateway instead of the device. diff --git a/.claude/rules/todo-format.md b/.claude/rules/todo-format.md index 5c3496690..55530de2c 100644 --- a/.claude/rules/todo-format.md +++ b/.claude/rules/todo-format.md @@ -33,6 +33,52 @@ When a project's `todo.org` lacks the section, add it before filing or grading further tasks — propose the priority semantics and tag set from the project's existing usage, and confirm with Craig. +### Bug priority from severity × frequency (mandatory where a codebase exists) + +Some projects carry a codebase — source the project maintains under version +control — even when the project isn't primarily a "code project." home and work +both have one. Wherever a project has a codebase, a task representing a bug +*against that codebase* does not get its priority argued: it is **dictated** by +the severity × frequency matrix below. This is not opt-in. Features keep their +per-project `[#A]`–`[#D]` roadmap judgment; codebase bugs do not. + +Two facts set a bug's priority: + +- **Severity** — how bad it is when it occurs (service down / data loss / + security or privacy leak at one end; a cosmetic nit at the other). +- **Frequency** — how often a user hits it (every user every time → rare edge + case). + +``` +| Frequency / Severity | Critical | Major | Minor | Cosmetic | +|------------------------+----------+-------+-------+----------| +| Every user, every time | P1 | P1 | P2 | P3 | +| Most users, frequently | P1 | P2 | P3 | P4 | +| Some users, sometimes | P2 | P3 | P3 | P4 | +| Rare edge case | P2 | P3 | P4 | P4 | +``` + +P-level → priority letter (fixed — not a per-project knob): + +- P1 → `[#A]` +- P2 → `[#B]` +- P3 → `[#C]` +- P4 → `[#D]` + +Release vehicle is illustrative and project-dependent: P1 = current +release/patch, P2 = next patch, P3 = next major, P4 = backlog. A project with no +release train maps the letters and skips the vehicle. A "no open `[#A]` bugs" +release gate therefore means "no open P1." + +Each project still defines, in its scheme header, what +Critical/Major/Minor/Cosmetic and the frequency rows mean *for its own +codebase* — the bands are concrete per codebase, but the matrix structure and +the letter mapping are fixed. + +**Severity-alone carve-out:** privacy or security leaks, compliance violations, +and safety issues are graded on severity alone — one occurrence with the right +consequences is a showstopper no matter how rarely it would be hit. + ## The Rule A todo entry has two parts: diff --git a/.claude/rules/triggers.md b/.claude/rules/triggers.md index a8d5e772c..3c4ea6d19 100644 --- a/.claude/rules/triggers.md +++ b/.claude/rules/triggers.md @@ -19,6 +19,7 @@ The `ai` script handles tmux session creation, window placement, and the per-pro **Resolving X.** Match against project basenames discoverable by `ai` — directories under `~/code/`, `~/projects/`, and `~/.emacs.d` that contain `.ai/protocols.org`. - Exact basename match (case-insensitive) → invoke `ai <path>` directly. +- Dot-stripped match → a dotted basename is addressed with its dots removed, so `emacsd` matches `.emacs.d` and `dotfiles` matches `.dotfiles`. Strip dots from both the spoken name and each candidate basename when comparing; an exact match still wins over a dot-stripped one. (`inbox-send` resolves the same way, so the spoken name is consistent across both.) - No match → list all available basenames, ask which to launch. - Multiple partial matches (X is a substring of two or more candidates) → list the matching basenames, ask which. diff --git a/.gitignore b/.gitignore index 274ac4b0a..af0d2ca0c 100644 --- a/.gitignore +++ b/.gitignore @@ -100,3 +100,6 @@ __pycache__/ # editor/image backup files *.bak smoke/ + +# personal task list — kept local, not tracked +todo.org @@ -459,11 +459,15 @@ profile: fi # Move completed tasks (DONE/CANCELLED level-2 subtrees) out of "Open Work" -# and into the "Resolved" section of todo.org. Wraps todo-cleanup.el's -# --archive-done; a no-op when nothing is in a closed state. +# and into the "Resolved" section of todo.org, then age that section: tasks +# closed more than a week ago move out to archive/task-archive.org, keeping +# only the last week of closed tasks in todo.org. Wraps todo-cleanup.el's +# --archive-done; a no-op when nothing is closed and nothing has aged out. task-sorted: @echo "Archiving resolved tasks in todo.org..." @$(EMACS) --batch -q -l .ai/scripts/todo-cleanup.el --archive-done todo.org + @echo "Linting todo.org..." + @$(EMACS) --batch -q -l .ai/scripts/lint-org.el todo.org clean: clean-tests clean-compiled @echo "✓ Clean complete" diff --git a/archive/gptel/custom/gptel-prompts.el b/archive/gptel/custom/gptel-prompts.el index a2b266f27..28197ceba 100644 --- a/archive/gptel/custom/gptel-prompts.el +++ b/archive/gptel/custom/gptel-prompts.el @@ -29,58 +29,12 @@ ;; Boston, MA 02111-1307, USA. ;;; Commentary: - -;; This package provides enhanced prompt management capabilities for GPTel, -;; allowing you to organize and dynamically load AI prompts from external -;; files rather than hardcoding them in your Emacs configuration. - -;; Key Features: -;; -;; * Multi-format prompt support: Load prompts from .txt, .md, .org, .json, -;; .eld (Emacs Lisp data), .el (Emacs Lisp functions), and .poet/.jinja -;; (Prompt Poet/Jinja2 templates) -;; -;; * Template interpolation: Use Jinja2-style {{variable}} syntax with -;; customizable variables and dynamic functions -;; -;; * File watching: Automatically reload prompts when files change -;; -;; * Project-aware prompts: Automatically load project-specific conventions -;; from CONVENTIONS.md or CLAUDE.md files ;; -;; * Conversation format support: Handle multi-turn conversations with -;; system/user/assistant roles - -;; Setup: -;; -;; (use-package gptel-prompts -;; :after (gptel) -;; :custom -;; (gptel-prompts-directory "~/my-prompts") -;; :config -;; (gptel-prompts-update) -;; ;; Optional: auto-reload on file changes -;; (gptel-prompts-add-update-watchers)) - -;; File Formats: -;; -;; * Plain text (.txt, .md, .org): Used as-is for system prompts -;; * JSON (.json): Array of {role: "system/user/assistant", content: "..."} -;; * Emacs Lisp data (.eld): List format for conversations -;; * Emacs Lisp code (.el): Lambda functions for dynamic prompts -;; * Prompt Poet (.poet, .j2, .jinja, .jinja2): YAML + Jinja2 templates - -;; Template Variables: -;; -;; Use {{variable_name}} in your prompts. Variables can be defined in -;; `gptel-prompts-template-variables' or generated dynamically by functions -;; in `gptel-prompts-template-functions'. - -;; Project Integration: +;; Adds file-backed GPTel directives. Prompt files can be plain text, structured +;; conversations, Elisp data/functions, or Prompt Poet/Jinja templates. ;; -;; Add `gptel-prompts-project-conventions' to `gptel-directives' to -;; automatically load project-specific prompts from CONVENTIONS.md or -;; CLAUDE.md files in your project root. +;; The library can reload prompt files, interpolate configured template +;; variables, and expose project-convention prompts from project roots. ;;; Code: diff --git a/archive/gptel/gptel-tools/read_text_file.el b/archive/gptel/gptel-tools/read_text_file.el index f35c94941..06a01db12 100644 --- a/archive/gptel/gptel-tools/read_text_file.el +++ b/archive/gptel/gptel-tools/read_text_file.el @@ -19,6 +19,10 @@ ;; GNU General Public License for more details. ;;; Commentary: +;; +;; GPTel tool for safely reading text files under the user's home directory. +;; It validates the resolved path, rejects directories and unreadable files, +;; guards large files, and returns metadata alongside content. ;;; Code: diff --git a/archive/gptel/tests/testutil-filesystem.el b/archive/gptel/tests/testutil-filesystem.el index b1970b62d..283a3b2b0 100644 --- a/archive/gptel/tests/testutil-filesystem.el +++ b/archive/gptel/tests/testutil-filesystem.el @@ -1,4 +1,4 @@ -;;; testutil-filesystem.el --- -*- coding: utf-8; lexical-binding: t; -*- +;;; testutil-filesystem.el --- Filesystem helpers for archived GPTel tests -*- coding: utf-8; lexical-binding: t; -*- ;; ;; Author: Craig Jennings <c@cjennings.net> ;; @@ -27,11 +27,8 @@ By default, hidden entries (starting with '.') are excluded unless INCLUDE-HIDDEN is non-nil. FILTER-PREDICATE, if non-nil, is a predicate function called on each entry's absolute path; only entries where it returns non-nil are included." - ;; Convert 'path' to an absolute filename string (let* ((expanded-path (expand-file-name path)) - ;; get absolute paths in expanded directory (entries (directory-files expanded-path t nil t)) - ;; remove "." ".." entries (filtered-entries (cl-remove-if (lambda (entry) @@ -40,10 +37,8 @@ non-nil are included." (and (not include-hidden) (string-prefix-p "." (f-filename entry))))) entries))) - ;; apply filtered predicate if provided (if filter-predicate (seq-filter filter-predicate filtered-entries) - ;; retun filtered-entries filtered-entries))) (defun cj/get-file-info (path) diff --git a/archive/task-archive.org b/archive/task-archive.org new file mode 100644 index 000000000..b86c91667 --- /dev/null +++ b/archive/task-archive.org @@ -0,0 +1,3941 @@ +#+TITLE: Task Archive +#+FILETAGS: :archive: + +* Resolved (archived) +** DONE [#B] Fix likely =elpa-mirror-location= path bug :bug:quick: +CLOSED: [2026-05-03 Sun] + +=early-init.el= builds =elpa-mirror-location= with: + +#+begin_src emacs-lisp +(concat user-home-dir ".elpa-mirrors/") +#+end_src + +That likely expands to =~/..= incorrectly, e.g. =/home/cjennings.elpa-mirrors/= +instead of =/home/cjennings/.elpa-mirrors/=. Use =expand-file-name= instead. + +Acceptance criteria: +- Local mirror paths resolve under the home directory as intended. +- Add a small testable helper if this logic moves out of =early-init.el=. + +Done 2026-05-03: +- Replaced =concat= path construction with =expand-file-name= for + =elpa-mirror-location=, =localrepo-location=, and local mirror archive paths. +- Added =tests/test-early-init-paths.el= to load =early-init.el= with package + side effects stubbed and assert local archive paths. +** DONE [#B] Fix =vc-follow-symlinks= setting in =system-defaults.el= :bug:quick: +CLOSED: [2026-05-03 Sun] + +=modules/system-defaults.el= has: + +#+begin_src emacs-lisp +(setq-default vc-follow-symlinks) +#+end_src + +The comment says "don't ask to follow symlinks if target is version +controlled", but evaluating this leaves =vc-follow-symlinks= as =nil=. That +means the intended prompt suppression is not actually configured. The likely +fix is =t=, but verify the exact Emacs semantics first. + +Acceptance criteria: +- Set =vc-follow-symlinks= to the intended value explicitly. +- Add a small regression test or startup smoke assertion for this setting. +- Confirm opening a symlinked, version-controlled file no longer prompts. + +Done 2026-05-03: +- Confirmed from Emacs docs that =t= follows version-controlled symlinks without + prompting. +- Set =vc-follow-symlinks= explicitly to =t=. +- Added =tests/test-system-defaults-vc-follow-symlinks.el=. +** DONE [#B] Fix overwritten =C-; != system command prefix :bug:quick: +CLOSED: [2026-05-03 Sun] + +=system-commands.el= first binds =cj/system-command-map= under =C-; !=, then +later replaces the same prefix with =cj/system-command-menu=: + +#+begin_src emacs-lisp +(keymap-set cj/custom-keymap "!" cj/system-command-map) +... +(keymap-set cj/custom-keymap "!" #'cj/system-command-menu) +#+end_src + +That likely makes the documented subkeys such as =C-; ! r= and =C-; ! s= +unreachable. + +Expected outcome: +- Decide whether =C-; != is a prefix map or a direct menu command. +- If keeping both, bind the menu inside the prefix, e.g. =C-; ! != or =C-; ! m=. +- Add a key-resolution smoke test for the chosen bindings. + +Done 2026-05-03: +- Kept =C-; != as the prefix map. +- Moved the completing-read menu to =C-; ! !=. +- Added which-key labels for the documented subkeys. +- Added =tests/test-system-commands-keymap.el=. +** DONE [#B] Ensure formatters for TS, Python, Go, Shell with automated tests :tests: +CLOSED: [2026-04-30 Thu] + +Audit showed the four formatters were already consistently bound to =C-; f= +across the relevant mode-maps. No production change needed — this branch +shipped the regression net only. + +5 new files (1 testutil + 4 per-language test files), 17 tests total, all +passing. + +Per-language wiring inventory (locked in): +- Python: =blacken-buffer= in =python-ts-mode-map= (use-package =:bind=) +- Shell: =shfmt-buffer= in =sh-mode-map= and =bash-ts-mode-map= + (use-package =:bind=, gated on =:if (executable-find shfmt-path)=) +- Go: =gofmt= via =cj/go-mode-keybindings= hook + =local-set-key= +- TS / JS / Web: =cj/webdev-format-buffer= via =cj/webdev-keybindings= hook + +Each test file checks: prog module requires without error, formatter package +is in =features=, format command is fboundp, C-; f binding resolves, and the +underlying executable is on PATH (skipped via =ert-skip= if not installed). + +Real-formatting tests (run formatter on misformatted input, assert output) +were deferred — wiring tests catch the highest-frequency regressions cheaply +without crossing the boundary into testing the upstream formatter tools. +** DONE [#A] Continue coverage push on low-coverage modules :tests: +CLOSED: [2026-04-30 Thu] + +The four scoped low-coverage modules — =keybindings.el=, =config-utilities.el=, +=org-noter-config.el=, =host-environment.el= — are now covered. 121 new tests +across 18 test files. Plus one production bug fixed in +=cj/validate-org-agenda-timestamps= (property-check branch was dead since the +function was written: =(intern (downcase prop))= built plain symbols where +=org-element-property= expects keywords). + +Modules covered (per-function test files, Normal/Boundary/Error categories): + +- =keybindings.el= — =cj/jump-open-var=, the auto-generated jump commands. +- =host-environment.el= — laptop/desktop predicates, platform predicates, + display predicates, system-timezone detection. Folded a docstring fix on + =cj/detect-system-timezone= along the way. +- =config-utilities.el= — =with-timer=, =cj/compile-this-elisp-buffer=, + =cj/emacs-build--summary-string=, info-commands smoke. Plus refactor pass + to extract testable internals from the four heavyweight interactives: + =cj/--delete-compiled-files-in-dir=, =cj/--benchmark-method=, + =cj/--recompile-emacs-home=, =cj/--validate-timestamps-in-buffer= + + =cj/--format-validation-report-section=. +- =org-noter-config.el= — preferred-split, title-to-slug, + generate-notes-template, the predicate cluster. + +Broader scope (the 11 high-value untested modules, 7 lightly-tested ones, and +~28 use-package wrappers to triage) is tracked under the [#B] "Coverage audit: +untested and lightly-tested modules" entry. +** DONE [#B] Test Slack mark-as-read and bury buffer (C-; S q) :tests: +CLOSED: [2026-04-30 Thu] + +Verified working. =cj/slack-mark-read-and-bury= is bound to =C-; S q= in +=modules/slack-config.el=, replacing the previous binding that referenced a +non-existent =slack-buffer-mark-as-read-and-bury=. +** DONE [#A] Fix calendar-sync UNTIL boundary regression :bug: +CLOSED: [2026-05-03 Sun] + +Real cause was a Saturday-only flake in the test, not a stale =.elc= as +earlier triage suggested. =test-calendar-sync--expand-weekly-boundary-single-week-5-element-until= +built its byday string from a 0-indexed Sunday-first array +=("SU" "MO" "TU" "WE" "TH" "FR" "SA")= while the production code uses +Monday=1, Sunday=7 throughout. When start-date landed on a Sunday +(start-weekday=7), =(nth 7 array)= returned nil, and inside =expand-weekly= +the =(mod (- nil current-weekday) 7)= form raised +=wrong-type-argument number-or-marker-p nil=. The test failed every +Saturday (when "tomorrow" is Sunday) and passed the other six days. + +Fixed in commit =8ec668d= by switching the lookup to +=(nth (1- start-weekday) '("MO" "TU" "WE" "TH" "FR" "SA" "SU"))= — the +same convention as every other weekday-mapping in the codebase. Verified +across all 7 weekdays via faked =current-time=. + +Production code was internally consistent; no production change needed. +** DONE [#B] Investigate missing yasnippet configuration +CLOSED: [2026-02-16 Mon] + +Resolved: snippets were in ~/sync/org/snippets/ but directory was empty after +machine migration. Restored 28 snippets from backup, relocated snippets-dir +to ~/.emacs.d/snippets/ for source control. +** DONE [#B] Write Complete ERT Tests for This Config [13/13] +CLOSED: [2026-02-16 Mon] + +All 13 modules covered: custom-case (43), custom-datetime (10), hugo-config (41), +org-capture-config (22), modeline-config (26), config-utilities (11), +org-agenda-config (31), org-contacts-config (40), ui-config (27), +org-refile-config (16), org-webclipper (31), org-noter-config (30), +browser-config (20). 172 test files, all passing. +** DONE [#B] Validate recording startup +CLOSED: [2026-02-15 Sun 15:40] + +Check process status after starting. +Parse ffmpeg output for errors. +Show actual ffmpeg command for debugging. +** DONE [#C] Fix EMMS keybinding inconsistency with other buffers +CLOSED: [2026-02-15 Sun 15:40] + +EMMS keybindings conflict with standard buffer keybindings, causing mistypes. +Results in accidental destructive actions (clearing buffers), requires undo + context switch. +Violates Intuitive value - muscle memory should help, not hurt. +** DONE [#B] Update stale model list in ai-config.el +CLOSED: [2026-03-06 Fri] + +Model IDs were outdated. Updated to current models (claude-opus-4-6, claude-sonnet-4-6, etc.). +See cleanup task in ai-config.el for full list of related improvements. +** DONE [#C] Graduate easy-hugo into hugo-config.el, retire wip.el, uninstall pomm +CLOSED: [2026-04-22 Wed] + +Move the easy-hugo use-package block from modules/wip.el into modules/hugo-config.el so the full Hugo pipeline (new post → ox-hugo export → preview server → SSH deploy) lives in one place and is actually reachable at runtime. wip.el is currently not required in init.el, so its only live block (pomm) never ran anyway. + +Scope: +- Verify easy-hugo is usable against current Hugo CLI and the paths in the existing config (~/code/cjennings-net/, /var/www/cjennings/). +- If easy-hugo is healthy: graduate it and propose keybindings under the C-; h hugo prefix. +- If easy-hugo is unmaintained or broken: document the issues, assess whether fixing or forking is viable. +- Delete modules/wip.el entirely and remove the commented-out (require 'wip) line at init.el:156. +- Uninstall pomm (remove from elpa/). +- Confirm make compile no longer warns about wip or pomm. +** DONE [#C] Consider Recording Enhancement via post-processing hooks +CLOSED: [2026-04-04 Sat 12:00] + +Auto-compress after recording. +Move to cloud sync directory. +Generate transcript (once transcription workflow exists). +** DONE [#B] Implement coverage reporting (per docs/specs/coverage-spec-implemented.org) +CLOSED: [2026-04-23] + +Diff-aware coverage report with pluggable backends. Shipped v1 on 2026-04-23. + +Design: [[id:7d7f4486-fad7-4f0a-bd9a-775bd4cd8f7e][docs/specs/coverage-spec-implemented.org]] + +What shipped: +- modules/coverage-core.el (engine, backend registry, cj/coverage-report, cj/coverage-report-mode) +- modules/coverage-elisp.el (undercover.el backend, auto-registered on load) +- make coverage Makefile target (simplecov JSON output, per-file isolation, .elc cleanup, exclusion list) +- tests/run-coverage-file.el (undercover driver for the Makefile) +- ERT tests for all pure helpers (parse-simplecov, parse-diff, intersect, format-report, backend registry, scope lookup) plus one smoke test for the command +- F7 global binding +- docs/specs/coverage-spec-implemented.org (design doc with historical LCOV→simplecov pivot note) + +Notable pivots during implementation: +- Switched collection format from LCOV to simplecov (undercover's :merge-report t only supports simplecov). +- `make coverage` must delete modules/*.elc first so undercover's source-level instrumentation actually fires. +- Excluded tests/test-all-comp-errors.el from coverage runs (byte-compiles modules, which fails under undercover instrumentation). + +Deferred to future tickets: +- Python, TypeScript, Go backends +- Fringe-overlay coverage display (parked over perf concerns) +- Historical coverage tracking +** DONE [#A] Fix "Invalid face attribute :foreground nil" flood :bug: +CLOSED: [2026-04-26 Sun 20:15] + +Diagnosed 2026-04-26 — paused at /start-work Gate 2. The diagnostic was originally saved to =~/code/emacs-wttrin/inbox/wttrin-face-flood-diagnosis.txt= but that file has since been cleaned out of the wttrin inbox; the summary below is the surviving record. + +Summary: root cause is =wttrin--make-emoji-icon= in =~/code/emacs-wttrin/wttrin.el:598-608=. Builds a face spec with =:foreground foreground= unconditionally when =wttrin-mode-line-emoji-font= is set; the caller passes nil when the cache is fresh, producing =(:family ... :foreground nil)= which Emacs treats as invalid on every redisplay. + +Fix lives in the wttrin repo (cross-repo), not =.emacs.d=. Two-commit scope: regression test + fix. +** DONE [#B] Test Slack desktop notifications (DM and @mention) :tests: +CLOSED: [2026-04-26 Sun] + +Notifications were silently failing due to two bugs in =cj/slack-notify=: +1. =slack-room-im-p= (nonexistent) → =slack-im-p= (correct EIEIO predicate) +2. =slack-message-to-string= (propertized) → =slack-message-body= (plain text) + +Verified in actual Slack use: desktop notifications fire correctly for DMs and @mentions, with the title and message body rendering as expected. + +*File:* modules/slack-config.el (cj/slack-notify function) +** DONE [#C] Clean up ai-config.el +CLOSED: [2026-03-06 Fri] + +Cleaned up assorted issues in =modules/ai-config.el=: +- Stale model list updated to current IDs (=claude-opus-4-6=, =claude-sonnet-4-6=, etc.). +- Removed duplicate =gptel-backend= setq (lines 284 and 295 both did the same set). +- Deleted the unused =cj/gptel-backends= defvar (duplicated =cj/gptel--available-backends=). +- Moved helpers (=cj/gptel--fresh-org-prefix=, =cj/gptel--refresh-org-prefix=, =cj/gptel-backend-and-model=, =cj/gptel-insert-model-heading=) outside the use-package =:config= block for visibility and byte-compilation. +- Changed =gptel-include-reasoning= from ='ignore= to a buffer name (=*AI-Reasoning*=) so reasoning lands in a separate buffer, isn't re-sent as context, and can be toggled per-session via the gptel menu (=C-; a M=). +- Switched =gptel-magit= loading from a hook to lazy autoloads via =with-eval-after-load 'magit= so it only loads on key press. +- Moved Rewrite from =&= to =C-; a r= and Clear context to =C-; a c= for clearer mnemonics. +** DONE [#B] Use file basename, not buffer name, when moving buffer files :review:bug:quick: +CLOSED: [2026-05-03 Sun] +:PROPERTIES: +:ARCHIVE_TIME: 2026-05-03 Sun 19:24 +:ARCHIVE_FILE: ~/.emacs.d/todo.org +:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review custom editing utility modules +:ARCHIVE_CATEGORY: todo +:ARCHIVE_TODO: DONE +:ARCHIVE_ITAGS: review +:END: + +=cj/--move-buffer-and-file= builds the destination as =(concat dir "/" name)=, +where =name= is =(buffer-name)=. If the buffer has been renamed, uniquified +(e.g. =foo.txt<2>=), or otherwise differs from the file basename, the move can +write an unexpected destination filename. + +Expected outcome: +- Use =(file-name-nondirectory filename)= for the destination basename unless + the interactive command explicitly asks for a new name. +- Add regression tests for: + - renamed buffer visiting =original.txt=, + - duplicate buffer names / uniquified names, + - target directory with and without trailing slash. + +Done 2026-05-03: +- =cj/--move-buffer-and-file= now derives the destination basename from + =buffer-file-name=. +- =cj/move-buffer-and-file= uses the same basename when checking/prompting for + overwrite. +- Added regression coverage for renamed and uniquified buffer names. +** DONE [#B] Fix malformed drill capture template in =org-capture-config.el= :review:bug:quick: +CLOSED: [2026-05-03 Sun] +:PROPERTIES: +:ARCHIVE_TIME: 2026-05-03 Sun 19:28 +:ARCHIVE_FILE: ~/.emacs.d/todo.org +:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review Org workflow modules +:ARCHIVE_CATEGORY: todo +:ARCHIVE_TODO: DONE +:ARCHIVE_ITAGS: review +:END: + +The ="d"= drill capture template appears to have a malformed source link: + +#+begin_src org +Source: [[%:link][%:description] +nCaptured On: %U +#+end_src + +It is missing the closing =]]= and has a literal leading =n= before "Captured". + +Expected outcome: +- Fix the template string. +- Add a narrow test that expands or inspects the template and confirms the + source link plus "Captured On" line are well-formed. + +Done 2026-05-03: +- Closed the source link in the regular drill capture template. +- Removed the stray literal =n= before =Captured On=. +- Added =tests/test-org-capture-config-drill-template.el=. +** DONE [#B] Disable auth-source debug logging by default :review:security:quick: +CLOSED: [2026-05-03 Sun] +:PROPERTIES: +:ARCHIVE_TIME: 2026-05-03 Sun 19:40 +:ARCHIVE_FILE: ~/.emacs.d/todo.org +:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review integrations and application modules +:ARCHIVE_CATEGORY: todo +:ARCHIVE_TODO: DONE +:ARCHIVE_ITAGS: review +:END: + +=auth-config.el= sets =auth-source-debug= to =t=. Debug output is helpful while +fixing GPG/auth-source issues, but credential lookup debug logging should not be +the steady-state default for a config that handles Slack, AI, REST, mail, and +transcription credentials. + +Expected outcome: +- Default =auth-source-debug= to nil. +- Add an explicit troubleshooting command or variable to enable auth debugging + temporarily. +- Confirm no module logs secret values directly on auth failure. + +Done 2026-05-03: +- Defaulted =auth-source-debug= to nil via =cj/auth-source-debug-enabled=. +- Added =cj/set-auth-source-debug= and =cj/toggle-auth-source-debug= for + temporary troubleshooting. +- Added =tests/test-auth-config-debug.el=. +- Scanned nearby auth callers; obvious failure messages name hosts/logins but + do not print secret values directly. +** DONE [#B] Quote F6 current-file test commands in =dev-fkeys.el= :review:bug:quick: +CLOSED: [2026-05-03 Sun] +:PROPERTIES: +:ARCHIVE_TIME: 2026-05-03 Sun 19:44 +:ARCHIVE_FILE: ~/.emacs.d/todo.org +:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review programming workflow modules +:ARCHIVE_CATEGORY: todo +:ARCHIVE_TODO: DONE +:ARCHIVE_ITAGS: review +:END: + +=cj/--f6-test-runner-cmd-for= builds shell command strings from relative paths, +directories, and source stems: + +#+begin_src emacs-lisp +(format "pytest %s" rel-path) +(format "make test-name TEST=^test-%s-" stem) +(format "go test ./%s" rel-dir) +#+end_src + +This is fine for the current repo's simple filenames, but it will break or +misbehave for paths with spaces or shell metacharacters. Since these commands +feed =compile=, either quote each dynamic argument or move to a command-builder +that returns argv plus a shell-rendering function. + +Expected outcome: +- Quote =rel-path=, =stem= / test regex, and =rel-dir= appropriately. +- Add regression tests for: + - Python test file under a directory with spaces, + - Elisp module stem containing shell-significant characters, + - Go package directory with spaces. +- Keep existing command strings unchanged for ordinary paths. + +Done 2026-05-03: +- Added =cj/--f6-shell-quote-argument= so F6 command strings escape dynamic + paths and test regexes only when needed. +- Quoted Python rel-paths, generated Python test paths, Elisp =FILE= / + =TEST= values, and Go package paths. +- Added regression coverage for Python paths with spaces, Elisp stems with + shell metacharacters, and Go package directories with spaces. +- Confirmed ordinary command strings remain unchanged. +** DONE [#B] Disable mail transport debug logging and validate dependencies :review:security: +CLOSED: [2026-05-03 Sun] +:PROPERTIES: +:ARCHIVE_TIME: 2026-05-03 Sun 19:57 +:ARCHIVE_FILE: ~/.emacs.d/todo.org +:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review integrations and application modules +:ARCHIVE_CATEGORY: todo +:ARCHIVE_TODO: DONE +:ARCHIVE_ITAGS: review +:END: + +=mail-config.el= sets =smtpmail-debug-info= to =t= and builds mail commands from +=executable-find= results at config time. If =msmtp= or =mbsync= is missing, the +configuration can silently produce unusable command values. Mail debug output is +also too sensitive to leave enabled by default. + +Expected outcome: +- Default =smtpmail-debug-info= to nil. +- Add an explicit mail troubleshooting variable/command for temporary SMTP + debug logging. +- Validate =msmtp= and =mbsync= before assigning send/sync commands, and show a + clear warning or disable the dependent feature when missing. +- Add a module-load test with stubbed =executable-find= results. + +Done 2026-05-03: +- Defaulted =smtpmail-debug-info= to nil via =cj/smtpmail-debug-enabled=. +- Added =cj/set-smtpmail-debug= and =cj/toggle-smtpmail-debug= for temporary + troubleshooting. +- Added validation helpers for =msmtp= and =mbsync= so missing executables + warn and do not produce unusable command values. +- Added =tests/test-mail-config-transport.el= with stubbed executable lookup. +** DONE [#B] Make test scratch paths sandbox- and CI-friendly :refactor:tests: +CLOSED: [2026-05-03 Sun] +:PROPERTIES: +:ARCHIVE_TIME: 2026-05-03 Sun 19:59 +:ARCHIVE_FILE: ~/.emacs.d/todo.org +:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#A] Architecture review follow-up from 2026-05-03 +:ARCHIVE_CATEGORY: todo +:ARCHIVE_TODO: DONE +:ARCHIVE_ITAGS: refactor +:END: + +=tests/testutil-general.el= hardcodes =~/.temp-emacs-tests/=. That caused the +first =make coverage= run to fail under the default workspace sandbox because +tests attempted to write outside the repo and =/tmp=. + +Confirmed again 2026-05-03 with =make test=: the default sandbox run reported +32 failing test files across custom-buffer, custom-line, music, Org, undead +buffers, and recording cleanup tests. Rerunning the same command with approval +outside the sandbox passed all 311 test files. This is a test-environment +contract problem, not a regression in those modules. + +Expected outcome: +- Let tests honor an env var, for example =CJ_EMACS_TEST_DIR=. +- Default to =(make-temp-file ... t)= or a stable directory under + =temporary-file-directory=. +- Keep an option for a stable local directory when debugging manually. +- Ensure cleanup is robust and guarded against deleting outside the selected + test root. + +Acceptance criteria: +- =make test-file FILE=test-custom-line-paragraph-join-line-or-region.el= + works without special home-directory write permission. +- =make coverage= works in a clean sandbox/CI environment. +- Update any docs or Makefile notes that assume =~/.temp-emacs-tests/=. + +Done 2026-05-03: +- Changed =cj/test-base-dir= to honor =CJ_EMACS_TEST_DIR= for stable local + debugging and otherwise create a unique directory under + =temporary-file-directory=. +- Replaced prefix-string path checks with =file-in-directory-p= and added a + deletion guard that refuses broad roots such as =temporary-file-directory=. +- Updated =make clean-tests= to clean the new temp-root pattern and the legacy + =~/.temp-emacs-tests= directory. +- Added =tests/test-testutil-general.el=. +- Confirmed default sandbox =make test= passes: 312 test files. +** DONE [#B] Fix C single-file compile command path handling :review:bug: +CLOSED: [2026-05-03 Sun] +:PROPERTIES: +:ARCHIVE_TIME: 2026-05-03 Sun 20:11 +:ARCHIVE_FILE: ~/.emacs.d/todo.org +:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review programming workflow modules +:ARCHIVE_CATEGORY: todo +:ARCHIVE_TODO: DONE +:ARCHIVE_ITAGS: review +:END: + +=prog-c.el= builds the fallback single-file compile command from =(buffer-name)=: + +#+begin_src emacs-lisp +(format "gcc -Wall -Wextra -g -o %s %s" + (file-name-sans-extension (buffer-name)) + (buffer-name)) +#+end_src + +This breaks for renamed buffers, duplicate buffer names, paths with spaces, and +files outside =default-directory=. + +Expected outcome: +- Use =buffer-file-name= for source path and derive output from the file path. +- Shell-quote both paths. +- If the buffer is not visiting a file, show a clear message or use a safe temp + target. +- Add regression tests for filenames with spaces and renamed buffers. + +Done 2026-05-03: +- Added =cj/c--single-file-compile-command= and changed the fallback path to + use =buffer-file-name= instead of =(buffer-name)=. +- Shell-quoted source and output paths. +- Made non-file buffers signal a clear =user-error=. +- Added =tests/test-prog-c-compile-command.el= for spaces, shell + metacharacters, renamed buffers, and non-file buffers. +** DONE [#B] Replace shell-based coverage git diff calls with argv process calls :review:robustness:refactor: +CLOSED: [2026-05-03 Sun] +:PROPERTIES: +:ARCHIVE_TIME: 2026-05-03 Sun 20:11 +:ARCHIVE_FILE: ~/.emacs.d/todo.org +:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review programming workflow modules +:ARCHIVE_CATEGORY: todo +:ARCHIVE_TODO: DONE +:ARCHIVE_ITAGS: review +:END: + +=coverage-core.el= uses =shell-command-to-string= for git diff scopes, including +forms with command substitution: + +#+begin_src emacs-lisp +git diff $(git merge-base HEAD main)..HEAD --unified=0 +#+end_src + +The inputs are mostly fixed, but this code is central tooling and should avoid +shell parsing entirely. + +Expected outcome: +- Use =process-file= / =call-process= with argv lists. +- Compute merge bases with a separate git invocation. +- Surface git failures as clear =user-error= messages. +- Preserve the existing parser and report formatting tests. + +Done 2026-05-03: +- Added argv-boundary tests before the implementation change. +- Replaced =shell-command-to-string= with =process-file= based git helpers. +- Compute merge-base with a separate =git merge-base HEAD <base>= invocation + before running =git diff <merge-base>..HEAD --unified=0=. +- Surface non-zero git exits as =user-error= messages that include the git + argv, exit status, and command output. +- Updated the interactive coverage report smoke test to stub =process-file=. +** DONE [#B] Cache or cheapen VC work in the custom modeline :review:perf: +CLOSED: [2026-05-03 Sun] +:PROPERTIES: +:ARCHIVE_TIME: 2026-05-03 Sun 20:24 +:ARCHIVE_FILE: ~/.emacs.d/todo.org +:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review UI and navigation modules +:ARCHIVE_CATEGORY: todo +:ARCHIVE_TODO: DONE +:ARCHIVE_ITAGS: review +:END: + +=modeline-config.el= computes VC branch/state in a mode-line =:eval= form using +=vc-backend=, =vc-working-revision=, =vc-git--symbolic-ref=, and =vc-state=. +Even though it only displays for the selected window, this can become expensive +in large repositories, remote/TRAMP buffers, or slow filesystems. + +Expected outcome: +- Measure the current cost in normal git repos and a TRAMP/remote-like case if + available. +- Cache branch/state per buffer and invalidate on buffer/file save, VC refresh, + or timer. +- Avoid VC calls for remote files unless explicitly enabled. +- Add tests around any pure formatting/cache invalidation helpers. + +Pitfalls: +- Mode-line code runs often; avoid anything that can block redisplay. +- Do not lose the useful active-window-only behavior. + +Done 2026-05-03: +- Added buffer-local VC modeline caching with a short TTL, plus cache clearing + on save and revert. +- Kept the active-window-only modeline rendering behavior. +- Skipped VC work for remote files by default, with a custom option to opt in. +- Added focused tests for cache reuse, TTL refresh, remote-file bypass, cache + clearing, and VC rendering metadata. +- Measured on this repo after the change: uncached reads were about 2.4 ms + each, cached reads were about 0.0025 ms each, and remote-skipped reads avoid + VC calls while still paying the cheap =file-remote-p= check. +** DONE [#B] Make Projectile command-cache revert state compilation-local :review:robustness:bug: +CLOSED: [2026-05-03 Sun] +:PROPERTIES: +:ARCHIVE_TIME: 2026-05-03 Sun 21:11 +:ARCHIVE_FILE: ~/.emacs.d/todo.org +:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review programming workflow modules +:ARCHIVE_CATEGORY: todo +:ARCHIVE_TODO: DONE +:ARCHIVE_ITAGS: review +:END: + +=dev-fkeys.el= protects Projectile's compile/test/run command caches by +capturing prior state in the global =cj/--projectile-revert-state= and reverting +on failed compile when the cached command changed. The idea is useful and well +covered, but the state is global while compilation processes are asynchronous. + +Risk: +- Starting another Projectile compile/test/run before the first finish hook + fires can overwrite the state. +- The finish hook is installed even when no project/cache state was captured. +- A failure from one compilation buffer could theoretically act on state from a + later command. + +Expected outcome: +- Store revert metadata on the compilation buffer/process where possible, or + close over immutable state in a one-shot hook instead of using one global + variable. +- Only install the revert hook when state was captured. +- Add a test that simulates two overlapping compile processes finishing out of + order. + +Done 2026-05-03: +- Changed Projectile command-cache revert capture to return immutable state + instead of storing live compile metadata in one global variable. +- Installed one-shot buffer-local compilation finish hooks on the compilation + buffer returned by Projectile, so overlapping compiles keep separate revert + metadata. +- Avoided installing revert hooks when no project/cache state was captured. +- Added regression coverage for two overlapping compiles finishing out of order. +** DONE [#C] Tighten =dev-fkeys.el= load-order contract with Projectile :review:cleanup: +CLOSED: [2026-05-03 Sun] +:PROPERTIES: +:ARCHIVE_TIME: 2026-05-03 Sun 21:17 +:ARCHIVE_FILE: ~/.emacs.d/todo.org +:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review programming workflow modules +:ARCHIVE_CATEGORY: todo +:ARCHIVE_TODO: DONE +:ARCHIVE_ITAGS: review +:END: + +=init.el= loads =dev-fkeys.el= before =prog-general.el=, while =prog-general.el= +owns the =projectile= setup. =dev-fkeys.el= currently works through autoloads, +=fboundp= checks, and top-level advice, but the dependency is implicit. + +Expected outcome: +- Either require/load Projectile before installing advice, or move the + =dev-fkeys= require after Projectile setup. +- Keep direct batch requiring of =dev-fkeys.el= test-friendly. +- Add a module-load smoke test for "Projectile not loaded yet" and "Projectile + loaded after dev-fkeys". + +Done 2026-05-03: +- Replaced raw top-level Projectile =advice-add= calls with named advice + wrappers and an explicit idempotent installer. +- Registered advice immediately when Projectile is already loaded, otherwise + delayed installation with =eval-after-load=. +- Kept direct batch requiring of =dev-fkeys.el= from forcing Projectile to load. +- Added smoke tests for deferred registration, already-loaded registration, and + bounded installation behavior when Projectile functions are unavailable. +** DONE [#B] Retire legacy =cj/--projectile-revert-on-fail= and global revert state :review:chore: +CLOSED: [2026-05-03 Sun] +:PROPERTIES: +:ARCHIVE_TIME: 2026-05-03 Sun 21:32 +:ARCHIVE_FILE: ~/.emacs.d/todo.org +:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review programming workflow modules +:ARCHIVE_CATEGORY: todo +:ARCHIVE_TODO: DONE +:ARCHIVE_ITAGS: review +:END: + +After scoping the projectile cache-revert state to each compile (commit +=31edc86=), =cj/--projectile-revert-on-fail= and the global +=cj/--projectile-revert-state= are production-dead. They survive only so +=tests/test-dev-fkeys--projectile-revert-on-fail.el= keeps exercising the +inner decision logic via the legacy wrapper. + +Expected outcome: +- Delete =cj/--projectile-revert-on-fail= and =cj/--projectile-revert-state= + from =modules/dev-fkeys.el=. +- Re-point the existing =test-dev-fkeys--projectile-revert-on-fail.el= cases + at =cj/--projectile-revert-state-on-fail= (or rename the file to match + the new target). +- Confirm the broader dev-fkeys test set still passes after the rename. + +Done 2026-05-03: +- Removed the production-dead legacy wrapper and global revert state from + =dev-fkeys.el=. +- Repointed the existing revert tests at =cj/--projectile-revert-state-on-fail=. +- Removed stale test bindings/assertions that only existed for the legacy global + state. +** DONE [#C] Review duplicate or competing search/keybinding setup in =selection-framework.el= :review:cleanup: +CLOSED: [2026-05-03 Sun] +:PROPERTIES: +:ARCHIVE_TIME: 2026-05-03 Sun 23:27 +:ARCHIVE_FILE: ~/.emacs.d/todo.org +:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review UI and navigation modules +:ARCHIVE_CATEGORY: todo +:ARCHIVE_TODO: DONE +:ARCHIVE_ITAGS: review +:END: + +=selection-framework.el= binds =C-s= to =consult-line= and later rebinds it to +=cj/consult-line-or-repeat=. The final behavior is probably intended, but the +earlier binding is dead configuration and makes the file harder to reason about. + +Expected outcome: +- Remove the intermediate =C-s= binding or explain it. +- Add a small test or smoke check that =C-s= resolves to + =cj/consult-line-or-repeat= after the module loads. + +Verify 2026-05-03: +- Removed the intermediate global =C-s= binding to =consult-line=. +- Kept the final =C-s= binding to =cj/consult-line-or-repeat=. +- Added a smoke test that loads =selection-framework.el= with package setup + stubbed and asserts =C-s= resolves to =cj/consult-line-or-repeat=. +** DONE [#C] Move and test theme persistence behavior :review:tests:refactor: +CLOSED: [2026-05-03 Sun] +:PROPERTIES: +:ARCHIVE_TIME: 2026-05-03 Sun 23:46 +:ARCHIVE_FILE: ~/.emacs.d/todo.org +:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review UI and navigation modules +:ARCHIVE_CATEGORY: todo +:ARCHIVE_TODO: DONE +:ARCHIVE_ITAGS: review +:END: + +=ui-theme.el= persists theme names to =theme-file= and loads fallback themes +when the file is absent or invalid. The current default path is built from +=org-dir= as =emacs-theme.persist=, which makes UI theme persistence depend on +Org-directory configuration and keeps an Emacs preference outside the Emacs +home directory. + +Desired direction: +- Make the persisted theme file a dotfile inside =user-emacs-directory=, e.g. + =.emacs-theme= or another clear dotfile name. +- Remove the runtime need for =org-dir= from theme persistence. +- Keep the theme persistence code self-contained in =ui-theme.el= unless an + existing constants helper is a better local fit. +- Preserve the current user-facing behavior: chosen themes persist, unreadable + or invalid saved themes fall back, and literal ="nil"= means no enabled theme. +- Refactor the current large theme-load function into smaller helpers for: + reading persisted theme names, disabling enabled themes, loading one named + theme, applying a persisted theme value, and loading fallback themes. +- Prefer =defcustom= for user-facing persistence/fallback settings. +- Replace generic =cj/read-file-contents= / =cj/write-file-contents= names with + theme-specific helpers or move generic helpers elsewhere. +- Prefer =write-region= over visiting the file with =write-file= for persistence. +- Decide whether the top-level =(cj/load-theme-from-file)= side effect should + remain in the module or become an explicit init call; preserve startup behavior + either way. + +Useful tests: +- The default =theme-file= expands under =user-emacs-directory= and does not + depend on =org-dir=. +- Reading a missing/unreadable theme file returns nil. +- Writing to a writable temp theme file succeeds. +- Invalid theme name triggers fallback path without leaving multiple themes + enabled. +- The literal ="nil"= disables themes. +- Loading a valid persisted theme uses that theme and does not also load the + fallback. +- Theme application disables existing themes before loading a valid or fallback + theme, so themes do not stack. +- Theme writes use the configured =theme-file= and do not visit that file in a + temp buffer. + +Keep tests isolated by binding =theme-file= to a temp file and mocking +=load-theme= / =disable-theme= where appropriate. Avoid mutating the real +=custom-enabled-themes= state in tests. + +Pitfalls: +- =ui-theme.el= currently calls =cj/load-theme-from-file= at module load time, + so tests should either bind =theme-file= before loading or mock file/theme + effects carefully. +- If changing the persisted filename, consider whether a migration path from + the old =org-dir/emacs-theme.persist= location is worth doing now or should + be a separate compatibility task. + +Verify 2026-05-03: +- Moved the default =theme-file= to =(expand-file-name ".emacs-theme" + user-emacs-directory)=. +- Removed the =org-dir= / =user-constants= dependency from =ui-theme.el= theme + persistence. +- Split theme persistence into theme-specific helpers for read/write, + disabling themes, named theme loading, fallback loading, and applying a + persisted value. +- Switched persistence writes to =write-region=. +- Moved startup theme loading out of module load side effects and into + =init.el= immediately after requiring =ui-theme=. +- Added focused tests for the default path, missing reads, writes, + =write-region= use, valid persisted themes, invalid fallback, missing + fallback, and literal ="nil"=. +- Verified with =make test-file FILE=test-ui-theme-persistence.el=, + =make test-file FILE=test-all-comp-errors.el=, + =make test-file FILE=test-dupre-theme.el=, and full =make test=. +** DONE [#B] Make test-runner focus state project-scoped :review:tests:bug: +CLOSED: [2026-05-03 Sun] +:PROPERTIES: +:ARCHIVE_TIME: 2026-05-03 Sun 23:46 +:ARCHIVE_FILE: ~/.emacs.d/todo.org +:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review programming workflow modules +:ARCHIVE_CATEGORY: todo +:ARCHIVE_TODO: DONE +:ARCHIVE_ITAGS: review +:END: + +=test-runner.el= stores =cj/test-focused-files= and =cj/test-mode= globally. +When switching between projects, focused test filenames and mode can bleed into +the next project. + +Expected outcome: +- Scope focused files and mode by project root. +- Keep the current UI commands unchanged. +- Coordinate with the existing [#B] "Add project-aware ERT test isolation when + switching projects" task so test registration and focus state follow the same + project boundary. + +Verify 2026-05-03: +- Added per-project test-runner state keyed by Projectile project root, with + focused files and all/focused mode tracked independently per project. +- Kept the existing interactive commands and legacy public variables mirrored + to the current project state. +- Removed the hard test-time dependency on requiring Projectile before project + root calls can be mocked. +- Added regression tests proving focused files and mode do not bleed across + projects. +- Verified with =make test-file FILE=test-test-runner.el=, + =make test-file FILE=test-all-comp-errors.el=, + =make test-file FILE=test-dev-fkeys--f6-test-runner.el=, + =make test-file FILE=test-dev-fkeys--f6-current-file-tests-impl.el=, and + full =make test=. +** DONE [#B] Add project-aware ERT test isolation when switching projects :tests: +CLOSED: [2026-05-03 Sun] +:PROPERTIES: +:ARCHIVE_TIME: 2026-05-03 Sun 23:46 +:ARCHIVE_FILE: ~/.emacs.d/todo.org +:ARCHIVE_OLPATH: Emacs Open Work +:ARCHIVE_CATEGORY: todo +:ARCHIVE_TODO: DONE +:END: + +When switching between elisp projects (e.g., emacs.d to Chime), previously loaded +ERT tests remain in memory causing confusion and wrong tests to run. + +**Problem:** +- ERT tests globally registered in Emacs session +- `M-x ert RET t RET` runs ALL loaded tests from ALL projects +- Can accidentally run emacs.d tests when working on Chime +- Current workaround: restart Emacs (loses session state) + +**Solution:** +Create `cj/ert-clear-tests` and `cj/ert-run-current-project-tests`: +- Clear tests when switching projects (hook into project-switch) +- Use test name prefixes to selectively clear (cj/ vs chime-) +- Only run current project's tests + +**Success Criteria:** +- Switch projects -> old tests cleared +- Only current project's tests run with `M-x ert` +- Works with both interactive and batch runs + +Verify 2026-05-03: +- Added =cj/ert-clear-tests= to delete ERT tests loaded by this runner from + other known project roots while keeping the current project's tests. +- Added =cj/ert-run-current-project-tests= and routed =cj/test-run-all= through + a current-project selector, so the test runner's "all" path runs all tests + for the current project rather than every loaded ERT test in the session. +- Hooked =cj/test-project-switch-reset= into + =projectile-after-switch-project-hook= after Projectile loads. +- Added regression tests for clearing other-project ERT tests and selecting + only current-project test names. +- Verified with =make test-file FILE=test-test-runner.el=, + =make test-file FILE=test-all-comp-errors.el=, + =make test-file FILE=test-dev-fkeys--f6-test-runner.el=, + =make test-file FILE=test-dev-fkeys--f6-current-file-tests-impl.el=, and + full =make test=. +** DONE [#B] Sanitize calendar-generated Org headings and properties :review:bug: +CLOSED: [2026-05-03 Sun] +:PROPERTIES: +:ARCHIVE_TIME: 2026-05-03 Sun 23:52 +:ARCHIVE_FILE: ~/.emacs.d/todo.org +:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review integrations and application modules +:ARCHIVE_CATEGORY: todo +:ARCHIVE_TODO: DONE +:ARCHIVE_ITAGS: review +:END: + +=calendar-sync--event-to-org= sanitizes description body text against accidental +Org headings, but event summaries, locations, organizers, statuses, and URLs are +inserted into headings/property drawers directly. Calendar text containing +newlines, leading stars, or property drawer markers can corrupt the generated +Org structure. + +Expected outcome: +- Add separate sanitizers for Org heading text and property values. +- Preserve readable event text while escaping or flattening structural + characters. +- Add tests for summaries with newlines/stars and locations with property-like + lines. + +Verify 2026-05-03: +- Added separate sanitizers for Org heading text and Org property values. +- Event summaries now flatten newlines and convert leading heading stars to + dashes before being inserted as Org heading text. +- Location, organizer, status, and URL values now collapse structural + whitespace into single-line property values before insertion into the + property drawer. +- Added regression tests for summaries with newlines/stars and property values + containing =:END:=, property-looking text, and heading-looking text. +- Verified with =make test-file FILE=test-calendar-sync--event-to-org.el=, + =make test-file FILE=test-calendar-sync--sanitize-org-body.el=, + =make test-file FILE=test-all-comp-errors.el=, + =make test-file FILE=test-calendar-sync.el=, + =make test-file FILE=test-calendar-sync--parse-event.el=, + =make test-file FILE=test-calendar-sync--event-start-time.el=, and full + =make test=. +** DONE [#B] Add a no-config startup test for =calendar-sync.el= :review:security:refactor: +CLOSED: [2026-05-04 Mon] +:PROPERTIES: +:ARCHIVE_TIME: 2026-05-04 Mon 00:05 +:ARCHIVE_FILE: ~/.emacs.d/todo.org +:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review Org workflow modules/PROJECT [#A] Split personal calendar configuration from =calendar-sync.el= +:ARCHIVE_CATEGORY: todo +:ARCHIVE_TODO: DONE +:ARCHIVE_ITAGS: review security refactor +:END: + +Bind =calendar-sync-calendars= to nil and verify: +- requiring the module does not start a timer, +- =calendar-sync-status= reports the missing configuration cleanly, +- no network process is started. + +Verify 2026-05-03: +- Removed the tracked top-level personal calendar plist from =calendar-sync.el=, + leaving =calendar-sync-calendars= nil by default. +- Added an ignored private config path, =calendar-sync.local.el=, loaded when + readable so local calendar definitions can stay outside git. +- Added =calendar-sync.local.el= to =.gitignore= and moved the current local + calendar plist into that ignored file to preserve this machine's workflow. +- Gated top-level auto-start behind =(not noninteractive)= so batch/test loads + do not start timers or network fetches, even when private config exists. +- Added startup tests for no-config loads, missing-config status reporting, + private config loading, and private config not auto-starting in batch. +- Verified with =make test-file FILE=test-calendar-sync-no-config-startup.el=, + =make test-file FILE=test-calendar-sync.el=, + =make test-file FILE=test-all-comp-errors.el=, and full =make test=. +** DONE [#C] Add focused tests for early startup archive construction :tests: +CLOSED: [2026-05-10 Sun] + +=tests/test-early-init-paths.el= covers path constants, but not archive +selection, archive priorities, refresh decisions, or the offline/localrepo +branches that make startup reproducible. + +Useful assertions after package bootstrap is extracted: +- Local repo and local mirrors are added only when their directories exist. +- Local archives keep higher priority than online archives. +- =cj/use-online-repos= disables online archives and refresh attempts. +- Stale or missing online archive caches request refresh only through the + extracted bootstrap path, not by loading unrelated modules. + +Verify 2026-05-10: +- Extended =tests/test-early-init-paths.el= to cover local archive presence, + local-vs-online priority, offline archive omission, fresh-cache no-refresh, + and missing-cache refresh behavior. +- Ran =make test-file FILE=test-early-init-paths.el=. +** DONE [#C] Move inline GPT tool wiring out of =init.el= :startup:refactor: +CLOSED: [2026-05-10 Sun] + +=init.el= contains a =with-eval-after-load 'gptel= block that mutates +=load-path= and requires local files from =~/.emacs.d/gptel-tools=. This is +feature-specific integration code inside the top-level load graph, and it will +be hard to test or defer cleanly while it stays inline. + +Expected outcome: +- Move the tool registration into =ai-config.el= or a small dedicated module. +- Guard the local tool directory and individual tool files so missing optional + files produce a clear message rather than breaking startup after =gptel= loads. +- Keep =init.el= limited to coarse module loading until the load-graph refactor + removes most eager =require=s. +- Add a smoke test for the missing-directory path if the helper is pure enough. + +Verify 2026-05-10: +- Moved optional GPTel tool loading into =ai-config.el= via + =cj/gptel-load-local-tools=. +- Removed the inline =with-eval-after-load 'gptel= tool block from =init.el=. +- Added =tests/test-ai-config-gptel-local-tools.el= for missing-directory, + present-tool, and missing-file behavior. +- Ran focused AI config tests and checked parens for =init.el= and + =modules/ai-config.el=. +** DONE [#C] Clean up Org keymap ownership and duplicate maps :cleanup:refactor: +CLOSED: [2026-05-10 Sun] + +=org-config.el= creates =cj/org-map= under =cj/custom-keymap=, then later +creates a separate =cj/org-keymap= under =C-; O=. Other Org modules bind their +own global prefixes directly. This works with the current eager load order, but +it makes the intended owner of Org commands less clear. + +Expected outcome: +- Pick one owner for the Org command prefix. +- Move module-specific menus under that owner or document why they remain + separate (=C-c n= for org-roam may be worth keeping). +- Avoid duplicate definitions for =C-; O= and =cj/org-map=. +- Coordinate with the broader custom keymap/load-order architecture task. + +Verify 2026-05-10: +- Removed the duplicate =cj/org-keymap= and kept =cj/org-map= as the single + owner of =C-; O= through =cj/custom-keymap=. +- Kept =C-; O c= bound to =cj/org-clear-element-cache=, which handles all Org + buffers by default and only the current Org buffer with a prefix argument. +- Added =tests/test-org-config-keymap-ownership.el= and updated the existing + Org sort test to load newer source in the presence of ignored =.elc= files. +- Ran =make test-file FILE=test-org-config-keymap-ownership.el= and + =make test-file FILE=test-org-sort-by-todo-and-priority.el=. +** DONE [#A] Make repo reconciliation non-destructive by default :data:refactor: +CLOSED: [2026-05-10 Sun] + +Before this refactor, =reconcile-open-repos.el= recursively scanned repos and, +for dirty repos, ran +=git stash --quiet=, =git pull --rebase --quiet=, and =git stash pop --quiet= +before opening Magit. That is high blast radius for a convenience command: stash +pop conflicts, untracked files, submodules, and worktrees can all create messy +states. + +Verify 2026-05-10: +- Dirty repos now open Magit for review without running stash, pull, or stash + pop. +- Clean repos still pull with =git pull --rebase --quiet= via =process-file=. +- Git calls now use argv lists through =cj/reconcile--git=. +- Reconcile results distinguish =pulled=, =needs-review=, =skipped=, + =pull-failed=, and =status-failed=. +- Repo discovery prunes heavy/generated directories and stops at repo roots by + default. +- HTTP/HTTPS remote skipping is explicit and configurable via + =cj/reconcile-skipped-remote-regexp=. +- Ran all reconcile ERT files and byte-compiled =reconcile-open-repos.el=. + +*** DONE [#A] Change dirty repo handling to review-first :bug: + +Expected outcome: +- Clean repos may still pull automatically if desired. +- Dirty repos should open Magit or a review buffer before any stash/pull/pop. +- If an auto-reconcile mode is kept, require an explicit prefix argument or + separate command name. +- Update the current dirty-repo tests so they assert the new review-first + behavior instead of encoding =git stash= / =git pull= / =git stash pop= as the + desired path. + +*** DONE [#A] Replace shell git calls with process helpers and parse statuses :refactor: + +Expected outcome: +- Use =process-file= / =call-process= with argv lists. +- Capture stdout/stderr per repo for a final report. +- Distinguish clean, dirty, skipped, pull-failed, and needs-review states. +- Add tests with stubbed git command results. + +*** DONE [#A] Prune expensive directories while discovering repos :refactor: + +=cj/find-git-repos= recursively walks the configured project/code roots and +checks every directory for a nested =.git=. That can wander through +=node_modules=, =.venv=, =target=, vendored source, build output, and nested +dependency checkouts. + +Expected outcome: +- Add a configurable prune list for heavy/generated directories. +- Stop descending once a repo root has been found unless explicitly requested. +- Add tests for nested repos and ignored heavy directories. + +*** DONE [#A] Make remote skip policy explicit and configurable + +=cj/reconcile--reference-clone-p= treats HTTP/HTTPS remotes as reference clones +and skips them. That may be right for this machine, but the behavior is encoded +as a naming mismatch and can skip ordinary repos. + +Expected outcome: +- Rename the predicate to reflect the actual policy, or make the policy + configurable. +- Report skipped repos with the reason in the final reconcile output. +- Keep tests for SSH remotes, HTTP remotes, and local/file remotes. +** DONE [#B] ai-vterm: occasional wrong-edge replay after buffer-move dance :bug: +CLOSED: [2026-05-10 Sun] + +Shipped 2026-05-09 in commit =26e9763= "fix(ai-vterm): harden F9 toggle across multi-window and buffer-move". The fix maps cardinal directions to frame-edge variants on replay (=right= → =rightmost=, =below= → =bottom=), switches captured units from frame-fractions to absolute body-cols / body-lines, wraps replay sizes in =(body-columns . N)= / =(body-lines . N)= cons forms so dividers don't shift the body, and uses =delete-window= (with =one-window-p= guard) instead of =quit-window= so buffer-moved windows don't leak. 7 regression tests added covering each scenario; 80 ai-vterm tests pass. + +Surfaced 2026-05-09. After an extended sequence with both vterm and +ai-vterm visible, switching orientations, buffer-moving claude +between positions, and toggling each independently, claude +eventually replayed at the right side when its captured direction +should have been =below= (it had just been buffer-moved to the +bottom and toggled there). + +The full sequence that hit it: + +1. F9 to open claude (right side). +2. F12 to open vterm. M-S-t to flip vterm to right-side -- gives + dashboard | vterm | claude. Toggle each off/on; both behave. +3. F12 vterm off. M-S-t flips claude to left half. Toggle both + off/on; both behave. +4. Toggle both off. F12 vterm on. M-S-t flips vterm to bottom. + Toggle both on/off; both behave. +5. Buffer-move claude to the bottom. +6. Toggle claude there -- claude pops up at the right instead of + at the bottom. +** DONE [#B] Scope F12 (vterm-toggle) to non-claude vterm buffers, preserve user orientation :refactor:bug: +CLOSED: [2026-05-10 Sun] + +Shipped 2026-05-09 in commit =554b32d= "feat(vterm): F12 toggle that excludes claude and preserves geometry". F12 now binds =cj/vterm-toggle= (replaces the =vterm-toggle= package binding). =cj/--vterm-toggle-buffer-p= excludes =claude [= prefixed buffers from the candidate set; =cj/--vterm-toggle-capture-state= records direction + body size at toggle-off; =cj/--vterm-toggle-display-saved= replays via =(body-columns . N)= / =(body-lines . N)= cons forms with cardinal direction mapped to frame-edge variant. Toggle-off uses =delete-window= (with =one-window-p= guard) so buffer-move scenarios don't leak ghost windows. The hard-coded =(window-height . 0.7)= override is gone — user-resized geometry persists. 19 new tests across buffer-filter, dispatch, and display. + +F12 previously ran =vterm-toggle=, which picked the most-recent vterm buffer +as the toggle target. When that target was a =claude [<repo>]= buffer (which +has its own F9/C-F9/M-F9 dispatch via =modules/ai-vterm.el=), F12 ended up +toggling Claude. The display-buffer rule in =modules/eshell-vterm-config.el= +already excluded =claude [= names from the bottom-window placement, but the +exclusion only governed /where/ a buffer landed once vterm-toggle had chosen +it -- not which buffer got chosen. + +Two changes shipped: + +1. *Filter claude buffers from vterm-toggle's target set* via + =cj/--vterm-toggle-buffer-p=, which ignores buffers whose names start with + "claude [". +2. *Respect user-modified window orientation.* Captured direction + body size + at toggle-off; replayed via =(body-columns . N)= / =(body-lines . N)= cons + forms. The hard-coded =(window-height . 0.7)= override is gone. +** DONE [#C] Move vterm-copy-mode binding off C-c C-t to the personal keymap :chore:quick: +CLOSED: [2026-05-10 Sun 02:02] + +Default vterm binding is =C-c C-t=, which collides with the =C-c= space many modes +reach for and is awkward to hit when the terminal is the active buffer. Move it +to the personal keymap (=C-;= prefix) — pick a mnemonic letter (e.g. =C-; V c= +for "vterm copy") and unbind the default in =vterm-mode-map=. Update +=modules/eshell-vterm-config.el= alongside any related vterm bindings. + +Implemented with a broader =C-; V= vterm menu, clickable URLs in vterm buffers, +=C-; V c= for raw =vterm-copy-mode=, and =C-; V C= for tmux-pane history +capture into a temporary Emacs buffer. +** DONE [#A] AI-Term-Related Improvements +*** DONE Check for widen/shorten buffer keys. +The keybinding you "thought you had" is =windsize= on =C-s-<arrow>= (Ctrl+Super) — a tiling WM eats Ctrl+Super, which is why it didn't seem to exist. Shipped 2026-05-11 in commit =f837e5f= "feat(window): resize the split with C-; b <arrow>": =C-; b <left>/<right>/<up>/<down>= moves the active window's divider that way (via =windsize=), then keeps =cj/window-resize-map= active so bare arrows keep nudging until any other key (or =C-g= / =<escape>=); =C-u N C-; b <right>= resizes by N. The old =C-s-<arrow>= bindings were dropped; =windsize= is now =:commands=-deferred with =windsize-cols=/=windsize-rows= at 2. =cj/window-resize-sticky= (in ui-navigation.el) dispatches on the arrow that triggered it and arms the loop. New ERT tests; all green. +*** DONE Evaluate this buffer should be in personal keybindings also. +=eval-buffer= is now on =C-; b e= (it already had =C-c b=). =e= had been =cj/view-email-in-buffer= and the requested fallback =C-; b m= is =cj/move-buffer-and-file=, so email-view moved to =C-; b E= (docstring + which-key updated too). All in =modules/custom-buffer-file.el=. +*** DONE Last ai-project used should be topmost in completing-read. +Shipped 2026-05-11 in commit =c14d6c8= "feat(ai-vterm): order the project picker by most-recently-used". The picker's active group (projects with a live tmux session) now leads with projects opened this session, most-recent first (=cj/--ai-vterm-mru=, pushed by =cj/--ai-vterm-show-or-create=), then the rest of the active group alpha, then the no-session group alpha. Bundled fix: =cj/--ai-vterm-tmux-session-name= now sanitizes =.= / =:= → =_= the way tmux does, so =.emacs.d= (real session =aiv-_emacs_d=) is correctly matched to its session and shows up in the active group (and crash-recovery reattaches instead of spawning a duplicate). New tests + updated tests; all green. + +*** DONE Kill other window that leaves the split where it is. +Didn't exist (the closest, =cj/kill-other-window= on =M-S-o=, *deletes* the other window). Shipped 2026-05-11 in commit =0ddbcde= "feat(window): kill the other window's buffer with C-; b K": =cj/kill-other-window-buffer= (in undead-buffers.el, on =C-; b K=) kills or buries the buffer shown in the other window and leaves that window and the split alone — the window then shows whatever bury/kill surfaces next. Reuses =cj/kill-buffer-or-bury-alive= so =cj/undead-buffer-list= buffers (=*scratch*= etc.) are buried; with 3+ windows it acts on =next-window=; errors with "No other window" if there's only one. =M-S-o= / =cj/kill-other-window= kept as-is (different op). 4 new ERT tests; all green. +*** DONE Kill this buffer/window that leaves the split. +Yes — the command is =cj/kill-buffer-and-window= (in =modules/undead-buffers.el=), bound to =C-; b k= (keymap entry in =modules/custom-buffer-file.el=, under the "buffer and file menu"). It does =(delete-window)= on the current window unless it's the only one, then kills (or buries, for "undead" buffers like =*scratch*=) the buffer — so in a 3-column split, =C-; b k= in column 2 leaves columns 1 and 3 as a normal 2-column split. No code change needed. + +Footnote on the =M-S-c= memory: =M-S-c= was Emacs's default =capitalize-word= and is now =time-zones= (=modules/chrono-tools.el=) — it was never this command. The =M-S-= window-killing family is =M-S-o= → =cj/kill-other-window= and =M-S-m= → =cj/kill-all-other-buffers-and-windows=. +*** DONE M-w shouldn't close the buffer or copy-mode +Shipped 2026-05-11 in commit =949bdeb= "feat(vterm): unify the keys in vterm copy-mode and tmux history". Both scrollback surfaces (=vterm-copy-mode= and the tmux-history buffer) now share one key story: =M-w= copies the active region and stays put (copy several things in a row); =C-g=, =<escape>=, or =q= leaves without copying; =RET= is unbound (no "copy and exit" — vterm's default =RET → vterm-copy-mode-done= binding removed). Dropped the now-dead =cj/vterm-tmux-history-copy-and-quit= (=M-w= then =q= is the equivalent). Also moved =cj/vterm-tmux-history= from =C-; x C= to =C-; x h= (unshifted, frees =C=) and refreshed the file's stale commentary header. Tests updated. +*** DONE cursor still orange after hitting return. +Shipped 2026-05-11 in commit =a70bb98= "fix(ui-config): use the writeable cursor color in a live vterm". Root cause: =vterm-mode= sets =buffer-read-only=, so the post-command cursor-color hook painted the cursor the read-only color (orange) any time point was in a vterm — copy-mode and the live terminal alike. Fix: a live vterm (=vterm-mode= and not =vterm-copy-mode=) now reports =unmodified= (white); =vterm-copy-mode= still reports =read-only= (orange), which Craig confirmed he wants. Extracted =cj/--buffer-cursor-state= for testability; 7 new ERT tests. + +*** DONE open in other window question/issue +Shipped 2026-05-11 in commit =071fb5e= "feat(ai-vterm): keep emacsclient files out of the agent window". =server-start= left =server-window= nil, so =emacsclient -n= opened files in the selected window — which is the agent window when you're typing in it. Fix in ai-vterm.el: =server-window= now points at =cj/--ai-vterm-server-display=, which routes the file to a non-agent window (splitting one off the agent when it's the only window); emacsclient from anywhere else still goes through =pop-to-buffer=. Helper =cj/--ai-vterm-non-agent-window= picks the target (skips the minibuffer, dedicated windows, agent windows). 7 new ERT tests. Confirmed working — direction-agnostic, picks the "other" window whichever side the agent is on. +** DONE [#A] Optimize org-capture target building performance :perf: +CLOSED: [2026-05-11 Mon 13:05] + +15-20 seconds every time capturing a task (12+ times/day). +Major daily bottleneck - minutes lost waiting, plus context switching cost. + +Implemented 2026-05-11: cache validated =file+headline= target markers in +=org-capture-config.el= so repeated task captures into =Inbox= skip Org's +full-file headline scan. Added regression coverage in +=tests/test-org-capture-config-target-cache.el=. +** DONE [#A] Fix Slack reaction workflow (C-; S !) :bug: +CLOSED: [2026-05-11 Mon 14:08] + +Reactions via ~C-; S !~ (~slack-message-add-reaction~) have two problems: + +1. *Emoji picker only shows GitHub-style names* — without the ~emojify~ package, + ~slack-select-emoji~ falls back to a flat ~completing-read~ over 1600+ names + fetched from GitHub's iamcal/emoji-data. Common names like ~thumbsup~ and ~pray~ + are buried. A curated shortlist of common reactions would fix the UX. + +2. *CRITICAL: post-command-hook bug traps user in Slack buffer* — + ~slack-reaction-echo-description~ is added to ~post-command-hook~ (buffer-local) + in all Slack buffers. When the cursor lands on a reaction widget, it reads the + ~reaction~ text property and calls ~slack-reaction-help-text~. If the reaction + EIEIO object is malformed, the error fires on *every keystroke*, making it + impossible to switch buffers, run M-x, or even C-g. The only escape is killing + Emacs externally (~pkill emacs~). + + The fix must address this hook FIRST before any other reaction work. + Approach: advise ~slack-reaction-echo-description~ with ~condition-case~ to + silently catch errors, or remove it from ~post-command-hook~ entirely. + + Relevant code in emacs-slack: + - ~slack-buffer.el:399~ — adds hook + - ~slack-buffer.el:374~ — ~slack-reaction-echo-description~ definition + - ~slack-reaction.el:72~ — ~slack-reaction-help-text~ method + +Implemented 2026-05-11: +- Added a safe advice around ~slack-reaction-echo-description~. If malformed + reaction data errors from the buffer-local ~post-command-hook~, the hook is + removed for that buffer and a single message is shown instead of trapping + every keystroke. +- Rebound ~C-; S !~ to ~cj/slack-message-add-reaction~, which presents a short + common reaction list first and keeps an ~Other...~ fallback to upstream + ~slack-message-reaction-input~. +- Added regression coverage in =tests/test-slack-config-reactions.el=. + +*Discovered:* 2026-03-06 +** DONE [#B] Coverage audit: untested and lightly-tested modules :tests: +CLOSED: [2026-05-11 Mon 14:38] + +Snapshot of test-coverage gaps as of 2026-04-26. The existing [#A] "Continue coverage push" task already targets =keybindings.el=, =config-utilities.el=, =org-noter-config.el=, and =host-environment.el=; this entry catalogs the rest so future sessions have a working list. + +*Methodology.* 102 modules in =modules/=, cross-referenced against =tests/= using fuzzy name matching (full module name, drop =-config=/=-setup= suffix, first hyphen segment). Categorized by likely test value. + +*High-value untested (substantial logic, real test value):* +- =ai-conversations= — gptel persistence + autosave; 13 functions +- =quick-video-capture= — yt-dlp queue, org-protocol; 5 functions +- =dashboard-config= — custom commands (=cj/dashboard-only=, etc.) +- =external-open= — partially refactored; helpers covered, commands still bare +- =keyboard-compat= — terminal vs GUI Meta+Shift translation +- =help-config= and =help-utils= — interactive help and lookup commands +- =mail-config= — helpers (some covered via transcription tests; rest bare) +- =show-kill-ring= — kill-ring UI logic +- =system-commands= — shell command wrappers +- =ui-navigation= and =ui-theme= — navigation + theme switching +- =wrap-up= — init-finalize helpers + +*Lightly covered (1–2 tests, likely many uncovered functions):* +- =modeline-config= (2 tests) +- =org-agenda-config= (2) +- =org-capture-config= (2) +- =org-reveal-config= (2) +- =transcription-config= (1) — helpers tested, start/stop loop bare +- =jumper= (1) +- =keyboard-macros= (1) + +*Likely low-value (mostly use-package wrappers):* +About 28 modules are dominated by use-package + hooks + keybinds — testing them would mostly test Emacs/use-package itself. Examples: =auth-config=, =diff-config=, =dirvish-config=, =elfeed-config=, =erc-config=, =eww-config=, the =prog-*= language modules, etc. For each, review whether the file has any helper functions beyond use-package. If yes, write characterization tests. If not, document as "no unit tests appropriate" so the next audit skips it. + +*Approach.* Pick 2–3 modules per session from the high-value list. Refactor-first if needed (split interactive wrapper from pure helper per =.claude/rules/elisp-testing.md=), then write Normal/Boundary/Error coverage. Re-run =cj/coverage-report= (F7, project scope) after each batch so progress is measurable. + +*Cross-references:* +- 2026-04-22 session (not archived) — coverage v1 shipped, 59.6% baseline +- [[file:.claude/rules/elisp-testing.md][.claude/rules/elisp-testing.md]] — per-function test files, refactor-first, three required categories + +*2026-05-11 refresh.* Re-ran =make coverage= after excluding timing-sensitive +=tests/test-lorem-optimum-benchmark.el= from coverage instrumentation. The +benchmark file still runs in normal test-file/unit flows, but Undercover slows +timing assertions enough to make it unsuitable for coverage. Low-coverage means +instrumented modules below 50% executable-line coverage, plus modules missing +from SimpleCov entirely. For missing modules, first decide whether the file has +testable project logic; if it is just use-package/keybinding glue, document it +as intentionally low-value instead of forcing brittle tests. + +*** 2026-05-24 Sun @ 15:40 Refreshed against a clean make-coverage run + +The per-module percentages previously listed here were stale. This session's test-writing covered most of the originally-listed modules: =prog-python= 0%→100%, =hugo-config= 17.7%→91.7%, =undead-buffers= 5.7%→85.7%, and =selection-framework=, =keyboard-compat=, =system-utils=, =system-defaults=, =ui-navigation=, =prog-go= now sit at ~100%. Re-measured against a clean =make coverage=; only modules genuinely below ~60% remain below as gaps, with current numbers. Modules in the 60-80% band (e.g. =calendar-sync= 76%, =music-config= 77%, =ai-conversations= 74%, =calibredb-epub-config= 73%, =org-noter-config= 73%, =custom-misc= 72%, =test-runner= 72%) are adequately covered and dropped from the backlog. Several remaining low entries are low only because the uncovered lines are use-package / interactive / process glue, not untested logic — flagged inline. + +*** 2026-05-24 Sun @ 15:45 Assessed the sub-60% cluster; filled the real gaps, closed the rest + +Read each sub-60% module to separate genuine untested logic from interactive/config glue. + +Filled (new tests): +- =markdown-config.el= — =cj/markdown-html= (buffer → strapdown HTML) now tested (normal + empty buffer). Preview/server commands stay interactive-only. Commit =c6a81743=. +- =media-utils.el= — =cj/select-media-player= now tested (choice sets default; non-match leaves it). Commit =c6a81743=. +- =elfeed-config.el= — =cj/extract-stream-url= + =cj/elfeed-process-entries= covered earlier this session (32%→66%). Commit =35fa6297=. + +Assessed already-covered (pure logic tested; remaining % is interactive only — no action): +- =flyspell-and-abbrev.el= — =cj/find-previous-flyspell-overlay= and =cj/--require-spell-checker= already have Normal/Boundary/Error tests; the rest is interactive (toggle, goto-previous, then-abbrev). +- =dashboard-config.el= — navigator builders + launcher binding already tested; the rest is =cj/dashboard-only= (interactive redisplay). +- =ai-quick-ask.el= — =--initial-text=, =--extract-response=, =--seed-text= already tested; the rest is the interactive ask/dismiss/continue flow. +- =prog-general.el= (10%) and =restclient-config.el= (50%) — LSP/use-package config and interactive new-buffer/open-file; no pure logic to cover. +- =vc-config.el= (7.9%) and =quick-video-capture.el= (50%) — pure logic already tested (git-clone path derivation; video URL dynamic-binding + capture-template registration); uncovered lines are magit/difftastic/git-timemachine config and interactive toggles. + +Net: the coverage backlog is cleared — every module's testable logic is covered; the residual low percentages are interactive/config/process code that the testing rules say not to chase. +** DONE [#B] Review all config and pull library functions into system-lib file :refactor: +Superseded by =PROJECT [#B] Consolidate shared utility helpers= (the structured version of this, with =docs/specs/utility-consolidation-spec-doing.org= as the spec and =docs/design/utility-inventory.org= as the config-wide audit -- 30 candidate helpers across all modules, decided 11 Migrate / 3 Leave / 13 Defer). The system-lib extractions shipped 2026-05-10: =c75e36f= (=cj/executable-find-or-warn= from mail-config), =f1e8f08= (=cj/shell-quote-argument-readable= from dev-fkeys), =57e558c= (=cj/process-output-or-error= + =cj/git-output-or-error= from coverage-core), =aa72245= (=cj/file-from-context= from system-utils), plus the earlier =8e8152e= (=cj/log-silently=) -- each with its own test file. The rest of the 11 Migrate items landed as new =-lib.el= modules in the same marathon (=cj-cache-lib.el=, =cj-org-text-lib.el=, =external-open-lib.el=, =cj-window-geometry-lib.el=, =cj-window-toggle-lib.el=). The 13 deferred candidates remain tracked under the Consolidate-shared-utility-helpers PROJECT, not here. +** DONE [#C] Clean up calibredb-epub-config.el :refactor:bug: +CLOSED: [2026-05-11 Mon 14:55] + +1. *Remove ~:defer 1~ from calibredb use-package* — loads calibredb 1 second after + startup even though ~:commands~ and ~:bind~ already handle lazy loading. Free + startup time. + +2. *Double rendering on EPUB open* — ~cj/nov-apply-preferences~ calls + ~(nov-render-document)~ explicitly, but it runs as a ~nov-mode~ hook which fires + after nov already renders. Every EPUB open renders twice. + +3. *visual-fill-column-width doesn't adapt on resize* — calculated once at open + time based on window size. Resizing or splitting the window won't recalculate + text width. Consider hooking ~window-size-change-functions~ or + ~window-configuration-change-hook~. + +4. *~calibredb-search-page-max-rows 20000~* — effectively disables pagination. + Could slow down the search buffer if library grows large. Monitor or lower. + +5. *Anonymous lambda for zathura keybinding* — ~("z" . (lambda ...))~ won't show + a name in which-key or describe-key. Replace with a named function. + +*File:* modules/calibredb-epub-config.el + +Implemented 2026-05-11: removed the timed calibredb load, removed the explicit +=nov-render-document= call from the =nov-mode= hook to avoid double rendering, +made Nov text width recalculate after window configuration changes, lowered +=calibredb-search-page-max-rows= from 20000 to 500, and replaced the anonymous +zathura binding with =cj/nov-open-external=. Added focused helper coverage in +=tests/test-calibredb-epub-config.el= for the adaptive width calculation and +named external-open command. +** DONE [#C] Update email setup script for the work account :chore: +CLOSED: [2026-05-11 Mon 14:21] + +Follow-up to the deepsat mu4e work shipped 2026-04-27. The mu4e config (=modules/mail-config.el=), =.mbsyncrc=, =.msmtprc=, and the encrypted password file (=.config/.dmailpass.gpg=) all gained a third account. There is an "email setup script" (per Craig's mention while wrapping up that work) that needs the equivalent updates so a fresh machine bootstraps with all three accounts. Craig will name the specific script when picking this up. + +Likely shape: +- Wherever the script writes / templates =.mbsyncrc=, add the dmail block (5-channel layout, mirroring the gmail block). +- Wherever it writes =.msmtprc=, add the dmail SMTP account (passwordeval against =~/.config/.dmailpass.gpg=). +- Ensure the encrypted password file exists or is sourced correctly during setup. + +Implemented 2026-05-11: updated =scripts/setup-email.sh= so the setup flow +handles the deepsat/dmail account alongside gmail and cmail. The script now +creates =~/.mail/dmail=, passes =craig.jennings@deepsat.com= to =mu init=, +and installs/validates =~/.config/.dmailpass.gpg= using the same encrypted-file +pattern as gmail. While there, the credential bootstrap was made explicit: +gmail and dmail keep encrypted =.gpg= files because mbsync/msmtp decrypt them at +use time, while cmail is decrypted to the plaintext ProtonBridge password file. +** DONE [#C] Stand up packaging CI for personal Elisp packages :ci:feature: +CLOSED: [2026-05-11 Mon 14:08] + +Get =chime=, =org-msg=, and =wttrin= covered by automated package-quality checks. Three pieces, all aimed at the same set of repos, so tracked together: + +1. *melpazoid* — MELPA-submission validator. Run against each package; gives a pre-submission checklist so packages don't bounce on basics. +2. *package-lint* — elisp-specific package linter. Catches header issues, autoload problems, version-spec drift. Can be run locally as part of =make lint= and in CI. +3. *elisp-check GitHub Action* — zero-config CI workflow that wraps the above plus byte-compile and basic tests. One =.github/workflows/elisp.yml= per package. + +Order of execution: package-lint first (most actionable, fastest feedback), then elisp-check (CI wiring), then melpazoid (heavier; only matters if/when submitting to MELPA). +** DONE [#D] Optimize lorem-optimum performance and liber-primus.txt size :perf: +CLOSED: [2026-05-11 Mon 14:17] + +Lorem-optimum text generation is generally slow but doesn't completely break workflow. +Two benchmark tests were disabled (marked :slow) because they take MINUTES instead of seconds. + +**Current State:** +- Tests disabled to unblock test suite (DONE 2025-11-09) +- Performance is acceptable for daily use, but could be better +- liber-primus.txt may be too large for optimal performance + +**Investigation:** +1. Profile lorem-optimum to find bottlenecks +2. Check if liber-primus.txt size needs optimization +3. Optimize performance to get tests under 5 seconds +4. Re-enable benchmark tests once performance is acceptable + +**Related Files:** +- modules/lorem-optimum.el (needs profiling and optimization) +- tests/test-lorem-optimum-benchmark.el (tests disabled with :tags '(:slow)) +- liber-primus.txt (corpus file, may need size optimization) + +Implemented 2026-05-11: optimized generation hotspots in =modules/lorem-optimum.el= +by avoiding repeated string/list appends, caching random Markov keys as a vector, +and hardening title generation while preserving empty-chain behavior. Re-enabled +the benchmark tests in =tests/test-lorem-optimum-benchmark.el= by removing their +=:slow= tags and added a title-generation regression test in +=tests/test-lorem-optimum.el=. Checked =assets/liber-primus.txt= directly; it is +36,475 bytes / 5,374 words, so no corpus shrink was needed. The benchmark file +now runs all 10 tests in under one second, with 100K-word learning measured under +200 ms on this machine. +** DONE [#D] Migrate lsp-eldoc-hook to eldoc-documentation-functions :chore:quick: +CLOSED: [2026-05-11 Mon 14:12] + +=modules/prog-lsp.el:68= sets =lsp-eldoc-hook= to nil. Byte-compile flags it as obsolete since lsp-mode 9.0.0; replacement is =eldoc-documentation-functions=. Find the lsp-mode-supplied entry there and remove it (or set the variable buffer-locally per the new API). Discovered 2026-04-26 during refactor audit on the file-watch-ignored-extras change. + +Implemented 2026-05-11: replaced the obsolete =lsp-eldoc-hook= assignment with +=cj/lsp--disable-eldoc-hover=, installed from =lsp-managed-mode-hook=. The helper +removes =lsp-eldoc-function= from buffer-local +=eldoc-documentation-functions= after lsp-mode adds it. Covered in +=tests/test-prog-lsp--add-file-watch-ignored-extras.el=. +** DONE [#B] Simplify mail attachment save workflow :feature: + +Saving attachments out of mu4e is currently a multi-step dance via =mu4e-view-save-attachments= + embark + vertico. The flow documented in =modules/mail-config.el:10-17= goes: + +#+begin_quote +After running =mu4e-view-save-attachments=: +- invoke =embark-act-all= in the completion menu, then RET to save all +- OR TAB (=vertico-insert=), comma each file to mark, RET to save selected +#+end_quote + +That's four keystrokes for "save all to default dir" and N+2 for "save the one I want." Both common cases should be one keystroke. + +Proposed shape: +- =cj/mu4e-save-all-attachments= → save every attachment in current message to a sensible default dir (=~/Downloads/= or per-thread). One keystroke. +- =cj/mu4e-save-attachment-here= → completing-read on attachment names; save selected one. One keystroke + selection. +- Bind both under =C-; e= (the existing email map already has =a= and =d= for attach/delete in compose). + +Open question: should the "save all" target be a fixed dir, prompt every time, or use the directory of an associated org-noter / project context? Flagged for design decision when this lands. + +Decision: save all should prompt every time. + +*Files:* =modules/mail-config.el= (add helpers, wire into mu4e-view-actions and the =C-; e= keymap). + +Implemented 2026-05-11: added direct mu4e view attachment save commands in +=modules/mail-config.el=. =cj/mu4e-save-all-attachments= prompts once for a +directory and saves every attachment-like MIME part. =cj/mu4e-save-attachment-here= +prompts for a directory, then uses =completing-read= to save one attachment. +Both reuse mu4e's MIME part metadata, uniquify hook, path joiner, and +=mm-save-part-to-file= save primitive instead of driving the existing +multi-select completion UI. Duplicate filenames are disambiguated by part index. +Bound under =C-; e S= and =C-; e s= with which-key labels. Covered by +=tests/test-mail-config-attachments.el=. + +Extended 2026-05-11: added =cj/mu4e-save-some-attachments= on =C-; e m=. It +prompts for the destination directory, opens a dedicated =*mu4e attachments*= +selection buffer, and lets the user mark rows with RET, mark all with =a=, +unmark all with =u=, save marked with =s=, and quit with =q=. The selection +buffer shows labels, MIME types, and approximate sizes while reusing the same +attachment save helpers. + +Committed and pushed 2026-05-11 as =1aa8d0f= "feat(mu4e): simpler attachment-save commands on C-; e S/s/m"; 18 ERT tests in =tests/test-mail-config-attachments.el=. (Two small UX follow-ups — `entry-at-point' user-error outside a row, and clearing marks / auto-quit after save — are tracked under "Post-batch review follow-ups (2026-05-11)".) +** DONE [#B] EPUB text renders full-width: visual-fill-column margins not applied in nov-mode :bug: +*** Resolved 2026-05-12 +Fixed in =b7c6b2c= "fix(nov): center the EPUB text by setting window margins directly" -- took the "preferred" plan below: `nov-text-width' is now a column count (~80% of the window's natural width) so nov's `shr' fills the text itself, and `cj/nov-update-layout' centers the block with `set-window-margins' directly (plus `set-window-fringes ... t' to push the fringes off the reading area). `visual-fill-column' is dropped from nov entirely -- its margin-setting still mysteriously never applied, but that's moot now. `+'/`=' / `-'/`_' re-flow and re-center; a buffer-local `kill-buffer-hook' resets the margins/fringes. The text-width math factored into `cj/nov--natural-window-width' + `cj/nov--text-width'. Remaining nit: see "EPUB text is slightly left-of-center" below. +*** Problem +Opening an EPUB renders the text filling 100% of the window width, not the configured ~80%. =modules/calibredb-epub-config.el=, =cj/nov-apply-preferences= (on =nov-mode-hook=). + +Before the 2026-05-12 work it was the opposite — a too-narrow ~third-of-the-window strip — caused by a feedback loop (=cj/nov--text-width-for-window= computed from =window-body-width=, which is post-margin, so each =cj/nov-update-layout= pass shaved the column by another margin fraction, bottoming out at =cj/nov-min-text-width= = 40). Commit =1c5c8bd= "fix(nov): rework the EPUB reading-width layout" fixed the loop (width now computed from the window's *natural* column count, idempotent) and split out a pure =cj/nov--text-width= helper with a regression test; =4d9a206= set the default =cj/nov-margin-percent= to 10 (= 80% text); both also re-added =b3b537f='s =(nov-render-document)= for the cold open, made =cj/nov-update-layout= a command, and bound =+= / === / =-= / =_= in =nov-mode-map= to adjust the width live (clamp 0..25, i.e. text 50%..100%). The *width computation* and the *loop* are fixed. The *margin application* is not — hence 100%. + +*** Why 100% specifically +=cj/nov-apply-preferences= sets =(setq-local nov-text-width t)=. With =nov-text-width= = t, =nov-render-html= renders the text *unfilled* — it swaps =shr-fill-line= for =nov-fill-line=, which only indents, never wraps — so the buffer holds one long logical line per paragraph, and =visual-line-mode= is relied on to wrap it visually at the window's *text-area* width. =cj/nov-update-layout= is supposed to narrow that text area by turning on =visual-fill-column-mode= with =visual-fill-column-width= set to ~80% of the window's columns and letting =visual-fill-column--adjust-window= set the left/right *window display margins*. The margins never get set, so the text area stays the full window width → text wraps at 100%. + +*** Diagnostics captured (Craig's running Emacs, in the EPUB buffer, 2026-05-12) +=M-: (list :margin cj/nov-margin-percent :body-w (window-body-width) :vfc-w visual-fill-column-width :vfc-mode (bound-and-true-p visual-fill-column-mode) :vfc-feat (featurep 'visual-fill-column) :wmargins (window-margins) :ntw nov-text-width)= → + =(:margin 10 :body-w 152 :vfc-w 121 :vfc-mode t :vfc-feat t :wmargins (nil . nil) :ntw t)= +So: the new code IS loaded (=cj/nov-margin-percent= 10), =visual-fill-column= IS loaded, =visual-fill-column-mode= IS on, =visual-fill-column-width= IS correct (121 = 80% of 152) — but =(window-margins)= is =(nil . nil)=. =M-x cj/nov-update-layout= (which calls =visual-fill-column--adjust-window=) does NOT change it; =M-: (condition-case e (progn (cj/nov-update-layout) (window-margins)) (error e))= → =(nil . nil)= (no error caught, margins still nil). So =visual-fill-column='s margin-setting path (=visual-fill-column--adjust-window= → =visual-fill-column--set-margins= → =set-window-margins=) is not landing in nov-mode buffers. + +*** Why it doesn't apply — UNKNOWN +Code-reading =visual-fill-column-2.7.0= didn't pin it down. =visual-fill-column--adjust-window= does =(with-selected-window window (visual-fill-column--reset-window window) (when visual-fill-column-mode (... (visual-fill-column--set-margins window))))=. For the result to be =(nil . nil)=, either =--set-margins= isn't reached (the =(when visual-fill-column-mode ...)= check is false in whatever buffer =with-selected-window= makes current) or it computed left=right=0 (=set-window-margins window 0 0= → =(window-margins)= = =(nil . nil)=). =--set-margins= computes 0/0 only when =total-width= (≈ window-width) ≤ =visual-fill-column-width= (121) — and window-width is 152, so it shouldn't. Candidate causes not yet ruled out: (a) the =default= face is remapped to "Merriweather" :height 180 in nov buffers (via =face-remap-add-relative= in =cj/nov-apply-preferences=), and =set-window-margins='s units (canonical frame-font columns) vs. the remapped 18pt buffer columns may be confusing the column math; (b) =--adjust-window= being invoked on the wrong window (it defaults to =(selected-window)=, not the EPUB's window — relevant when nov-mode-hook runs before =find-file= switches the window, and possibly later); (c) a =visual-fill-column= 2.7.0 / Emacs 30 regression with =nov-fill-line=-style rendering; (d) something resetting the margins after they're set. + +*** Plan forward — preferred: stop delegating the width to visual-fill-column +Set =nov-text-width= to a *computed integer* instead of =t=, so nov's =shr= fills the rendered text to that width itself — no dependence on =visual-fill-column='s window margins working at all. =visual-fill-column= then only *centers* the already-narrow block (if it works; if it still doesn't, the text is left-aligned at ~80%, which is acceptable). Specifically: +- =cj/nov-apply-preferences=: =(setq-local nov-text-width (cj/nov--text-width-for-window))= (integer) instead of =t=. +- =cj/nov-update-layout=: recompute and =setq-local= both =nov-text-width= and =visual-fill-column-width=, then call =(nov-render-document)= so =shr= re-flows the text at the new width (currently it only re-sets the vfc width). Still keep the =visual-fill-column-mode= + =--adjust-window= calls for centering. +- =+= / =-= keep working: they adjust =cj/nov-margin-percent= then call =cj/nov-update-layout=, which now re-renders. +- =cj/nov-min-text-width= (40) stays the absolute column floor. +TDD test-first. Touches =modules/calibredb-epub-config.el= + =tests/test-calibredb-epub-config.el=. ~25 lines. + +*** Alternatives considered +(1) Keep =nov-text-width= = t + =visual-fill-column= and keep poking at *why* the margins don't apply — needs more in-Emacs diagnostics (e.g. trace =visual-fill-column--set-margins=, check =(window-margins)= right after =(set-window-margins win 15 16)=, check whether a stray window param clamps it). Higher uncertainty. +(2) Left-align at the computed width with no centering at all (drop =visual-fill-column= from nov entirely) — simpler, but loses the centered look Craig wanted. +Preferred is the =nov-text-width=-as-integer approach because it's robust regardless of what =visual-fill-column= does. +** DONE [#B] Post-batch review follow-ups (2026-05-11) :refactor:tests: +Minor items found while reviewing the 2026-05-11 commit batch (a70bb98..2b88c6a). The major fix (org-capture cache-key consistency) and the coverage gaps were already handled in commits =fc94e5b= / =e0e0ecd= / =2b88c6a=; these are the leftovers. + +*** DONE [#B] Give the benchmarks a real home (`make benchmark' or `:tags '(:perf)') :tests:perf: +The 2026-05-11 lorem-optimum perf work (=7f353e9=) dropped the `:slow' tags from the benchmark tests so they run in every `make test', and one (`benchmark-learn-100k-words') gained an absolute wall-clock threshold (`(should (< time 5000.0))'). Then =1f4c692= excluded `test-lorem-optimum-benchmark.el' from `make coverage' because undercover's instrumentation breaks those thresholds. That's a fragmented policy and the thresholds are machine-dependent (a slower CI runner or older laptop could blow 5s). Pick one: (a) restore `:tags '(:perf)' on the benchmark tests and add a `make benchmark' target that runs them, or (b) replace the absolute thresholds with relative checks ("100K is no more than ~20x slower than 10K") that catch O(N^2) regressions without depending on the machine. Either way `make test' should stop running absolute-time benchmarks by default. + +*** DONE [#B] Verify Nov EPUB renders at the right width on first open :bug: +There WAS a regression, deeper than =b3b537f=: `cj/nov--text-width-for-window' computed the column from `window-body-width' (post-margin), so `cj/nov-update-layout' (on `window-configuration-change-hook') shrank the column on every pass — a feedback loop bottoming out at `cj/nov-min-text-width' (40 cols) regardless of `cj/nov-margin-percent'. Fixed 2026-05-12 in =1c5c8bd= "fix(nov): rework the EPUB reading-width layout": width now from the window's natural column count (idempotent), pure `cj/nov--text-width' helper + regression test, `cj/nov-margin-percent' default 12 (~76% text), `b3b537f's `(nov-render-document)' re-added for the cold open, `cj/nov-update-layout' made a command, and `+'/`='/`-'/`_' added in `nov-mode-map' to adjust the width live (50%..100%). Visual confirm in real Emacs still pending Craig's restart. + +*** DONE [#B] Surface `cj/slack-message-add-reaction' errors outside a Slack buffer :ux: +`cj/slack-message-add-reaction' (C-; S !, added in =bbd1b73=) silently no-ops when `slack-current-buffer' is nil — e.g. if the binding fires outside a Slack buffer. The `when-let*' chain just bails with no feedback. Add a `user-error "Not in a Slack buffer"' (and the same for `slack-buffer-team' returning nil) so the misuse surfaces instead of being swallowed. + +*** DONE [#B] Rename `cj/lsp--disable-eldoc-hover' to `cj/lsp--remove-eldoc-provider' :refactor: +The function (added in =96d5d6a=) removes one specific provider — `lsp-eldoc-function' — from the buffer-local `eldoc-documentation-functions'. If lsp-mode ever adds another eldoc provider, the current function wouldn't catch it; the name promises more than it does. Rename to match what it actually does and update the `add-hook' callsite + the regression test. + +*** DONE [#B] Add `bats' test infra and cover `scripts/setup-email.sh' helpers :tests: +The 2026-05-11 email-setup work (=eddc103=) added `install_encrypted_password' and `decrypt_password' — cleanly factored (filenames in, file-or-`exit 1' out) but untested, since the repo has no shell-test infrastructure. With a temp `$PASSWORD_DEST_DIR' and mocked `gpg'/`cp', they'd test cleanly. Add `bats' (or pick an alternative), wire a `make test-shell' target, and cover the two helpers plus the dest-exists-skip and missing-source-fails paths. + +*** DONE [#B] Split the mu4e attachment workflow out of `mail-config.el' :refactor: +The 2026-05-11 mu4e attachment commit (=1aa8d0f=) added ~247 lines to `mail-config.el' for a self-contained attachment-save UI (helpers + three commands + a `special-mode'-derived selection buffer). None of it depends on the rest of `mail-config'. As that file grows, moving this into `modules/mu4e-attachments.el' (or `mail-attachments-lib.el', matching the `-lib.el' convention) would keep both files easier to read. The seam is clean. + +*** DONE [#B] Clear marks (or auto-quit) after `cj/mu4e-attachment-selection-save-marked' :ux: +After saving the marked attachments, the `*mu4e attachments*' buffer (=1aa8d0f=) stays open with the same marks intact — pressing `s' again re-saves the same set silently. Decide what the workflow wants: auto-`quit-window' after a successful save, or clear the marks and stay so the user can save another batch. Right now it does neither. +** DONE [#D] Create print function for dirvish bound to uppercase P :feature: + +Add a print function that works on printable files (PDF, txt, org, etc.) and bind it to uppercase P in dirvish-mode. Should detect file type and use appropriate print command (lpr for text files, print dialog for PDFs, etc.). +** DONE [#D] Collapse the duplicated per-file test loop in the Makefile :chore: +=test-unit=, =test-integration=, and =coverage= each carry a near-identical ~40-line shell loop (run each file in its own Emacs, count passes, collect failures, print a summary box). The three drifted once already (the =:perf= tag filter had to be added in three places). Extract a single =define=d shell function or a helper recipe parametrized by test list + extra =-l= args + label, and have the three targets call it. Cosmetic — the Makefile works — so low priority. Noticed 2026-05-12 while adding =make benchmark=. +** DONE [#A] Add Telegram Messaging +https://github.com/zevlg/telega.el +Make sure there is a setup script to run, so that the docker container can be installed post emacs dotfiles repository clone on a fresh install +also, let's add an icon to the dashboard for this. perhaps this is the beginning of the third row? If so, add a child task to review and balance the dashboard icons + +Shipped this session: +- =modules/telega-config.el= -- =use-package telega= with + =telega-use-docker t=; launcher on =C-; G= (=C-; t= and =C-; m t= + were both taken). +- Dashboard Row 3 added with the Telegram icon; dashboard-mode-map =g= + key launches =telega=. +- =scripts/setup-telega.sh= -- verifies docker presence + daemon + reachability; pulls =$TELEGA_DOCKER_IMAGE= when set, otherwise + announces =M-x telega-server-build= for the in-Emacs build path. + 7 bats tests in =tests/test-setup-telega.bats= (docker stubbed). +- Auth (phone + verification code) is interactive on first =M-x telega= + -- not scripted. + +*** DONE [#A] Add =scripts/setup-telega.sh= for TDLib docker container :feature: +Pull or build the telega TDLib container so a fresh-clone install can +run telega without a system-wide TDLib build. Mirror the +=scripts/setup-email.sh= pattern: =main()= wrapped in a +=BASH_SOURCE == 0= guard so the script is sourceable for bats tests; +bats test file =tests/test-setup-telega.bats= with =docker= stubbed. + +*** DONE [#A] Review and balance dashboard icon layout :refactor: +CLOSED: [2026-05-14 Thu] +Adding the Telegram icon started a third row that has only one entry. +Decide whether to (a) leave it asymmetric and let the row fill in as +new launchers arrive, (b) move an existing icon down to balance 5/5/2 +or similar, or (c) reorganize by category (work / read / chat / play). + +Picked (c) -- the categories actually exist and a 4/4/4 grid +balances cleanly: +- Row 1 Work: Code / Files / Terminal / Agenda +- Row 2 Read & Learn: Feeds / Books / Flashcards / Music +- Row 3 Communication: Email / IRC / Slack / Telegram + +Drive-by fix in the same commit: Music had an icon but no +`dashboard-mode-map' keybinding, so the visual launcher couldn't be +fired without the mouse. Added =m=. Reordered the existing +`define-key' calls to mirror the row layout so reading the keymap +top-to-bottom matches the icons left-to-right. +Surfaced when Telegram landed in Row 3 alone. +** DONE [#B] Add VERIFY and DOING blocks to the main agenda view :feature: + +The main agenda "d" command (=cj/main-agenda-display=, F8) currently +renders four blocks: OVERDUE -> HIGH PRIORITY UNRESOLVED -> SCHEDULE +-> PRIORITY B. Insert two new blocks around SCHEDULE so a glance at +the daily view also surfaces what's in flight and what's waiting on a +manual check: + +- Above SCHEDULE: all tasks with TODO state VERIFY (header: + =VERIFICATION=). +- Below SCHEDULE: all tasks with TODO state DOING (header: + =IN-PROGRESS=). + +Resulting block order: + + OVERDUE -> HIGH PRIORITY -> *VERIFICATION* -> SCHEDULE -> *IN-PROGRESS* -> PRIORITY B + +Decisions: +- *Scope*: same as the other blocks -- every entry in + =org-agenda-files=, no per-project filter. +- *Scheduled / deadlined entries*: included. A VERIFY task with a + scheduled date for today appears in both the VERIFICATION block and + the SCHEDULE block. Mirrors the HIGH PRIORITY block's behavior. +- *Habit / PROJECT skips*: skip habits via + =cj/org-skip-subtree-if-habit=. Don't skip PROJECT-keyword entries + (the =(todo "VERIFY")= and =(todo "DOING")= match is keyword-exact + so PROJECT parents wouldn't appear anyway, and a PROJECT in VERIFY + state would be deliberate). + +Implementation locations: +- =modules/org-agenda-config.el= -- two new entries inside + =org-agenda-custom-commands= "d" block, each a =(todo "STATE" ...)= + with =org-agenda-overriding-header=, the shared + =cj/--main-agenda-prefix-format=, and the habit skip-function. +- =modules/org-agenda-config.el= -- two header defvars + (=cj/main-agenda-verify-title= / =cj/main-agenda-doing-title=) for + symmetry with =cj/main-agenda-overdue-title= etc. + +Regression coverage: +- Extend =tests/test-org-agenda-config-skip-functions.el= with + structural assertions: the "d" command has six blocks in the + expected order, the new VERIFICATION / IN-PROGRESS blocks reference + the shared prefix-format symbol, carry the right + =org-agenda-overriding-header=, and run the habit skip. +** DONE [#A] Org Agenda fixes :bug: +*** 2026-05-13 Wed @ 13:05:21 -0500 Skip CANCELLED entries from main agenda SCHEDULE +see the following screenshot +/home/cjennings/pictures/screenshots/2026-05-13_071428.png + +Fix shipped on main: commit =8e57950=. Added an org-agenda-skip-function +to the SCHEDULE block of the "d" command in =org-agenda-custom-commands= +that filters entries with TODO state CANCELLED. Scope is deliberately +narrow -- DONE and FAILED scheduled tasks still render. + +Tests in =tests/test-org-agenda-config-skip-functions.el= (Normal + +Boundary) lock in the configuration form on the agenda block and +verify the other blocks aren't accidentally carrying the same skip. +*** DONE [#A] Refactor: extract org-agenda-prefix-format literal :refactor: +=modules/org-agenda-config.el= currently inlines =" %i %-15:c%?-15t% s"= +across four blocks of =org-agenda-custom-commands= (overdue, hi-pri, +schedule, priority-B). Extract into a defvar (e.g. +=cj/--main-agenda-prefix-format=) and reference it from each block. +Surfaced during the audit for the CANCELLED-schedule fix. + +Fix: new =cj/--main-agenda-prefix-format= defvar in +=modules/org-agenda-config.el=; all four blocks of the "d" command now +reference the symbol instead of inlining the literal. Regression test +in =tests/test-org-agenda-config-skip-functions.el= walks the blocks +and asserts each =org-agenda-prefix-format= entry resolves to the +shared symbol -- so a future tweak to one block can't silently diverge +from the others. +*** 2026-05-13 Wed @ 13:27:39 -0500 Clear dedicated before toggling window split +Reproduction steps +- open an org file (I was using this projects's todo.org file +- hit the f8 button to open the agenda view. it opens fine. +- toggle-window-split +>>> The agenda displays on both panes after the toggle. +see snapshot below +/home/cjennings/pictures/screenshots/2026-05-13_071603.png + +Fix shipped on main: commit =97f0f8e=. Root cause was the dedicated +=*Org Agenda*= window (set via =display-buffer-alist= rule) rejecting +the internal =set-window-buffer= swap. The non-dedicated buffer never +crossed and both panes ended up showing the agenda. + +=modules/ui-navigation.el= now clears dedicated on both windows at the +top of =toggle-window-split= before the swap. The toggle is an +explicit layout change, so preserving per-window dedicated through it +would just re-trigger the same wedge on the next invocation. + +Tests in =tests/test-ui-navigation--toggle-window-split.el= (5 tests, +Normal + Boundary) cover the no-dedicated baseline, the bug-trigger, +post-toggle cleared state, and the 1-window / 3-window no-op cases. +Verified red against the unfixed code (the bug-trigger test errored +=Window is dedicated to '*test-toggle-b*'=) before applying the fix. + +Live verification pending: =M-x load-file modules/ui-navigation.el=, +then walk through F8 + M-S-t in a fresh session. +*** DONE [#A] Enhancement: replace todo indicators with project name +In the overdue section, the high priority section, and the priority B section, each of the entries has a todo: indicator, which is the name of the file. +This is not useful. Based on how I'm using emacs, every entry is likely to come from a file named todo.org. +A much preferrable option would be to have the project's name there instead. +so, for instance this todo.org file would show "emacs.d" as the project name in place of todo. + +see snapshot below for an example of the current state. +/home/cjennings/pictures/screenshots/2026-05-13_071840.png + +Fix: =cj/--org-todo-category-from-file= + +=cj/--org-set-todo-category= in =modules/org-agenda-config.el= +hook =org-category= buffer-locally to the parent directory's +basename (with a single leading dot stripped, so =.emacs.d= reads +as =emacs.d=) whenever a todo.org file opens. Explicit +=#+CATEGORY:= still wins. 14 tests in +=tests/test-org-agenda-config-category.el= cover normal / +boundary / error paths; full =make test-unit= green. +** DONE [#A] Save journal buffer after marking a task DONE :bug: +CLOSED: [2026-05-14 Thu] + +When a task transitions to a done state, =cj/org-roam-copy-todo-to-today= +in =modules/org-roam-config.el= refiles a copy of the heading into the +day's roam journal (creating the file if missing) -- example: +=/home/cjennings/sync/org/roam/journal/2026-05-14.org=. The journal +buffer is left modified-but-unsaved, so closing Emacs always prompts +about open unsaved buffers with no obvious source. + +Function intends to save via two routes: +- =org-after-refile-insert-hook= let-bound to =#'save-buffer= -- a + single-function value rather than a list. =run-hooks= calls a bare + function value, so this should fire, but verify it does in the + capture+refile context (and that it runs in the target buffer, not + the source). +- The =:config= block of =use-package org-refile= advises =org-refile= + =:after= with =org-save-all-org-buffers=. That only runs once + =org-refile= is loaded; if the DONE transition fires before + org-refile's =:defer .5= elapses, the advice isn't attached yet. + +Fix candidates: +- Drop the let-binding and call =(save-buffer)= explicitly in the + target buffer after the =org-refile= call, before + =save-window-excursion= unwinds. Deterministic, doesn't depend on + hook timing. +- Or eager-load =org-refile= so the =:after= advice attaches before any + DONE transition can fire. + +Test: mark a TODO done from a non-journal buffer, then check +=buffer-modified-p= on the dated journal buffer. Should be nil. +** DONE [#B] Extend dired/dirvish =T= to transcribe videos, not just audio :feature: +CLOSED: [2026-05-14 Thu] + +Today =T= on an audio file in dired/dirvish triggers +=cj/transcribe-audio-at-point= and only accepts files matching +=cj/audio-file-extensions= (=cj/--audio-file-p= rejects anything +else with a =user-error=). Want the same one-key flow on video +files -- so a =.mp4= or =.mkv= recording can be transcribed without +hand-extracting the audio track first. + +Likely shape: +- New =cj/video-file-extensions= in user-constants.el (mp4, mkv, + mov, webm, avi, m4v, ...). +- =cj/--video-file-p= sibling of =cj/--audio-file-p=. +- =cj/--start-transcription-process= (or a wrapper) detects video, + shells out to ffmpeg to extract the audio track to a temp file + (=ffmpeg -i in.mp4 -vn -acodec copy out.m4a= or similar; pick a + codec the backend accepts), then transcribes the temp file and + cleans up. +- =cj/transcribe-audio-at-point= accepts both audio and video via + =(or (cj/--audio-file-p f) (cj/--video-file-p f))=; the + surrounding pipeline knows when to insert the ffmpeg step. + +Open design questions: +- Keep the function named =transcribe-audio-at-point= (treats video + as "audio-bearing") or rename to =transcribe-media-at-point= and + add an alias? Rename probably cleaner. +- ffmpeg availability check + =cj/executable-find-or-warn= pattern + on first use. +- Where the temp audio file lives -- alongside the video (visible), + or =temporary-file-directory= (clean). Probably the latter for + videos the user doesn't want to clutter. +- Do we keep the temp audio after transcription, or always delete? + The log file already retains diagnostic info; extracted audio is + derivable. Default to delete; offer a custom to keep. + +Test surface: =cj/--video-file-p= happy/edge cases, the ffmpeg +extract step (stub =call-process=), and the dispatch in +=cj/transcribe-audio-at-point= against a video path. +** DONE [#C] Surface org narrowing + sparse-tree under =C-; O= :refactor: +CLOSED: [2026-05-14 Thu] +Final layout flatter than the original proposal: no =n= or =s= +sub-prefixes. Lowercase letters create / narrow / sparse-tree; +the same letter capitalized cancels. `n' / `N' = narrow / widen. +`s' / `S' = match-sparse-tree / show-all. `t' / `T' = +show-todo-tree / show-all (both capitals point at the same +`org-show-all' so the mental model is "capital cancels the +lowercase I just ran"). `R' = `org-reveal' (no lowercase pair -- +`r' is the table-row sub-prefix); F2 (the old reveal binding) is +freed up. Sibling-stepping is on `>' / `<' at the top level. + +Four new ERT assertions in +=tests/test-org-config-keymap-ownership.el= lock the shape. + +The narrowing and sparse-tree commands already exist in +=modules/org-config.el=, but they're bound only inside the +=:bind (:map org-mode-map ...)= block and scattered across `C-c' +shortcuts -- nothing in `cj/org-map' (`C-; O') surfaces them, so +which-key never shows them and discoverability is poor. + +Existing bindings worth promoting (org-config.el ~line 141-150): +- =C-\\= =org-match-sparse-tree= +- =C-c N= =org-narrow-to-subtree= +- =C-c >= =cj/org-narrow-forward= +- =C-c <= =cj/org-narrow-backwards= +- =C-c <ESC>= =widen= +- =<f2>= =org-reveal= (the reveal-narrowed-context command, + not org-reveal-config.el) + +Proposal: + +Add a sub-menu under `C-; O': + +- `C-; O n' -- narrow operations (sub-prefix) + - `n s' narrow to subtree + - `n e' narrow to element + - `n >' narrow forward sibling + - `n <' narrow backward sibling + - `n w' widen + +- `C-; O s' -- sparse-tree operations (sub-prefix) + - `s s' org-match-sparse-tree (by tag/property/todo match) + - `s t' show all TODOs + - `s p' show entries with a priority + - `s r' org-reveal (open the surrounding context of point) + +Add the which-key labels alongside. Keep the existing `C-c' +bindings as-is for muscle memory. + +Open question: should `cj/org-narrow-forward' / +`cj/org-narrow-backwards' have their own sub-letters under `n', or +just be under `n >' / `n <' as written above? The arrow-symbol +keys read naturally as "next/previous" so probably keep them. +** DONE [#B] F9 toggle should restore single-window layout for AI-vterm :bug: + +When the AI-vterm buffer is the only window in the frame (e.g. after =C-x 1=) and +F9 is pressed, =cj/ai-vterm= buries the buffer (correct), but the next F9 +redisplays the agent in a split rather than restoring the single-window full-frame +layout. F9 should toggle off/on while preserving the lone-window state. + +Fix: new =cj/--ai-vterm-last-was-bury= flag in =modules/ai-vterm.el=. +The toggle-off branch sets it to t when =one-window-p= is true (bury +path) or nil when =delete-window= runs. =cj/--ai-vterm-display-saved= +checks the flag at toggle-on: if t and the frame is still single-window, +it replaces the selected window's buffer in place via =set-window-buffer= +rather than splitting via =display-buffer-in-direction=. Flag is +consumed (cleared) by either branch so it never stays stale. + +5 tests in =tests/test-ai-vterm--single-window-toggle.el= cover: +flag set on bury, flag cleared on delete-window, flag respected only +when still one-window, flag not set when bury didn't run, and the +end-to-end roundtrip. Full =make test-unit= green. +** DONE [#B] AI-vterm scrollback history should replace agent buffer in place :feature: + +When viewing the scrollback history of an AI-vterm buffer, the history view should +replace the live agent buffer in the same window rather than splitting or popping +a separate window. Goal: read past output without losing the agent's frame slot, +then snap back to the live buffer when done. + +Decisions on the open questions: +- *Trigger*: reused the existing =cj/vterm-tmux-history= command (=C-; x h=). + No new command -- it already captures the tmux pane and runs from any + vterm buffer including agents. +- *Round-trip*: =q= / =<escape>= / =C-g= already restore the origin in + the same window via =cj/vterm-tmux-history-quit=. Same key as the + scrollback mode's other exits. +- *F9 integration*: deferred. Pressing F9 in history mode now treats the + history buffer as non-agent (its name is =*vterm tmux history: ...*=, + not =agent [...]=) so dispatch falls through to redisplay-recent + a + saved-direction split. A user who wants to toggle agent off should + press =q= first, then F9. Filed as a follow-up if it bites. + +Fix: =modules/vterm-config.el= -- one line. =pop-to-buffer buffer= +became =switch-to-buffer buffer= so the history view replaces the origin +in the selected window instead of going through display-buffer's split +logic. Quit was already in-place via =set-window-buffer=. + +New test in =tests/test-vterm-tmux-history.el= asserts the selected +window's buffer becomes the history buffer with no extra window +created (=one-window-p= still t). Existing tests dropped their +=pop-to-buffer= stub since =switch-to-buffer= works directly in batch. +Full =make test-unit= green. +** DONE [#B] Add ERT coverage for modules below 70% :tests: +CLOSED: [2026-05-14 Thu] + +Coverage snapshot from =make coverage= on 2026-05-14 (post-push): +=5958/6861= executable lines covered (=86.8%=) across 73 tracked module files. + +All tracked modules now sit at 70% or above. The two stragglers +(=system-defaults.el= and =system-commands.el=) were resolved by +attacking the instrumentation pattern rather than adding more tests: + +- =system-defaults.el= 8.3% -> 100%: switched the helper-functions + test from per-test =(load ...)= reloads inside =cl-letf= to a + single top-level =(require 'system-defaults)= wrapped in stubs, + so undercover sees one load instead of N reloads. + +- =system-commands.el= 69.4% -> 100%: switched =cj/system-cmd='s + =(interactive (list (read-shell-command ...)))= to the equivalent + string spec =(interactive "sSystem command: ")=, which lets + undercover instrument the function body that was previously + showing as 0 hits, plus added one test that captures and invokes + the =run-at-time= lambda body directly. + +Lesson for future coverage work: when ERT tests exercise a function +but the body shows 0 hits, suspect undercover/edebug instrumentation +failing on a specific Lisp form (=interactive= with a destructured +spec, backquote-destructured =pcase-let=, etc.), not the tests. + +*** DONE [#B] Add ERT tests for =modules/prog-python.el= (21/21, 100.0%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/selection-framework.el= (3/3, 100.0%) :tests: +*** DONE [#B] Add ERT tests for =modules/keyboard-compat.el= (29/29, 100.0%) :tests: +*** DONE [#B] Add ERT tests for =modules/prog-webdev.el= (21/21, 100.0%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/calibredb-epub-config.el= (95/133, 71.4%) :tests: +*** DONE [#B] Add ERT tests for =modules/system-defaults.el= (12/12, 100.0%) :tests: +CLOSED: [2026-05-14 Thu] +Rewrote =tests/test-system-defaults-functions.el= to call +=(require 'system-defaults)= once at top level (with the +side-effecting primitives stubbed via =cl-letf= wrapping the +require) instead of looping per-test =(load ...)= reloads inside +=cl-letf=. Undercover only saw the first load, so the function +bodies showed as uncovered even though every test ran them. Loading +once -- with the same stubs -- fixed the gauge and pulled coverage +to 12/12. Added two more tests to exercise the previously-unhit +list-without-comp guard and the non-string-message format branch. +*** DONE [#B] Add ERT tests for =modules/ui-navigation.el= (46/48, 95.8%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/prog-go.el= (24/27, 88.9%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/system-commands.el= (51/51, 100.0%) :tests: +CLOSED: [2026-05-14 Thu] +The =interactive= form on =cj/system-cmd= was =(interactive (list +(read-shell-command "...")))= -- a destructured list form. Edebug- +based undercover instrumentation didn't see past it, so the function +body registered 0 hits even though the tests called it directly. +Switched to the equivalent string spec =(interactive "sSystem +command: ")= and the body instrumented as expected. Added one more +test that captures the =run-at-time= lambda inside +=cj/system-cmd-restart-emacs= and invokes it directly so the inner +=call-process-shell-command= branch registers as covered. +*** DONE [#B] Add ERT tests for =modules/external-open.el= (31/33, 93.9%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/org-webclipper.el= (59/59, 100.0%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/system-utils.el= (26/26, 100.0%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/org-reveal-config.el= (68/81, 84.0%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/coverage-elisp.el= (19/19, 100.0%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/org-noter-config.el= (72/99, 72.7%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/ai-config.el= (160/191, 83.8%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/slack-config.el= (70/74, 94.6%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/org-roam-config.el= (80/80, 100.0%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/custom-text-enclose.el= (145/145, 100.0%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/dirvish-config.el= (174/185, 94.1%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/hugo-config.el= (88/96, 91.7%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/org-refile-config.el= (50/51, 98.0%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/org-contacts-config.el= (64/79, 81.0%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/transcription-config.el= (150/162, 92.6%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/music-config.el= (213/278, 76.6%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/mail-config.el= (14/19, 73.7%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/custom-buffer-file.el= (167/212, 78.8%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/org-agenda-config.el= (103/104, 99.0%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/host-environment.el= (53/57, 93.0%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/custom-ordering.el= (101/101, 100.0%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/ui-theme.el= (39/40, 97.5%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/custom-comments.el= (317/358, 88.5%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/ui-config.el= (28/31, 90.3%) :tests: +*** DONE [#B] Add ERT tests for =modules/custom-whitespace.el= (80/82, 97.6%) :tests: +*** DONE [#B] Add ERT tests for =modules/jumper.el= (97/99, 98.0%) :tests: +*** DONE [#B] Add ERT tests for =modules/test-runner.el= (160/222, 72.1%) :tests: +CLOSED: [2026-05-14 Thu] +*** DONE [#B] Add ERT tests for =modules/browser-config.el= (62/76, 81.6%) :tests: +** DONE [#A] Fix Python tree-sitter font-lock query syntax error :bug: +CLOSED: [2026-05-14 Thu] + +Diagnosed 2026-04-26 — paused at /start-work Gate 2. Root cause was system-level, not in =.emacs.d=: Emacs 30.2 + tree-sitter library 0.26.x predicate-syntax mismatch. Emacs sent =#match= (no =?= suffix), tree-sitter 0.26 rejected anything but =#match?=. Affected every =:match=, =:equal=, =:pred= predicate in every treesit-aware mode, not just Python. + +Full investigation, reproduction, and fix-option analysis in: + +[[file:docs/python-treesit-predicate-mismatch.txt][docs/python-treesit-predicate-mismatch.txt]] + +Resolved 2026-05-14 by an upstream emacs Arch-package revision bump (=30.2-2= → =30.2-3=, shipped 2026-05-03) — most likely carrying a downstream patch to =treesit.c='s predicate translation. Bug no longer reproduces: the exact failing query runs cleanly via =treesit-query-capture=, and =font-lock-ensure= on a real Python file under =python-ts-mode= completes with no =treesit-query-error=. No local override applied to =modules/prog-python.el=. Matches option A from the investigation's fix-options ("WAIT FOR UPSTREAM EMACS FIX"). +** DONE [#C] EPUB text is slightly left-of-center (shr word-wrap shortfall) :bug: +CLOSED: [2026-05-14 Thu 23:39] +(2026-05-12) Visual review of the reading-width rework is done -- it's good. Not sure I actually need this nit fixed; the left-of-center bias is minor and the `+'/`-' keys let me nudge it. Parking here until I decide it bothers me enough. + +After =b7c6b2c=, the EPUB text block is centered with `set-window-margins' at `(natural - nov-text-width) / 2' each side -- but the *rendered* text is a bit narrower than `nov-text-width' columns, because `shr' wraps at word boundaries, so the typical line ends a few columns short of the fill width. The text is left-aligned within its `nov-text-width'-wide fill region, so the unused tail of that region adds to the right margin -- the block reads as shifted left of center. Adjusting `cj/nov-margin-percent' (the `+'/`-' keys) re-flows and happens to look better at some widths (probably the line-ending pattern lands tighter), which is the same effect, not a real difference. + +Plan: in `cj/nov-update-layout', after the render, measure the actual widest line (`(save-excursion (goto-char (point-min)) (let ((m 0)) (while (not (eobp)) (end-of-line) (setq m (max m (current-column))) (forward-line 1)) m))') and center on *that* instead of on `nov-text-width'. Or, cheaper but coarser: bias the left margin by a small fudge (a column or two). The measure-the-text approach is correct; do it if it's not too slow on big chapters (it scans the buffer once per render -- the buffer's already in memory, so likely fine). =modules/calibredb-epub-config.el=, =tests/test-calibredb-epub-config.el=. +** DONE [#B] Write spec on what's needed for music-config not to depend on EMMS +CLOSED: [2026-05-15 Fri] +What if we were writing this as it's own package and couldn't use EMMS. What would that look like? +The spec should be in docs/ +Another task should be created to implement the spec +Spec written in [[id:423bc355-18d3-4e39-9e7a-f768b865d95b][Design: music-config Without EMMS]]. +** DONE [#B] Update gptel models :chore: +CLOSED: [2026-05-14 Thu] +Anthropic side: bumped Opus 4.6 → 4.7 (current frontier); Sonnet 4.6 +and Haiku 4.5 stay (still current). Default model setq also bumped +to =claude-opus-4-7= in both places (=cj/ensure-gptel-backends= and +the =use-package gptel :config= block). + +OpenAI side: bigger refresh. Old menu (=gpt-4o=, =gpt-5= original, +=gpt-4.1=, =o1=) was all in the cohort retired from ChatGPT on +2026-02-13 -- still callable via API but no longer the path forward. +New menu: =gpt-5.5= (current flagship), =gpt-5.4-mini= (fast/cheap), +=o3= (reasoning). + +Stale docstring example in =cj/gptel--current-model-selection= +also bumped to match. + +gptel's bundled =:models= list only goes through May-2025 model IDs +but the constructor passes whatever string you supply straight to the +API, so newer model names work fine without a gptel upgrade. +** DONE [#B] Add gptel toggle to M-F9 :refactor: +CLOSED: [2026-05-15 Fri] +Rebound =M-<f9>= from =cj/ai-vterm-pick-buffer= to =cj/toggle-gptel= +in both the global keymap and =vterm-mode-map=. The pick-buffer +command and its helper =cj/--ai-vterm-pick-buffer-candidates= were +deleted entirely along with the candidates test file. + +F9 family after this change: +- =<f9>= ai-vterm toggle (unchanged) +- =C-<f9>= ai-vterm project picker (unchanged) +- =M-<f9>= gptel *AI-Assistant* window toggle (NEW) + +Two existing test files updated: +=test-ai-vterm--f9-in-vterm.el= (binding assertions flipped to the +new function). +=test-ai-vterm--pick-buffer-candidates.el= deleted. + +Module commentary + the =cj/ai-vterm= docstring updated to describe +the new M-F9 behavior. + +*** 2026-05-15 Fri @ 02:21:00 -0500 Add explicit ai-vterm -> ai-config command boundary for cj/toggle-gptel +=make compile= warned that =cj/toggle-gptel= was not known to be +defined when =modules/ai-vterm.el= was byte-compiled. Added an +interactive autoload declaration in =ai-vterm.el= alongside the +other cross-module declarations: + +#+begin_src elisp +(autoload 'cj/toggle-gptel "ai-config" nil t) +#+end_src + +The dependency is now explicit, =make compile= is clean, and +requiring =ai-vterm= in isolation leaves =cj/toggle-gptel= fboundp +as an autoload sigil pointing at =ai-config=. Added a regression +test in =test-ai-vterm--f9-in-vterm.el=: +=test-ai-vterm-toggle-gptel-autoloaded-without-ai-config=. Verified +with =make compile= (no warning) and +=make test-file FILE=test-ai-vterm--f9-in-vterm.el= (5/5 pass). +** DONE [#B] Modify C-; b p :feature: +CLOSED: [2026-05-15 Fri] +- (EWW) copy EWW url when in an EWW buffer. +- (calibre) copy path to an epub or pdf or other document if those are shown in docview or pdfview + +Shipped this session: =cj/copy-buffer-source-as-kill= replaces the +old =cj/copy-path-to-buffer-file-as-kill= (kept as a =defalias= for +backwards compat). Dispatch alist =cj/buffer-source-functions= keys +on =major-mode= → thunk; =buffer-file-name= is the fallback. +Bindings: =C-; b p= now copies whatever is the right "source" for +the current mode. which-key relabeled "copy buffer source" (was +"copy file path"). + +First-batch dispatches: =eww-mode= (eww URL), =elfeed-show-mode= +(entry link), =dired-mode= / =dirvish-mode= (file at point), +=doc-view-mode= / =pdf-view-mode= (covered by the fallback to +=buffer-file-name=). 10 new ERT tests in +=tests/test-custom-buffer-file-copy-buffer-source.el= cover the +dispatch paths + the alias + the keymap. + +Deferred to a follow-up task: =mu4e-view-mode=, =org-mode= at a +heading, =help-mode=, =Info-mode=, =magit-log-mode= / +=magit-commit-mode= / =magit-status-mode=, =xref--xref-buffer-mode= +/ =grep-mode= / =compilation-mode=, =image-mode=, =archive-mode=. +These need format decisions (Message-ID vs link vs subject, id link +vs CUSTOM_ID vs heading text, etc.) before implementation. +** DONE [#C] Extend cj/buffer-source-functions to more modes :feature: +CLOSED: [2026-05-15 Fri] +Followup to =Modify C-; b p=. The first batch covered eww, +elfeed-show, dired/dirvish, and doc-view/pdf-view (via the +buffer-file-name fallback). These modes still need a decision + +implementation: + +- =mu4e-view-mode= → Message-ID, =mu4e:msgid:...= link, or + Subject + From? +- =Info-mode= → an org-style =[[info:(manual)Node][label]]= link + +Each one is a small addition to =cj/buffer-source-functions= in +=modules/custom-buffer-file.el= plus a test. Pick a format per +mode, then implement. + +*** 2026-05-15 Fri @ 02:21:00 -0500 Make Info buffer-source output match the documented org link format +Updated the =Info-mode= thunk in =cj/buffer-source-functions= +(=modules/custom-buffer-file.el=) to return the full org bracket +link =[[info:(manual)Node][(manual) Node]]= instead of the bare +target =info:(manual)Node=. Label format =(manual) Node= keeps the +manual name and node name both grep-friendly in note files. + +Existing test +=test-copy-buffer-source-info-mode-formats-as-org-info-link= on a +=.info.gz= file now asserts the bracket form. Added a new boundary +test +=test-copy-buffer-source-info-mode-handles-uncompressed-info-file= +for plain =.info= input so the suffix-stripping branch is locked +in. Verified with +=make test-file FILE=test-custom-buffer-file-copy-buffer-source.el= +(15/15 pass). + +*** 2026-05-15 Fri @ 00:11:47 -0500 Brainstorm: additional buffer-source ideas + +Today =C-; b p= invokes =cj/copy-path-to-buffer-file-as-kill=, which only +handles file-visiting buffers and errors otherwise. The proposed +extension turns it into a dispatcher: ask the current buffer "what's +your source?" and copy that, falling back to =buffer-file-name=. + +Grouping ideas by yield (most useful first) so an implementation can +prioritize: + +*Likely highest-leverage (matches Craig's daily workflows):* +- =eww-mode= → =(eww-current-url)= (already in task body). +- =elfeed-show-mode= → entry URL via =(elfeed-entry-link + elfeed-show-entry)=. Closes the loop for "I'm reading this article, + let me share it / open it in browser." +- =mu4e-view-mode= / =mu4e-headers-mode= → either the Message-ID as a + =mu4e:msgid:...= link or the From + Subject as plain text. Useful + for citing emails in org notes. +- =org-mode= on a heading → the heading's =CUSTOM_ID= or =ID= as a + full =[[id:...][title]]= link. Already partly covered by + =org-store-link=; the value here is "give me the link form even + outside an org-store flow." +- =dired-mode= / =dirvish-mode= → =(dired-get-filename)= for the file + at point, not the dired buffer's =default-directory=. Subtly + different from current behavior because dired *is* file-visiting in + a sense. +- =doc-view-mode= / =pdf-view-mode= → the underlying file path. Often + IS =buffer-file-name=, but explicit dispatch makes the behavior + predictable. Calibre integration (task body) is a special case of + this -- calibre wraps the path through a different lookup. + +*Useful for occasional workflows:* +- =help-mode= → the symbol being described (=help-xref-following= or + parsing the *Help* buffer header). Pairs with /describe-function/ + /describe-variable/. +- =Info-mode= → an org-style =[[info:(manual)Node][label]]= link. +- =magit-log-mode= / =magit-commit-mode= → the commit SHA at point, + optionally as a clickable form for the remote. +- =magit-status-mode= → the project root (or repo URL via + =vc-git-repository-url=). +- =xref--xref-buffer-mode= / =grep-mode= / =compilation-mode= → the + =file:line= location at point. +- =image-mode= → the image file path. +- =archive-mode= (tar/zip) → =archive-file-name= plus the entry name. + +*Probably skip:* +- =vterm-mode= / =eshell-mode= → no meaningful "source"; would just + copy the buffer name. Edge case at best. +- =w3m-mode= → covered by EWW for Craig; w3m use is rare here. +- =calc-mode= → "current value" isn't really a "buffer source"; better + served by a dedicated calc keybinding. + +*Implementation shape:* + +A dispatch alist mapping major-mode → thunk that returns a string +(or nil to fall through), with =buffer-file-name= as the final +fallback. Something like: + +#+begin_src emacs-lisp +(defvar cj/buffer-source-functions + '((eww-mode . (lambda () (eww-current-url))) + (elfeed-show-mode . (lambda () (elfeed-entry-link elfeed-show-entry))) + (dired-mode . (lambda () (dired-get-filename nil t))) + ...)) + +(defun cj/copy-buffer-source-as-kill () + (interactive) + (let* ((handler (alist-get major-mode cj/buffer-source-functions)) + (source (or (and handler (funcall handler)) + (buffer-file-name) + (user-error "Buffer has no copyable source")))) + (kill-new source) + (message "Copied: %s" source))) +#+end_src + +Rename the command (=cj/copy-buffer-source-as-kill=) since it's no +longer specifically about a file path. Keep =C-; b p= binding so +muscle memory survives. +** DONE [#C] Rebind org-noter insert-note to =n= (so it's =C-; n n=) :refactor: +CLOSED: [2026-05-15 Fri] + +The org-noter prefix =C-; n= currently has =i= for insert-note and =n= +for sync-next-note. Move insert-note onto =n= -- it's the most-used +action in a noter session and deserves the doubled prefix letter. + +Current bindings in =modules/org-noter-config.el= (=cj/org-noter-map=): +- =i= -> =cj/org-noter-insert-note-dwim= +- =n= -> =org-noter-sync-next-note= +- =p= -> =org-noter-sync-prev-note= +- =.= -> =org-noter-sync-current-note= + + +Proposed bindings +- n -> =cj/org-noter-insert-note-dwim= +- > -> =org-noter-sync-next-note= +- < -> =org-noter-sync-prev-note= +- =.= -> =org-noter-sync-current-note= + +Update the =which-key= labels in the same module and any test that asserts the keymap shape. +** DONE [#D] Dedup the doubly-defined functions in calibredb-epub-config.el :cleanup: +CLOSED: [2026-05-15 Fri] +=make compile= flags =calibredb-epub-config.el= for defining =cj/calibredb-clear-filters= (line ~79) and =cj/nov-jump-to-calibredb= (line ~277) twice each — the later definition silently shadows the earlier. Find which copy is current, delete the stale one. Pre-existing; noticed 2026-05-12 while fixing the Nov text-width loop. + +Diagnosis: there was no actual duplicate. Only one =(defun ...)= +of each name in the source. The "defined multiple times" warning +fired because use-package's =:bind= expansion makes the +byte-compiler count the referenced symbol as a definition when the +target function is defined in the same file -- then sees the actual +=defun= later and warns about a redefinition. + +Fix: reorder so each =defun= appears /before/ the =use-package= +block that references it via =:bind=. Concrete moves: + +- =cj/calibredb-clear-filters= moved above =(use-package calibredb + ...)=. +- =cj/nov--metadata-get= + =cj/nov--file-path= + + =cj/nov-jump-to-calibredb= (the entire jump-to-calibredb cluster) + moved above =(use-package nov ...)=. Helpers had to move + alongside the public function so the byte-compiler doesn't emit + free-function warnings for them. + +After: both "defined multiple times" warnings are gone. All unit +tests still pass. Net line count unchanged (just reordered). +** DONE [#B] Convert <cj structure template to universal yasnippet :feature:refactor: +CLOSED: [2026-05-15 Fri] + +Today =<cj= + TAB only expands in org-mode, via =org-structure-template-alist= in =modules/org-babel-config.el:144=. The expansion is the literal text: + +#+begin_example +#+begin_src cj: comment + +#+end_src +#+end_example + +A Claude skill scans for this exact marker across files using a Python helper, so the marker needs to be insertable identically in any buffer (elisp, shell, plain text, anything) regardless of major mode. Language-aware variants (per-mode comment syntax) would break the script. + +*** 2026-05-15 Fri @ 12:58:08 -0500 Wired yasnippet for universal availability + +In =modules/prog-general.el= replace =:hook (prog-mode . yas-minor-mode)= with =(yas-global-mode 1)= in =:config=, so yasnippet activates in every buffer rather than only =prog-mode= ones. Also add a hook that turns on =fundamental-mode= as an extra mode in every buffer so the universal snippet table is always consulted: + +#+begin_src emacs-lisp +(add-hook 'yas-minor-mode-hook + (lambda () (yas-activate-extra-mode 'fundamental-mode))) +#+end_src + +Acceptance: =M-: yas-minor-mode= returns =t= in =org-mode=, =text-mode=, =fundamental-mode=, and any =prog-mode= buffer. =yas-extra-modes= contains =fundamental-mode= in every buffer. + +*** 2026-05-15 Fri @ 12:58:08 -0500 Created the <cj fundamental-mode snippet + +Create =snippets/fundamental-mode/cj-comment-block= (or similar filename) with: + +#+begin_example +# -*- mode: snippet -*- +# name: cj-comment-block +# key: <cj +# -- +#+begin_src cj: comment +$0 +#+end_src +#+end_example + +Acceptance: in a scratch buffer, in a =.el= buffer, in a =.sh= buffer, in an =org= buffer — typing =<cj= and hitting TAB expands to the three-line block with the cursor on the empty middle line. + +*** 2026-05-15 Fri @ 12:58:08 -0500 Removed the org-tempo cj entry + +Once the yasnippet handles every mode, the =org-structure-template-alist= entry at =modules/org-babel-config.el:144= becomes redundant in org-mode and creates a TAB-handler ordering question. Remove the line: + +#+begin_src emacs-lisp +(add-to-list 'org-structure-template-alist '("cj" . "src cj: comment")) +#+end_src + +Verify =<cj= + TAB still expands in =org-mode= afterwards (now via yasnippet rather than org-tempo). + +*** 2026-05-15 Fri @ 15:08:48 -0500 Audited existing per-mode snippets for cross-mode use + +Walked =snippets/c-mode/=, =/emacs-lisp-mode/=, =/eshell-mode/=, =/html-ts-mode/=, =/org-mode/=, =/sh-mode/=. Read the body of every snippet. Conclusion: no movers — all 28 existing per-mode snippets contain mode-specific syntax (C =int main=, elisp =defun=, shell =printf= / =[ -f $1 ]=, HTML tags, org =#+STARTUP:= / =:PROPERTIES:= drawers, etc.) and belong where they are. =snippets/fundamental-mode/= correctly holds only the universal =cj-comment-block= marker. +** DONE [#B] Move lsp-file-watch-ignored-directories to global .emacs.d config :chore:refactor: +CLOSED: [2026-05-15 Fri] SCHEDULED: <2026-04-27 Mon> + +Shipped 2026-04-26 in commit 781b46e. Implementation: =cj/lsp-file-watch-ignored-extras= (thirteen patterns) and =cj/lsp--add-file-watch-ignored-extras= in =modules/prog-lsp.el=, called from the lsp-mode use-package =:config=. Seven ERT tests in =tests/test-prog-lsp--add-file-watch-ignored-extras.el=, all green. + +Manual verify (tomorrow): restart Emacs, open =~/code/deepsat/orchestration_dashboard_mvp/backend/test_mission_image_api.py=, watch for the file-watch prompt. Expected: no prompt, or count well below the previous 1905. If still prompting at ~1905, iterate on the pattern list. + +After verification: drop the redundant =lsp-file-watch-ignored-directories= entry from the deepsat MVP's =.dir-locals.el= here and on velox. + +Setting =lsp-file-watch-ignored-directories= via the project's =.dir-locals.el= doesn't apply at the buffer level. Confirmed via =M-: lsp-file-watch-ignored-directories= in a Python buffer — value is the lsp-mode default, not the 7 patterns we wrote in dir-locals. The safety prompt was answered with =!= and the dir-locals are otherwise live (the projectile commands take effect). + +Fix: move the seven patterns into the lsp config module as a global default with =setq-default= or per-pattern =add-to-list=. The patterns are project-agnostic build/cache directories — safe as defaults for any project. + +Patterns to add: +- =[/\\\\]node_modules\\'= +- =[/\\\\]\\.ruff_cache\\'= +- =[/\\\\]dist\\'= +- =[/\\\\]coverage\\'= +- =[/\\\\]test-results\\'= +- =[/\\\\]playwright-report\\'= +- =[/\\\\]tf[/\\\\]\\.terraform\\'= + +After landing: =M-x lsp-workspace-shutdown=, reopen a Python file, confirm the directory count drops well below the default threshold of 1000 (currently 1905). Then remove the redundant entries from the deepsat MVP's =.dir-locals.el= here and on velox. + +Discovered 2026-04-26 testing dashboard MVP F-key setup. +** DONE [#C] Investigate sqlite finalizer error on init :bug: +CLOSED: [2026-05-15 Fri] + +=*Messages*= shows =finalizer failed: (wrong-type-argument sqlitep nil)= during init. A package is finalizing an sqlite handle that's already nil — indicates a teardown bug somewhere. Likely culprits: forge, magit-todos, or any package using the sqlite backend. + +Investigation order: +1. =M-x toggle-debug-on-message= with a regex matching =finalizer failed=. +2. Restart Emacs to capture the backtrace. +3. Check =modules/git-config.el= (forge) and any other sqlite-using module. + +Single occurrence per session, no visible impact yet. Track in case it grows. + +Discovered 2026-04-26 in =*Messages*=. + +Resolution 2026-05-15: confirmed gone. Live session (2h uptime): no +=finalizer= / =sqlitep= / =wrong-type-argument sqlite= match in +=*Messages*= (3966 bytes) or =*Warnings*=. Fresh namespaced daemon +(=emacs --daemon=sqlite-verify=): forced =forge= load, ran 10 GC +cycles with =sit-for= pauses, =sqlite-available-p= and +=forge-database-file= both confirmed live -- still zero hits across +1282 bytes of =*Messages*=. If it recurs, arm +=toggle-debug-on-message= on the regex =finalizer failed= to capture +a backtrace. +** DONE [#A] org-element--list-struct issue when using gptel magit :bug: +CLOSED: [2026-05-16 Sat] +Launch Emacs +Stage a file using magit +Commit using magit +Use gptel magit to generate a commit message +Commit the file +>>> commit is successful +Stage another file using magit +Commit using magit +Use gptel magit to generate a commit message +Commit the file +>>> error org-element--list-struct: Tab width in Org files must be 8, not 4. Please adjust your ‘tab-width’ settings for Org mode +** DONE [#A] transient-setup error when running gptel magit :bug: +CLOSED: [2026-05-15 Fri] +When running gptel magit during a commit message on this machine, I get the following error consistently: +transient-setup: Cannot open load file: No such file or directory, gptel-magit +** DONE [#C] Implement flycheck modeline customization :feature: +CLOSED: [2026-05-16 Sat] + +Spec: [[id:76979608-956e-474f-90a8-8d0c958101a0][docs/specs/flycheck-modeline-customization-spec-implemented.org]] (Option 4 / hybrid). + +=modules/flycheck-config.el= got two new =:custom= lines: +=flycheck-mode-line-prefix= → "🐛", =flycheck-mode-success-indicator= → +" ✓". =flycheck-mode-line-color= stays default-t so counts pick up +=error= / =warning= faces automatically. + +=modules/modeline-config.el= got one new =(:eval ...)= form in +=mode-line-format=, placed between the recording indicator and +=cj/modeline-vc-branch=. Two guards: =(mode-line-window-selected-p)= +gates to the active window; =(bound-and-true-p flycheck-mode)= prevents +the call from firing in buffers where flycheck hasn't loaded. + +=tests/test-modeline-config-flycheck-segment.el= -- 3 smoke tests +asserting the segment is present and both guards are in place. The +existing modeline tests stay green. +** DONE [#B] Gptel Work :refactor:cleanup:feature: +CLOSED: [2026-05-16 Sat] + +Keep gptel as a focused side-tool for one-off conversations, impromptu help, and the rewrite-region code helper. Workflow stays distinct from the dedicated Claude-Code agents launched via F9, so per-project agent sessions don't get cluttered with general-purpose chat. + +In scope: +- The =cj/ai-keymap= (=C-; a=) commands in =modules/ai-config.el=. +- The save/load/delete + autosave flow in =modules/ai-conversations.el=. +- The local-tools surface in =gptel-tools/= and the loader =cj/gptel-load-local-tools=. +- gptel-magit's three triggers (M-g in git-commit, =g= in magit-commit transient, =x= in magit-diff transient). + +Out of scope: the F9 =ai-vterm= Claude-Code launcher (=modules/ai-vterm.el=) — separate module, working well. + +Closing event log: + +- Rewrote =gptel-tools/update_text_file.el= in pure Elisp + wired into =cj/gptel-local-tool-features=; 48 ERT tests. +- Split gptel-magit wiring into per-feature =with-eval-after-load= blocks (=git-commit=, =magit-commit=, =magit-diff=); rewrote the lazy-loading test to inspect =after-load-alist= directly. +- Added 36 ERT tests for =ai-conversations.el= (helpers, autosave hook, interactive save/delete). +- Added 52 ERT tests for the other five gptel-tools files; small refactor on =read_buffer.el= and =write_text_file.el= to extract testable helpers. +- =cj/gptel-autosave-toggle= + =[AS]= mode-line indicator, bound to =C-; a A=. +- =cj/gptel-quick-ask= one-shot Q&A buffer with =q= / =escape= / =c= bindings (new module =ai-quick-ask.el=), bound to =C-; a q=. +- Directive-picker wrappers around =gptel-rewrite= (=ai-rewrite.el=); =C-; a r= picks directive + rewrites, =C-; a R= redoes with a different directive. +- Dired-style saved-conversations browser (=ai-conversations-browser.el=) with RET/l/d/r/g/q bindings, bound to =C-; a b=. +- Shortlist design doc at =docs/design/gptel-tools-shortlist.org= for additional gptel tools (7 ADOPT, 2 DEFER, 1 SKIP); live community-tool survey remains as follow-up work for Craig. + +*** 2026-05-16 Sat @ 01:17:58 -0500 Rewrote update_text_file.el and wired it into cj/gptel-local-tool-features + +I rewrote =gptel-tools/update_text_file.el= in pure Elisp. The previous +version shelled out to sed for everything, had a stray quote terminator +at EOF, produced literal backslash-n where actual newlines were +expected, and prompted via =y-or-n-p= redundantly with gptel's own +=:confirm t= flag. + +The five operations (=replace=, =append=, =prepend=, =insert-at-line=, +=delete-lines=) split into pure string transforms that test without +touching the disk. The file-level wrapper validates the path, enforces +the 10MB size limit, takes a timestamped backup, and writes atomically. +No backup is created when the operation is a no-op. + +=tests/test-update-text-file.el= covers Normal / Boundary / Error per +operation plus the wrapper -- 48 tests green. Added =update_text_file= +to =cj/gptel-local-tool-features= so gptel exposes it on next restart. + +*** 2026-05-16 Sat @ 01:31:03 -0500 Split the magit wiring into per-feature with-eval-after-load blocks + +Root cause: =magit.el= calls =(provide 'magit)= BEFORE its +=(cl-eval-when (load eval) ...)= block requires =magit-commit= and +=magit-stash=. A single =with-eval-after-load 'magit= fires while +those transient prefixes are still undefined, and +=transient-append-suffix= silently no-ops on missing prefixes +(documented behavior unless =transient-error-on-insert-failure= is +set). Two of three triggers failed silently because of this; only +M-g worked, because =git-commit= IS required before the provide. + +Fix: replace the single =with-eval-after-load 'magit= with three +per-feature blocks (=git-commit=, =magit-commit=, =magit-diff=). Each +hooks the exact dependency the wiring needs. + +The existing lazy-loading test was rewritten to check +=after-load-alist= registration directly rather than driving the +hooks via =provide= -- in Emacs 30 batch mode, =provide= does not +fire registered =eval-after-load= callbacks; only an actual =load= +does. Inspecting the registration is stronger evidence anyway: the +guard against the regression is "no entry for =magit=, entries for +=git-commit=, =magit-commit=, =magit-diff=," which is exactly what +the test asserts. + +*** 2026-05-16 Sat @ 01:33:20 -0500 Added ERT coverage for ai-conversations.el + +=tests/test-ai-conversations.el= covers every helper in the module +plus the interactive entry points. 36 tests across Normal / Boundary / +Error categories: slug normalization, timestamp decoding, file +enumeration (existing topics, latest-for-topic, candidate ordering for +both =newest-first= and =oldest-first=), the save-buffer/strip-headers +round-trip, the autosave-after-send + autosave-after-response hooks, +the install-once guard for the post-response hook, and the +save/delete interactive entry points exercised via =cl-letf= stubs. +Per-test temp directories; no writes outside them. + +*** 2026-05-16 Sat @ 01:39:11 -0500 Added ERT coverage for the gptel-tools .el files + +Five new test files cover the five remaining gptel tools beyond +=update_text_file= (which was tested with its rewrite): + +- =tests/test-gptel-tools-read-buffer.el= -- 5 tests for the new + =cj/read-buffer--get-content= helper extracted from the + =gptel-make-tool= lambda. +- =tests/test-gptel-tools-write-text-file.el= -- 10 tests for the + helpers extracted from =write_text_file.el= (validate-path, + backup-name, ensure-parent, run with normal/overwrite/error + paths). +- =tests/test-gptel-tools-read-text-file.el= -- 12 tests for the + pre-existing helpers: =cj/validate-file-path=, + =cj/get-file-metadata=, =cj/check-file-size-limits=, + =cj/detect-binary-file=, =cj/handle-special-file-types=. +- =tests/test-gptel-tools-list-directory-files.el= -- 15 tests for + the =list-directory-files--*= helpers (mode-to-permissions for + files/dirs/executables, get-file-info, extension filter, formatter, + recursive vs flat listing, error path). +- =tests/test-gptel-tools-move-to-trash.el= -- 10 tests for the + =gptel--move-to-trash-*= helpers (unique-name generation with and + without extension, path validation gating HOME and /tmp, critical + directory rejection, perform on files and directories). + +Two small refactors landed first to make the tooling testable: +=read_buffer.el= and =write_text_file.el= had their main bodies +inlined into the =gptel-make-tool= lambdas; I extracted them into +=cj/read-buffer--get-content= and =cj/write-text-file--run= (plus +=--validate-path=, =--backup-name=, =--ensure-parent=) following the +Internal/Wrapper split documented in =elisp-testing.md=. + +52 new tests, all green. + +*** 2026-05-16 Sat @ 02:01:48 -0500 Wrote the gptel-tools shortlist design doc + +[[file:docs/design/gptel-tools-shortlist.org][docs/design/gptel-tools-shortlist.org]] covers each of the candidates +called out in the task body plus a few obvious adjacents. Decisions: + +- *ADOPT* (7): =search_in_files=, =git_status= / =git_log= / + =git_diff= (three tools), =web_fetch=, =search_emacs_help=, + =find_file_by_name=, =take_screenshot=. Each gets a sketch in the + doc (args, validation, implementation outline). +- *DEFER* (2): =run_shell_command= (huge surface, click-fatigue + risk; ADOPT-bucket tools cover most legit use cases), =org_capture= + (needs UX design for template pre-fill and round-trip). +- *SKIP* (1): =eval_elisp= (code execution from a model is too + dangerous even with confirm-each-call). + +Follow-up work surfaced in the doc: + +1. *Live community survey* -- walk the gptel README's tool examples, + MELPA =gptel-tool-*=, GitHub =gptel-make-tool= search, + karthink's gptel repo. I couldn't do live web research from + this session; that pass remains for Craig to do or to delegate. +2. *Per-tool implementation sub-tasks* -- each ADOPT entry deserves + its own [#B] under =Gptel Work= when Craig reviews this shortlist. +3. *Sandboxing convention* -- decide whether =web_fetch= needs an + allowlist of outbound URLs, and the same call for + =run_shell_command= if it's promoted from DEFER. + +Three open questions called out for review at the bottom of the +doc. + +*** 2026-05-16 Sat @ 01:54:34 -0500 Added directive-picker wrappers around gptel-rewrite + +New module =modules/ai-rewrite.el= with two commands: + +- =cj/gptel-rewrite-with-directive= (=C-; a r=, replacing the bare + =gptel-rewrite= binding): completing-read on a directive name from + =cj/gptel-rewrite-directives=, then rewrite the active region. +- =cj/gptel-rewrite-redo-with-different-directive= (=C-; a R=): replay + the prior region with a different directive (markers are saved + buffer-local so the region survives accept/reject of the first + rewrite). + +Open-question answer: the directive is injected via a one-shot +=let=-binding on =gptel-rewrite-directives-hook= (an abnormal hook +that gptel-rewrite already supports for per-call system messages), +not by mutating =gptel-directives= globally. No advice on +=gptel-rewrite= and no state to clean up after the call returns. + +Directives ship inline as a =defcustom= alist with the six names +called out in the task body (=terse=, =fix-grammar=, +=refactor-readability=, =add-docstring=, =explain-as-comment=, +=shorten=) so customization is straightforward without a separate +file layer. + +9 tests in =tests/test-ai-rewrite.el= cover the defcustom shape, +the wrapper (normal path, no-region error, unknown-directive +error, last-state recording), and the redo (replays prior region, +errors when no previous, excludes the current directive from the +re-pick prompt). =gptel-rewrite= stubbed for tests so no rewrite +UI fires. + +*** 2026-05-16 Sat @ 01:59:44 -0500 Built the saved-conversations browser + +New module =modules/ai-conversations-browser.el= + +=cj/gptel-browse-conversations= entry point bound to =C-; a b= +(which-key labelled "browse conversations"). Opens a dired-style +=*GPTel-Conversations*= buffer in =cj/gptel-browser-mode= (a +=special-mode= derivative). + +Each row shows date, time, topic slug, and a preview of the most +recent message (configurable length via +=cj/gptel-browser-preview-length=, default 60 chars). Rows sort +newest first. + +Bindings in the browser: +- =RET= / =l=: load the conversation (delegates to + =cj/gptel-load-conversation= with the file pre-selected via a + =cl-letf= stub on =completing-read= so the user isn't prompted + twice), then bury the browser window. +- =d=: delete the file under point after =y-or-n-p= confirmation, + re-render. +- =r=: rename the file under point; preserves the timestamp, + slugifies the new topic, refuses unchanged input and existing + targets. +- =g=: refresh. +- =n= / =p=: next / previous row. +- =q=: quit-window. + +21 tests in =tests/test-ai-conversations-browser.el= cover the +helpers (topic parsing, header stripping, preview shaping for +truncate / short / empty cases, row-for-file with both +conversation and non-conversation filenames, rows enumeration, +render output for empty and populated cases, newest-first sort, +rename-target preservation of timestamp + slug, rename-target +error on missing timestamp) and the file-touching actions (delete +with y, cancel with n, rename, rename-on-empty-line error). + +*** 2026-05-16 Sat @ 01:46:55 -0500 Added cj/gptel-quick-ask one-shot command + +New module =modules/ai-quick-ask.el=. Bound to =C-; a q= via +=cj/ai-keymap= (which-key labelled "quick ask"). + +=cj/gptel-quick-ask=: read a prompt in the minibuffer, create the +=*GPTel-Quick*= buffer in =cj/gptel-quick-mode= (a special-mode +derivative with =q= / =escape= / =c= bindings), insert "Q: <prompt>" +and the response marker, then call =gptel-request= with =:stream t= +streaming into the buffer. + +=cj/gptel-quick-dismiss= (=q= / =escape=): delete the window and +kill the buffer. Idempotent when the buffer is absent. + +=cj/gptel-quick-continue= (=c=): extract the prompt and response, +seed them into =*AI-Assistant*= under proper org headings (matching +=cj/gptel--fresh-org-prefix= shape), display the side window, +dismiss the quick buffer. + +13 tests in =tests/test-ai-quick-ask.el=: +- Pure helpers: initial-text shape, extract-response (normal / + multi-line / no-marker / empty), seed-text shape (with and without + response). +- =ask=: creates the buffer in the right mode with the prompt + recorded, calls =gptel-request=, errors on empty prompt. +- =dismiss=: kills the buffer, no-op when absent. +- =continue=: seeds =*AI-Assistant*= with both prompt and response, + dismisses the quick buffer, errors when called outside a quick + buffer. + +=gptel-request= stubbed in tests so no network call happens. + +*** 2026-05-16 Sat @ 01:41:51 -0500 Added cj/gptel-autosave-toggle + [AS] mode-line indicator + +=cj/gptel-autosave-toggle= flips =cj/gptel-autosave-enabled= in the +current GPTel buffer. Bound to =C-; a A= via =cj/ai-keymap= +(which-key labelled "toggle autosave"). When autosave is OFF and no +filepath is configured, the command prompts to save the conversation +first so a save target exists. When autosave is ON, the command +turns it off. + +=cj/gptel-autosave-mode-line-format= surfaces " [AS]" in the +mode-line when autosave is on, blank when off. Installed via a +=gptel-mode-hook= so every GPTel buffer picks it up. The install +helper is idempotent. + +6 new tests in =tests/test-ai-conversations.el= cover the enable / +disable paths, the no-filepath prompt path, the +not-a-gptel-buffer error path, the mode-line format evaluation, and +the install idempotence. +** CANCELLED [#D] Add status dashboard for dwim-shell-command processes :feature: +CLOSED: [2026-05-16 Sat 11:12] + +This was closed because all of the dwim commands finish before this would be necessary. + +Create a command to show all running dwim-shell-command processes with their status. +Currently, there's no unified view of multiple running extractions/conversions. + +**Current behavior:** +- Each command shows spinner in minibuffer while running +- Process buffers created: `*Extract audio*`, etc. +- On completion: buffer renamed to `*Extract audio done*` or `*Extract audio error*` +- No way to see all running processes at once + +**Recommended approach:** +Custom status buffer that reads `dwim-shell-command--commands`. +Can add mode-line indicator later as enhancement. +** CANCELLED [#D] Track ELPA upstream byte-compile warnings (esxml, poetry) :chore: +CLOSED: [2026-05-16 Sat 11:13] + +Fixed the esxml issue in the config. not using poetry any longer + +Two ELPA packages emit byte-compile warnings on =make compile= that aren't fixable in this repo: + +1. =elpa/esxml-20250421.1632/esxml.el= — =Warning: Unknown type: attrs= and =Unknown type: stringp= (a defcustom =:type= spec). +2. =elpa/poetry-20240329.1103/poetry.el= — =Warning: Case 'X will match 'quote'= for four cases (=post-command=, =projectile=, =project=, =switch-buffer=). Quoted symbols inside =pcase= clauses — should be unquoted upstream. + +No action in this repo. Revisit when packages update. File upstream issues if warnings linger past a few months. + +Discovered 2026-04-26 in =*Messages*= during compile. +** DONE [#B] ai vterm sizing :feature: +CLOSED: [2026-05-20 Wed] +if on a laptop, ai vterm should come up from the bottom 75% +if on a desktop, ai vterm should come from the right side 50% + +Shipped =feedb78= "feat(ai-vterm): default to bottom-75% on laptop, right-50% on desktop". Host-aware defaults via =cj/--ai-vterm-default-direction= / =cj/--ai-vterm-default-size= (branch on =env-laptop-p=); defcustoms =cj/ai-vterm-desktop-width= (0.5) + =cj/ai-vterm-laptop-height= (0.75). 6 new tests. Laptop path confirmed live; desktop path unit-tested, manual GUI check pending until next at a desktop. +** DONE [#C] Dashboard buffer too long :bug: +CLOSED: [2026-05-20 Wed] +The dashboard often opens scrolled — content is partly above the visible +window, the bottom half of content sits in the middle of the screen, and +the actual bottom of the buffer is empty lines. The banner image + the +three navigator rows + several explicit newlines push the content too +high. Even the smallest screen would fit the content if the gratuitous +empty lines were trimmed. + +Shipped =4ac1b81= "fix(dashboard): trim padding newlines and reset +window-start on open". Trimmed the startupify padding from five +newlines to two and added =set-window-start= to =point-min= in +=cj/dashboard-only=; characterization test in +=tests/test-dashboard-config.el=. Opens at the top now, verified live. +** DONE [#C] org-contacts-files nil error at launch :bug:quick: +CLOSED: [2026-05-21 Thu] +Root cause: =org-contacts-files= was set via the deferred =:custom=, so it was still nil when the agenda-finalize anniversaries hook fired at launch. Fixed by setting it eagerly at require time + guarding the wrapper. Shipped =099a771=. +Launch emits: + +: [org-contacts] ERROR: Your custom variable 'org-contacts-files' is nil. + +Surfaced 2026-05-21. =org-contacts-files= isn't set (or is set after org-contacts loads / to an empty value), so org-contacts has no contacts file to read. Fix: point =org-contacts-files= at the intended contacts org file before org-contacts initializes. +** DONE [#B] Verify + commit ai-vterm graceful close (C-S-<f9>) :test:quick: +CLOSED: [2026-05-21 Thu] +Verified live (M-f9 closes the agent + tmux session, confirm guard works). Shipped =c38683f=; also consolidated the F9 family onto ai-vterm (M-f9 = close). +Triggered by: 2026-05-20 ai-vterm close command. + +=cj/ai-vterm-close= is built but uncommitted (WIP in +=modules/ai-vterm.el= + new =tests/test-ai-vterm--close.el=, 7 tests +passing, clean-load smoke OK). It kills the agent's tmux session, then +its vterm buffer + window, after a =y-or-n-p= confirm. Bound =C-S-<f9>= +globally and in =vterm-mode-map=. Needs live verification before commit: + +- Launch an agent (F9), press =C-S-<f9>=: the confirm prompt fires, + the vterm buffer + window go away, and =tmux ls= shows the + =aiv-<name>= session gone. +- No-agent case: =C-S-<f9>= → "No AI-vterm agent buffers to close". +- Confirm guard: answer =n= → the agent stays. +- Confirm the =C-S-<f9>= chord actually reaches Emacs (PGTK/Wayland); + pick a different key if a layer swallows it. + +Once verified, =/review-code= + commit +=feat(ai-vterm): add graceful agent close on C-S-<f9>=. +** DONE [#B] gptel fork not loading: gptel-make-anthropic void :bug: +CLOSED: [2026-05-22 Fri] +:PROPERTIES: +:LAST_REVIEWED: 2026-05-22 +:END: +=cj/toggle-gptel= (and gptel chat generally) errors with: + +: cj/ensure-gptel-backends: Symbol's function definition is void: gptel-make-anthropic + +Surfaced 2026-05-21 (was hit via =M-f9=, which used to run =cj/toggle-gptel=). =gptel-make-anthropic= being void means gptel isn't loaded (or didn't load cleanly) at the point =cj/ensure-gptel-backends= runs. Lead suspect: the 2026-05-18 switch to the local fork via =:load-path "~/code/gptel"= + =:ensure nil= in =modules/ai-config.el= — if the fork doesn't load, none of the =gptel-make-*= constructors are defined. Check that =~/code/gptel= is on the load-path and loads (the prior session also trashed =elpa/gptel-0.9.9.4=, so elpa is no longer a fallback), then confirm =cj/ensure-gptel-backends= runs after gptel is available rather than before. + +Note: =M-f9= no longer triggers this — the F9 family was consolidated onto ai-vterm, so =M-<f9>= now runs =cj/ai-vterm-close= (permanent). =cj/toggle-gptel= lost its binding in the process; once gptel loads cleanly, decide on a new key for it (or leave it unbound). +** DONE [#C] make test-name aborts on gptel-dependent test files :tests:quick: +CLOSED: [2026-05-22 Fri] +:PROPERTIES: +:LAST_REVIEWED: 2026-05-22 +:END: +=make test-name TEST=<pattern>= loads *every* test file before ERT applies the name selector, so an unrelated file that fails to load takes the whole run down. Currently =tests/test-gptel-tools-*.el= (and likely the transcription tests) error at load with =Symbol's function definition is void: gptel-make-tool= because gptel isn't available in batch, aborting with Error 255 even when the selected tests have nothing to do with gptel. + +Surfaced 2026-05-21 while running the calendar-sync suite — had to fall back to loading the calendar-sync test files directly. Fix options: guard the gptel-dependent test files to skip cleanly when gptel is absent (e.g. =(when (require 'gptel nil t) ...)= or an ert skip), stub =gptel-make-tool= in a shared testutil, or have =test-name= load only files whose names match the pattern instead of all of them. + +Resolution (2026-05-22): the diagnosis above was wrong. The =test-gptel-tools-*.el= files already stub =gptel-make-tool= and =(provide 'gptel)= when gptel is absent, so they load fine in batch. The real abort was =tests/test-system-defaults-functions.el= leaking =default-directory=: it requires =system-defaults=, which runs =(setq default-directory user-home-dir)= at load, and =test-name= then resolved every following relative =-l tests/X.el= against the wrong directory. Fixed in 4fbe435f — =test-name= passes absolute paths to =-l=, and the test contains the leak with a =let=-binding around the require. +** DONE [#C] Consolidate auth-source secret-funcall idiom :refactor: +CLOSED: [2026-05-22 Fri] +:PROPERTIES: +:LAST_REVIEWED: 2026-05-22 +:END: +Fixed: extracted =cj/auth-source-secret-value= (host + optional user → secret or nil) into =system-lib.el= (a leaf, so calendar-sync stays off ai-config/gptel). All four callers delegate; ai-config layers its required-secret error on top. Dropped the now-dead =(require 'auth-source)= from the three delegating modules. f6e5885b. +The auth-source lookup + funcall-the-secret block is duplicated four times: =calendar-sync--calendar-url= (calendar-sync.el), =cj/auth-source-secret= (ai-config.el), =cj/--auth-source-password= (transcription-config.el), and =cj/--slack-token= (slack-config.el). All share =(let ((secret (plist-get (car (auth-source-search ...)) :secret))) (if (functionp secret) (funcall secret) secret))=. + +Surfaced 2026-05-21 by the code review on the calendar auth-source work — flagged as the fourth copy. Extract one low-level helper into a leaf module both can load (=system-lib.el= or =auth-config.el=), then delegate all four to it. Note the semantics differ: =cj/auth-source-secret= forces =:user "apikey"= and =error=s on miss, while the calendar helper wants a no-user lookup that returns nil on miss — so the shared primitive needs optional user + nil-on-miss, with the erroring/required-user behavior layered on top where needed. Don't make calendar-sync depend on ai-config (it drags in the gptel stack). +** DONE [#B] Keybinding: rewrite TODO+priority as sorted timestamp :feature:quick: +CLOSED: [2026-05-22 Fri] +:PROPERTIES: +:LAST_REVIEWED: 2026-05-22 +:END: + +*** 2026-05-22 Fri @ 08:35:05 -0500 Approach (revised): finalize-task command, journal-aware + depth-aware +Bound =C-; O d= (=cj/org-map=, d = "date"). Command =cj/org-finalize-task=: +1. Guard: in org-mode, on a heading carrying a non-done todo keyword (else =user-error=). +2. =completing-read= over =org-done-keywords= (dynamic — tracks =org-todo-keywords=; default DONE). +3. =(let ((org-log-done nil)) (org-todo STATE))= — fires the journal-copy hook (=org-roam-config= copies the whole subtree to today's daily under "Completed Tasks"). =org-log-done= is bound nil so the command owns the CLOSED line; the hook keys off =org-state=, not =org-log-done=, so the copy still fires. +4. Dispatch per todo-format (capture the keyword BEFORE the transition): + - level >= 3, OR keyword was VERIFY → dated rewrite: strip keyword + =[#X]= cookie, prepend =(format-time-string "%Y-%m-%d %a @ %H:%M:%S %z")=, keep tags. Done as a text edit, not via =org-todo=, so the hook doesn't double-fire. + - level <= 2 and not VERIFY → close in place: keep the chosen done keyword, add a date-only =CLOSED: [YYYY-MM-DD Day]= line. +Tests: ERT in org temp-buffers with the journal hook bound to nil; the pure transform helper tested directly with an injected TIME for a deterministic stamp. Commit: =feat(org-config): ... with tests=, direct to main. +** DONE [#C] Reconcile duplicate org-log-done setting :refactor: +CLOSED: [2026-05-22 Fri] +=modules/org-config.el= and =modules/org-roam-config.el= both set =org-log-done=, so the effective value was load-order-dependent. Set it once in =cj/org-todo-settings= to ='time= (the dated-completion workflow wants a CLOSED timestamp on every TODO->DONE) and dropped the org-roam duplicate. Fixed in 5f8e1bc7. +Triggered by: 2026-05-22 L56 finalize-task work. +** DONE [#C] Always save the daily after a journal task-copy :feature: +CLOSED: [2026-05-22 Fri] +=cj/org-roam-copy-todo-to-today= (=org-roam-config.el=) only saved today's daily in the refile branch. Pulled the save into =cj/--org-roam-save-daily=, which now runs on both paths and writes only when the buffer is modified, so a crash or shutdown never loses a freshly-copied task. Fixed in f07ce74d. +Triggered by: 2026-05-22 L56 finalize-task work. +** DONE [#B] Collapse dashboard navigator + keymap duplication :refactor: +CLOSED: [2026-05-22 Fri] +:PROPERTIES: +:LAST_REVIEWED: 2026-05-22 +:END: +Fixed: extracted a single =cj/dashboard--launchers= table; =cj/dashboard--navigator-rows= and =cj/dashboard--bind-launchers= derive the icon rows and the keybindings from it. Behavior-preserving (verified by tests + a live dashboard check). 5 ERT tests in test-dashboard-config-launchers.el. +Triggered by: 2026-05-18 Dashboard buffer too long refactor audit. + +=modules/dashboard-config.el= inlines 12 launcher commands twice — once +as anonymous lambdas inside =dashboard-navigator-buttons= (lines +128-189) and once as anonymous lambdas inside the +=dashboard-mode-map= =define-key= block (lines 200-218). Adding a +13th launcher requires editing two places, and the icon-row order and +keymap order drift independently. + +Refactor sketch: a single =defconst cj/dashboard--launchers= holding +=(KEY ICON-FAMILY ICON-NAME LABEL TOOLTIP COMMAND)= tuples, then +derive both =dashboard-navigator-buttons= (grouped 4-per-row) and the +keybindings from that list with a small helper. +** DONE [#C] Dashboard banner subtitle off-center :bug:quick: +CLOSED: [2026-05-22 Fri] +:PROPERTIES: +:LAST_REVIEWED: 2026-05-22 +:END: +The banner subtitle "Emacs: The Editor That Saves Your Soul" renders off-center relative to the dashboard width. + +Surfaced 2026-05-21. Fixed: dashboard-banner-title-offset 5 → 3 (5 over-shifted left). Verified centered via off-screen capture. +** DONE [#C] Dashboard navigator icons and section titles uncolored :bug:quick: +CLOSED: [2026-05-22 Fri] +:PROPERTIES: +:LAST_REVIEWED: 2026-05-22 +:END: +The navigator icons and the "Projects", "Bookmarks", and "Recent Files" section titles render in the default face. They should pick up colors from the Dupre color theme instead. + +Surfaced 2026-05-21. Fixed: set dashboard-items-face to steel+2 so the navigator (icons + labels) and the list items pick up a theme color; section titles stay blue via dashboard-heading. Root cause found while debugging: the navigator is rendered with a dashboard-items-face OVERLAY (overlays beat text properties), so the per-button dashboard-navigator face is inert — the nav and the items are painted by the same face, dashboard-items-face. Separating their colors would require overriding that overlay; tracked as a follow-up. +** DONE [#B] ai-vterm popup adds a third split instead of taking a half :bug:next: +CLOSED: [2026-05-25 Mon] +F9 raises ai-vterm in a new split rather than reusing the existing window layout. With the frame already split vertically (two side-by-side windows), F9 produces three columns with ai-vterm wedged in the center; expected: ai-vterm occupies the right half. Same failure horizontally — when the frame is split top/bottom and ai-vterm rises from the bottom, it should take the bottom half instead of adding a third row. + +Repro: split the frame in two (vertically or horizontally), press F9. +Likely area: ai-vterm's display/window-placement rule splits the selected window unconditionally instead of reusing the target half (display-buffer-alist / side-window config). +** DONE [#B] projectile open todo in other window :bug:next: +CLOSED: [2026-05-25 Mon] +Opening the project todo via C-c C-p t should always open in the other window if the window is split. +** DONE [#C] Make elfeed-config tests byte-compile-safe :test: +CLOSED: [2026-05-25 Mon] +The =cj/elfeed-process-entries= tests in =tests/test-elfeed-config-helpers.el= only pass when =elfeed-config= loads as interpreted source. The byte-compiled function inlines the =elfeed-entry-link= struct accessor, so the function stubs are bypassed and the inlined accessor type-checks a real =elfeed-entry=. The batch test environment has no elfeed package, so the tests can't build real structs either. Rewrite the tests (define a stand-in =elfeed-entry= cl-struct, or make elfeed loadable in batch) so they survive byte-compilation. This blocks annotating elfeed-config with its load-graph header (the last unclassified init module). +** DONE [#C] Manually verify cj/org-finalize-task journal copy :test: +CLOSED: [2026-05-25 Mon 08:33] +Confirm the live behavior the unit tests mock out. In a real Emacs (org-roam loaded), run =C-; O d= on a level-3 sub-task and on a level-2 task. Expect the sub-task to flip to a dated entry, the level-2 to keep its keyword and gain a date-only CLOSED line, and in both cases a copy to land in today's daily under "Completed Tasks". +Triggered by: 2026-05-22 L56 finalize-task work. +** DONE [#C] Org TODO-keyword colors not dupre-themed :bug: +CLOSED: [2026-05-25 Mon] +Fixed in 32cfe216: org-todo-keyword-faces and org-priority-faces now point at named dupre-org-* faces (closest palette color per keyword) with dimmed variants for unfocused windows. Root cause was that dupre defined its own faces only via custom-theme-set-faces, never defface, so they failed when applied directly; added a defface registration block for all dupre faces. +The org TODO/DOING/DONE (and other keyword) colors don't match the dupre palette — they're showing default org colors rather than dupre tones. Likely needs changes in two places: the org keyword faces in the theme (=org-todo=, =org-done=, =org-headline-done=, and friends in =themes/dupre-faces.el=) and any =org-todo-keyword-faces= mapping set in the org config (=org-config.el= / =org-capture-config.el=), which may hardcode non-dupre colors. Reconcile both so keyword colors come from the palette. +Triggered by: 2026-05-25 auto-dim theming work. +** DONE [#C] Make standalone byte-compile load paths match module dependencies :tests:cleanup: +CLOSED: [2026-05-25 Mon] +Resolved: added =make compile-file FILE== (load path = modules + themes + tests + package-initialize) as the documented single-file compile command, plus =-L themes= on =make compile=. Bare =emacs -Q= stays unsupported by design; the documented command resolves local compile-time deps. Verified dashboard-config.el (undead-buffers) and dupre-faces.el (dupre-palette) both compile. The parallel PostToolUse byte-compile hook also wants =-L themes=, but =.claude/hooks/validate-el.sh= is rulesets-owned (synced at startup, so a local edit reverts), so that fix is routed to the rulesets inbox rather than committed here. +Bare =emacs -Q --batch --eval '(byte-compile-file "modules/dashboard-config.el")'= fails because =undead-buffers= is not on the load path, even though normal init/test loading succeeds. Decide whether standalone compile checks should use the project test harness/load path, or whether modules with compile-time local dependencies should add explicit load-path setup or lighter declarations. + +Acceptance: +- =dashboard-config.el= can be byte-compiled through the documented local command without missing =undead-buffers=. +- The fix generalizes to other modules with local compile-time dependencies instead of special-casing only dashboard. +- Document the intended command in the Makefile/test docs if the answer is "use the harness, not bare =emacs -Q=". + +Triggered by: 2026-05-25 dashboard transparency and vterm auto-dim work. +** DONE [#C] latex-config WIP state :refactor: +CLOSED: [2026-05-25 Mon] +The =init.el= require for =latex-config= carried a bare "WIP need to fix" comment with no detail on what was broken. Retired that comment while classifying foundation modules; the underlying state still needs investigation. Read =modules/latex-config.el=, determine what's incomplete, and either finish it or scope a real task. + +Investigated 2026-05-25. The comment came from the original repo import (=092304d9=); no detail about the original breakage survives. The module byte-compiles clean and works. =company-auctex= is not a current bug — company is still the live framework, and its removal is already scoped under the corfu-migration spec below. Found one real defect: =cj/--latex-select-pdf-viewer= ran on every LaTeX buffer and blindly pushed onto =TeX-view-program-selection=, stacking duplicate =output-pdf= entries against its own idempotency docstring. Fixed in =b007a9b8= (remove-then-cons) and added =tests/test-latex-config.el= (the module had none) covering selection, preference order, fallback, idempotency, and default override. +** DONE [#C] Org tag column too close to the heading text :org:display: +CLOSED: [2026-05-26 Tue] +Shipped in commit 63192749: =org-tags-column= set to 0 plus a font-lock display property that right-aligns tags to the window edge, tracking width live with nothing baked into files. It was an org display setting, not pearl. The same change covers the inline "align further out" note that was queued separately. +** DONE [#C] mu4e launch removes the window split :quick:solo: +CLOSED: [2026-05-26 Tue] +Shipped in commit 3acdb28e. Root cause was mu4e's main-view =display-buffer-full-frame= action (mu4e-window.el), not =delete-other-windows= on start. Fixed via a =display-buffer-alist= entry (mu4e's documented override point) routing =*mu4e-main*= to the current window (reuse-window then same-window), so the split survives. Registered eagerly so it applies on first launch. Tests cover registration + split preservation. +** DONE [#C] Slack window should open in the other window when split :quick:solo: +CLOSED: [2026-05-26 Tue] +Shipped in commit 6c7f9ae2: =slack-buffer-function= set to =cj/slack--display-buffer= (=pop-to-buffer= with =inhibit-same-window= + reuse/use-some/pop-up action), so a room reuses the split's other window and never takes over the selected one. Tests cover split-placement and the selected-window-preserved invariant. +** DONE [#B] Restore the daily-prep keybinding under Projectile :feature:keybinding: +CLOSED: [2026-05-26 Tue] +Shipped in commit 8e5efcab and verified live: =C-c p d= opens =inbox/today-prep.org= in the other window, project-scoped; deadgrep-in-dir moved to =C-c p G=, plain deadgrep dropped, deadgrep-here stays on =C-c p g=. Settled questions: lowercase d, per-project, other window via =find-file-other-window=. Tests in =tests/test-prog-general-open-project-daily-prep.el=. +=C-c p d= should open the project's daily prep (=<project-root>/inbox/today-prep.org=, a stable symlink) and no longer works. Keep it project-scoped under Projectile on purpose: the daily prep only exists in the work project, so a project-scoped opener in =projectile-command-map= is the right home, mirroring =cj/open-project-root-todo= (=C-c p t=). Filed from the work-project session 2026-05-26 — it's an Emacs-config change, so it lives here. + +Root cause: there is no daily-prep binding or opener anywhere in the config (checked the modules and the running daemon — no "prep" function). It was almost certainly eval'd live into the daemon in a past session and never written to a module, so it vanished on restart. The fix must be persisted to a module, not just eval'd live. =C-c p d= currently resolves to =cj/deadgrep-in-dir=, so the =d= slot is taken. + +Approach: mirror =cj/open-project-root-todo= at =modules/prog-general.el:175= and its =:bind (:map projectile-command-map ...)= block (lines 153-155). The prep file is in a subdir (=inbox/today-prep.org=), not the project root, so target the subdir path directly rather than =cj/find-project-root-file= (which only scans the root): + +#+begin_src emacs-lisp +(defun cj/open-project-daily-prep () + "Open inbox/today-prep.org in the current Projectile project root." + (interactive) + (if-let ((root (projectile-project-root))) + (let ((file (expand-file-name "inbox/today-prep.org" root))) + (if (file-exists-p file) + (cj/--find-file-respecting-split file) + (message "No inbox/today-prep.org in project: %s" root))) + (message "Not in a Projectile project"))) +#+end_src + +Open questions to settle when we tackle it: +- Which key? =d= is taken (=cj/deadgrep-in-dir=). Free lowercase in =projectile-command-map=: =h=, =n=, =w=, =y= (none a strong "daily prep" mnemonic). Or override =d=, or add a sub-prefix. +- Behavior outside the work project? Resolving relative to =projectile-project-root= makes it per-project; only work has a prep doc, so elsewhere it hits the "No prep" message. Acceptable, hard-scope to work, or offer to create one? +- Same window or other window? Mirror =cj/open-project-root-todo='s =cj/--find-file-respecting-split=, or plain =find-file=? +** DONE [#B] Headline indicators wrap to a second row :bug:org: +CLOSED: [2026-05-27 Wed] +Fixed 2026-05-27 (commit 822e7a37). =cj/org-tag-right-margin= raised from 5 to 9 in =modules/org-config.el:111= — sized empirically from a rendered measurement via the headless screenshot harness, not from column arithmetic (the trailing " · ▾" measures 4 cols by =string-width= but the fallback ▾ renders wider than reported and =:align-to= stretch rounds, so the real overflow exceeded the nominal count). Regression fixture checked into =tests/manual/headline-wrap/{fixture.org,README.org}=. + +Trigger had been: a heading carrying both an org-tidy =·= (hidden =:PROPERTIES:= drawer) and the fold ellipsis " ▾" (folded with subtree) wrapped past the window edge because the reservation didn't account for the indicator pair under the rendered (not nominal) width. +** CANCELLED [#B] Rework dev F-keys: compile+run (F4), test (F6), coverage (F7) :feature: +CLOSED: [2026-05-28 Thu] +:PROPERTIES: +:LAST_REVIEWED: 2026-05-22 +:END: + +Superseded by the F-key Completion task below. The 2026-05-27 audit found this ticket roughly 75% shipped (F4 dispatcher, F7 coverage, format-key migration off F6 all in); the remaining 25% (Phase 2b — per-language test discovery, "Run a test..." menu, M-F6 fast path, buffer-local last-test, "No tests found" error) is now tracked there with its own evidence-backed child tasks. + +*** TODO [#B] Format keybindings move off F6 :refactor:cleanup: +Move blacken-buffer (python), shfmt-buffer (sh), and clang-format-buffer (c) +off F6 onto the =C-; f= prefix, which already hosts format-buffer bindings. +Also remove projectile-run-project from F6 (it folds into the new F4). +Touch the per-language config modules that currently bind F6 for formatting. + +Acceptance: F6 has no remaining format-or-run bindings in any module; =C-; f= +prefix triggers the right formatter per major mode. + +Depends on: none (start here -- clears F6 before F4/F6 work lands). + +*** TODO [#B] Project-type detection helper :feature: +Single helper that returns a project-type symbol (=compiled=, =interpreted=, +=unknown=) from the current buffer's project. Uses +=projectile-project-compilation-cmd= when set, then heuristic fallbacks: +=go.mod=, =Makefile=, =Eask=, =package.json=, =pyproject.toml=, +=docker-compose.yml=. Lives near the F4 dispatcher. + +Acceptance: ERT tests cover each heuristic in isolation plus a precedence +case where projectile's cached cmd wins over the file heuristics. + +Depends on: none. + +*** TODO [#B] F4 compile+run dispatcher :feature: +Build the F4 binding per spec: plain F4 opens a completing-read whose +candidates depend on project-type (Compile / Run / Compile + Run [default] / +Clean + Rebuild for compiled; Run only for interpreted). C-F4 fast-paths to +Compile; M-F4 fast-paths to Clean + Rebuild. Both fast paths show a "not a +compiled language" message and no-op on interpreted projects. Reads +projectile's per-project compile/run commands; no Docker-specific logic. + +Acceptance: each candidate dispatches to the right projectile command; fast +paths no-op cleanly on interpreted projects; F4 bindings live in one module. + +Depends on: project-type detection helper. + +*** TODO [#B] Per-language test discovery :feature:tests: +Provide a single =cj/--tests-in-buffer= function returning a list of test +names for the current buffer's language. Tree-sitter queries for Python, +Go, TS/JS (treesit-auto already configured); built-in sexp scan for elisp +(=ert-deftest= forms). Parsing unopened test files uses with-temp-buffer + +insert-file-contents + <lang>-ts-mode + treesit-query-capture. Queries are +spelled out in the spec above. + +Acceptance: ERT tests feed each language a fixture file and assert the +expected test-name list comes back; missing grammar surfaces a clear error. + +Depends on: none (parallel-safe with F4 work). + +*** TODO [#B] F6 test dispatcher :feature:tests: +Build the F6 binding per spec: plain F6 opens completing-read with "All +tests", "Current file's tests", "Run a test..."; C-F6 fast-paths to current +file's tests; M-F6 fast-paths to "Run a test...". "Current file's tests" +runs the buffer directly if it's a test file, otherwise finds matching test +files via language conventions (elisp =tests/test-<module>*.el=, python +=tests/test_<module>.py=, etc.) and runs them aggregated. "Run a test..." +pre-selects =cj/--last-test-run= (buffer-local) and errors with "No tests +found for <buffer>" when discovery returns nothing -- no silent fallthrough. + +Acceptance: each entry point dispatches to the right runner; buffer-local +last-test memory persists per source file; no-match error fires correctly. + +Depends on: per-language test discovery. + +*** TODO [#B] F7 hand-off to dev-fkeys story :feature: +Once the coverage track ships ([[id:7d7f4486-fad7-4f0a-bd9a-775bd4cd8f7e][docs/specs/coverage-spec-implemented.org]]), +confirm F7 binds =cj/coverage-report= and lives alongside F4/F6 in the same +dev-fkeys module so the three keys read as one unit. No new coverage logic +here -- only the binding placement and a short comment block in the module +pointing at the coverage design doc. + +Acceptance: F7 invokes coverage-report; F4/F6/F7 are visibly grouped in one +module; coverage track is shipped before this lands. + +Depends on: the coverage-config track shipping; F4 and F6 sub-tasks above. + +*** 2026-05-15 Fri @ 19:16:08 -0500 Specification +Consolidate the developer F-key block into a coherent sequence. F5 reserved for debug (separate ticket). Format bindings move off F6 to C-; f. + +Menu mechanism: =completing-read= everywhere (consistent with F7 coverage scope prompt and with the vertico/consult workflow in the rest of the config). No transient definitions. + +**F4 — compile + run** + +- F4 (no modifier): completing-read with candidates filtered by project type. Detection via projectile-project-compilation-cmd and heuristic fallbacks (go.mod, Makefile, Eask, package.json, pyproject.toml, docker-compose.yml). + - Compiled project candidates: "Compile", "Run", "Compile + Run" (default), "Clean + Rebuild" + - Interpreted project candidates: "Run" only +- C-F4: fast path = Compile only. On interpreted projects, shows "not a compiled language" and no-ops. +- M-F4: fast path = Clean + Rebuild. Same "not applicable" behavior on interpreted projects. + +The dispatcher reads projectile's per-project compile/run/test commands. No Docker-specific logic in the command itself. Container workflows are configured via projectile's prompt-and-cache (or .dir-locals.el from the dev-project-setup helper). + +**F6 — run tests** + +- F6 (no modifier): completing-read top-level: + - "All tests" + - "Current file's tests" + - "Run a test..." (nested completing-read with individual tests) +- C-F6: fast path = "Current file's tests" +- M-F6: fast path = "Run a test..." + +"Current file's tests": if current buffer is a test file, run it directly. If source file, find matching test file(s) via language conventions (elisp: tests/test-<module>*.el; python: tests/test_<module>.py; etc.) and run them aggregated. + +"Run a test...": build a candidate list of individual tests, pre-select the last-chosen test for this buffer (buffer-local cj/--last-test-run), present via completing-read. Pressing RET re-runs last. Memory is buffer-local so different source files remember their own last-test. + +Candidate set for "Run a test...": +- If buffer is a test file: parse the file, return its test definitions. +- If buffer is a source file: find matching test file(s) and aggregate their test definitions. +- No matches: error out with "No tests found for <buffer>". Don't silently fall through. + +Per-language test discovery: +- Python, Go, TypeScript/JavaScript: tree-sitter queries (treesit-auto already configured, grammars auto-install) + - Python: (function_definition name: (identifier) @name (:match "^test_" @name)) + - Go: (function_declaration name: (identifier) @name (:match "^Test" @name)) + - TS/JS: (call_expression function: (identifier) @fn arguments: (arguments (string) @name) (:match "^\\(test\\|it\\)$" @fn)) + - Parsing unopened test files: use with-temp-buffer + insert-file-contents + python-ts-mode (etc.) + treesit-query-capture +- Elisp: built-in sexp navigation; scan for (ert-deftest <name> ...) forms. No tree-sitter needed. + +*F7 — coverage* (already designed in docs/specs/coverage-spec-implemented.org) + +**Required moves:** +- Move blacken-buffer (python), shfmt-buffer (sh), clang-format-buffer (c) off F6 to C-; f prefix (already the format-buffer prefix). +- Move projectile-run-project off F6 (folds into the new F4 completing-read). + +**Ordering:** +Do this after the coverage-config work ships. No churn mid-flight. +** DONE [#D] Evaluate and integrate Buttercup for behavior-driven integration tests :tests: +CLOSED: [2026-05-28 Thu] + +Evaluation landed at [[file:docs/design/buttercup-evaluation.org][docs/design/buttercup-evaluation.org]]. Verdict: not yet — ERT is enough for every project Craig owns today. Adopt Buttercup the moment a project crosses the threshold "the test reader is no longer the test author at write-time" (concrete trigger events listed in the doc). Re-read the doc when any such event fires. +** DONE [#A] f9 should toggle the entire ai-vterm split, not just the buffer +CLOSED: [2026-06-02 Tue] +F9 toggle-off now collapses the agent split (delete-window) instead of quit-restore-window, which went stale across multi-agent slot reuse and surfaced a different agent. Toggle-on reopens the exact agent that was hidden (cj/--ai-vterm-last-hidden-buffer). Sole-window toggle-off returns to the most-recent non-agent buffer. Split width preserved across the toggle. +** DONE [#C] Descriptive completing-read prompts :feature:ux: +CLOSED: [2026-06-02 Tue] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-02 +:END: +Reworded 17 picker prompts across 8 modules so each names the operation (C-f8 "Project:" → "Show agenda for project:", "F6:" → "Run tests:", the dwim-shell sub-prompts, both contact pickers, dirvish ediff, org finalize, and the custom-comments length/box-style prompts). Audited ~124 completing-read / read-* sites; the rest already named their operation. + +Audit every =completing-read= (and =read-*= picker) prompt in the config so the prompt names the operation about to happen, not just the kind of thing being chosen. The prompt is the only confirmation the user gets before committing to an action, so a generic one leaves a mis-keyed command ambiguous. + +Concrete trigger: C-f8 (project-filtered agenda) prompts just "Project". If Craig meant C-f9 (AI-vterm project picker) and hit C-f8 by accident, the bare "Project" prompt gives no signal which operation he's about to run — both pick a project, for different ends. + +Goal: each picker prompt makes the pending operation obvious, e.g. "Agenda for project: " vs "Open AI vterm for project: ". Sweep the call sites (grep =completing-read=, =read-directory-name=, =read-file-name=, =completing-read-multiple= across modules/), reword the ambiguous ones, keep the wording short. + +Filed 2026-06-02 from a C-f8/C-f9 mix-up. Priority set [#C] (UX polish) — re-grade if it deserves higher. +** CANCELLED [#C] Finish terminal GPG pinentry configuration :feature: +CLOSED: [2026-06-02 Tue] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-02 +:END: + +Superseded by "Terminal GPG pinentry Completion" below. That task's 2026-05-27 audit found the =terminal-pinentry= branch is gone (no local/remote ref, no reflog, no stash, no worktree), so the work restarts from main and is tracked there. Consolidated 2026-06-02. + +Continue work on terminal-mode GPG passphrase prompts (loopback mode). +Branch: terminal-pinentry + +Changes in progress (modules/auth-config.el): +- Use epa-pinentry-mode 'loopback in terminal +- Use external pinentry (pinentry-dmenu) in GUI +- Requires env-terminal-p from host-environment module +** DONE [#B] Emacs Manual Testing and Validation :verify: +CLOSED: [2026-06-06 Sat 13:59] SCHEDULED: <2026-05-29 Fri> +:PROPERTIES: +:LAST_REVIEWED: 2026-05-28 +:END: + +Hand-verify checklist Craig walks one item at a time after the relevant code lands. Each child names what is being verified, the exact steps to run, and the observable expected result. On pass, the child gets marked or deleted. On fail, the actual behavior gets logged under the step and the child is promoted to a top-level =TODO= bug per the verification.md handoff rule. + +Walk started 2026-05-28 (tests 1 + 2 verified — surfaced two Signel bugs along the way, both fixed before continuing). Deferred to 2026-05-29: test 3 onward needs sending an actual Signal message, too late at night to be polite about it. 2026-06-11: Craig confirmed the send half (contact send + Note-to-Self delivery) — closed as a dated entry below. Still unwalked: input-survives-incoming, dashboard, stop-teardown, refresh, font-setup-post-TTY, and the non-Signel capture/calibredb/nov children. + +*** Project-aware capture: C-c c t files into the project's Open Work +What we're verifying: inside a projectile project that has a root todo.org, C-c c t (Task) files the new entry under that project's "<Project> Open Work" heading. +- Open a file inside a projectile project whose root has a todo.org (e.g. this one, ~/.emacs.d). +- Press C-c c, then t. +- Type a short task, finish with C-c C-c. +Expected: the entry lands as a new level-2 TODO at the top of that project's "... Open Work" heading (e.g. "Emacs Open Work"), not in the global inbox. + +*** Project-aware capture: C-c c b files a [#C] bug +What we're verifying: C-c c b (Bug) behaves like the Task capture but stamps the entry [#C]. +- Inside the same project, press C-c c, then b. +- Type a short bug description, finish with C-c C-c. +Expected: a level-2 "TODO [#C]" entry lands at the top of the project's "... Open Work" heading. + +*** Nov bookmark naming: "Author, Title" instead of the raw filename +What we're verifying: bookmarking your place in an EPUB names the bookmark "Author, Title" parsed from the filename (Calibre's "<Title> - <Author>.epub"), reordered with the colon restored — not the raw filename. +- Open an EPUB in nov (m is bound to bookmark-set there). +- Press m to set a bookmark. +- Look at the default name in the bookmark prompt. +Expected: the default is "<Author>, <Title>" (e.g. "Agatha Christie, The A.B.C. Murders"; a colon where the filename had "_ "), no extension, no underscores — not the raw filename. + +*** Calibredb curated menu on ? and full dispatch on H +What we're verifying: in the calibredb buffer, ? opens the curated workflow menu and H opens calibredb's full dispatch. +- M-B to open calibredb. +- Press ?. +- Press a key for a workflow (e.g. o to open, f format filter), or q to quit the menu. +- Press H. +Expected: ? shows the curated transient (Library / Filter / Sort / Book columns with your workflows); the keys run the right calibredb commands; q quits. H shows calibredb's full menu. + +*** Calibredb description docks to the bottom 30% +What we're verifying: viewing a book's description docks it to the bottom 30% and q dismisses it. +- M-B, move to a book. +- Press ? then d (or v). +- Read the description. +- Press q. +Expected: the *calibredb-entry* detail buffer opens docked across the bottom ~30% of the frame (not full-window); q closes it and returns to the list. + +*** Project-aware capture: inbox fallback + warning +What we're verifying: outside a project (or in a project with no todo.org) the capture falls back to the global inbox; the no-todo.org case also warns. +- Open a scratch file not inside any projectile project, C-c c t, type a task, C-c C-c. Expect it under "Inbox" in the global inbox file. +- (If easy) open a file in a projectile project that has NO todo.org, C-c c t. Expect it in the global inbox AND an echo-area message naming the project. + +*** 2026-05-28 Thu @ 02:13:55 -0500 Verified: connect starts the daemon (after fix) +=C-; M SPC= → "Signel connected." in echo area; =M-x list-processes= shows =signal-rpc= running (PID 1775279, command =/usr/bin/signal-cli -a +1510...=). Two bugs surfaced and fixed during the verify: +- The =with-eval-after-load 'keybindings= binding at =signal-config.el:280= didn't take effect on a fresh Emacs restart; a live-reload of =signal-config.el= activated the =C-; M= prefix. Logged as a separate top-level TODO for follow-up (load-order or use-package interaction). +- =cj/signel--ensure-started= referenced =signel--process-name= before signel had been autoloaded — the bare forward-declared =(defvar signel--process-name)= didn't actually bind the variable. Fix: added =(require 'signel)= at the top of the function (=signal-config.el:170=) so the package loads before any of its private variables are read. New ERT test =test-signal-config-ensure-started-requires-signel= captures the bug. + +*** 2026-05-28 Thu @ 02:16:45 -0500 Verified: picker opens with contact names +=C-; M m= → minibuffer opened within ~1s, "Note to Self" pinned at the top, the 94 Signal contacts followed labeled "Name (+number)". Picker behavior matches spec. Surfaced a follow-up on the chat buffer that opens after a pick — placement + exit keys want refining; filed under L44 Signel. + +*** 2026-06-11 Thu @ 09:30:11 -0500 Verified: send delivery (contact send + Note-to-Self) +Craig walked the send half by hand and confirmed it 2026-06-11: a picked contact's chat buffer sends through =signel--send-input= and the message arrives on the recipient's phone; Note-to-Self (=C-; M s= and the picker's pinned entry) resolves to =signel-account= and lands in the phone's *Note to Self* thread. Same session, the receive/RPC side was re-verified live in the daemon: =listContacts= round-trip returned 93 contacts, =*signel-stderr*= empty, =C-; M= prefix bound. + +*** Signel: typed input survives an incoming message +What we're verifying: the clobber fix (fork commit 5ec56c0) preserves in-progress prompt input across =signel--insert-msg= when a message arrives mid-typing. +- =C-; M m=, pick a contact. +- Type a long unsent message at the prompt, do NOT press =RET=. +- From a second device or by asking someone, send yourself a Signal message that lands in this chat (or any active chat). +Expected: the incoming message renders above the prompt, the prompt redraws, and your typed text is still there at the prompt ready to send. + +*** Signel: dashboard opens +What we're verifying: =signel-dashboard= (=C-; M d=) opens the active-chats dashboard. +- Press =C-; M d=. +Expected: a dashboard buffer opens listing active chats. + +*** Signel: stop tears down the daemon +What we're verifying: =signel-stop= (=C-; M q=) deletes the process and clears the request-handler / buffer maps (the reconnect-invalidation contract from fork commit 4740d97). +- Press =C-; M q=. +- =M-x list-processes=. +Expected: echo area shows "Signel service stopped.", and =list-processes= no longer lists =signal-rpc=. + +*** Signel: refresh forces a fresh contact fetch +What we're verifying: =cj/signel-refresh-contacts= clears the cache and re-fetches via the new callback contract. +- =C-; M SPC= to reconnect if you ran the stop test above. +- =M-x cj/signel-refresh-contacts=. +- Immediately =C-; M m=. +Expected: the picker still opens cleanly with the same contact list (the refresh is silent; the picker is the visible check). If you added a contact on the phone, it now appears. + +*** Font setup reaches a GUI frame created after a TTY frame (daemon) +What we're verifying: emoji glyphs + fonts apply in a GUI frame even when the first daemon frame was a TTY. +- emacs --daemon +- emacsclient -t (TTY frame first) +- emacsclient -c (then a GUI frame) +- in the GUI frame, open a buffer with an emoji and check it renders, and M-S-f / fonts look right +Expected: emoji renders and fonts are applied in the GUI frame. + +*** ghostel migration: Claude Code TUI in a GUI frame +What we're verifying: an agent runs in ghostel with good rendering (the reason for the engine swap). +- restart Emacs (the migration changes load order + a use-package :config block) +- in a GUI frame press F9, pick a project, let Claude stream a long response (big diff or file read) +Expected: colors look right (not washed out), no flicker/strobing during the stream, box-drawing and the cursor render correctly. + +*** ghostel migration: Claude Code TUI in a TTY frame (replaces the old refuse test) +What we're verifying: D4 dropped the GUI-only guard, so F9 now launches in a terminal frame too. +- emacsclient -t (TTY frame, off the running daemon) +- in the TTY frame press F9 and pick a project +Expected: the agent launches and renders as text + color in the TTY (no echo-area refusal message); inline images are absent, which is expected. + +*** ghostel migration: F9 / C-F9 / M-F9 dispatch +What we're verifying: the agent dispatch behaves as it did on vterm. +- F9 toggles the agent window off/on; C-F9 always opens the project picker; M-F9 closes (kills the tmux session) after confirm +- press F9 from inside an agent buffer (full-frame) — it should toggle, not get swallowed by the terminal +Expected: each chord does its job from both normal and agent buffers. + +*** ghostel migration: tmux integration + C-; x menu +What we're verifying: the tmux machinery ported intact. +- launch an agent; M-x list it — runs in tmux session aiv-<project> +- second F9 on the same project reattaches (no duplicate session) +- C-; x h captures the tmux pane history into an Emacs buffer; C-; x c enters tmux copy-mode +- C-; x l clears scrollback; C-; x n / p navigate prompts +Expected: all menu commands work against the ghostel buffer; history capture + copy-mode behave as before. + +*** ghostel migration: copy-mode parity + mouse wheel +What we're verifying: copy/selection and wheel scrolling survived the engine swap. +- in a ghostel buffer enter copy-mode (C-; x c without tmux, or the tmux path with tmux); M-w copies and stays; q / C-g exit +- mouse-wheel scroll inside tmux, inside Claude Code, and inside lazygit +Expected: M-w copies without leaving; q/C-g exit; the wheel scrolls the program (this replaces the removed vterm wheel-forwarding — confirm ghostel's native SGR mouse covers it). + +*** ghostel migration: other TUIs + ssh +What we're verifying: general terminal workloads render. +- run lazygit, htop/btop, a heavy-output build, and ssh to a remote host in a ghostel terminal (F12) +Expected: each renders and behaves correctly; ssh out works (if a remote lacks xterm-ghostty terminfo, note it — ghostel-ssh-install-terminfo / ghostel-term is the lever). + +*** ghostel migration: F12 general terminal + dashboard launcher +What we're verifying: F12 manages non-agent terminals only, and the dashboard launcher uses ghostel. +- F12 opens/toggles a general terminal; confirm it does NOT grab an agent buffer; resize it, toggle off and on — geometry is preserved +- from the dashboard press t (Terminal) — opens a ghostel terminal (tooltip reads "Launch Terminal") +Expected: F12 excludes agent buffers and keeps saved geometry; the dashboard launches ghostel. + +*** ghostel migration: crash recovery +What we're verifying: the aiv- tmux session survives an Emacs crash and reattaches. +- with a live agent, kill Emacs (not the tmux session); restart Emacs; F9 → project picker +Expected: the project shows "[detached]" and reattaches to the surviving tmux session. +** DONE [#B] Color-family grouping for hue-adjacent warm colors :feature:theme-studio:research: +CLOSED: [2026-06-10 Wed] +Resolved by two independent reviews of =~/color-sorting.org= (=~/color-sorting-codex.org=, =~/color-sorting-fable.org=, Fable's harness at =~/working/color-sorting-fable/=). Both converged on lightness-conditioned complete-linkage clustering + a floored neutral threshold; implemented in commit =04b82bbe= (replacing the hue anchors). Measured F1 0.63→0.96 on the real palette: gold and olive separate, red/blue ramps stay whole, intense-red isolates, all grays/steels consolidate, and the gray+1/gray+2/white neutral-leak bugs are fixed. The only residual (pale yellow+2 lands on the olive ramp) is geometrically irreducible from the hex — see the hint-override task below. +** DONE [#B] theme-studio comprehensive previews (org/magit/elfeed/ghostel/mu4e/dashboard) :feature:theme:theme-studio: +CLOSED: [2026-06-08 Mon] +Expanded the bespoke previews to near-complete face coverage and added three new ones. org now exercises 83/88 faces (document + agenda; the 5 skipped are non-visual: org-hide, org-indent, org-clock-overlay, org-default, org-date-selected). magit 97/98 (status buffer + blame/reflog/sequence/bisect/signature sampler rows). elfeed 13/13. New bespoke previews: ghostel 19/19 (mock terminal, 16 ANSI colors + default + fake cursor), mu4e 37/37 (curated face list, not in the generated inventory; headers list + message view + compose), dashboard 8/8. So clicking a face row flashes a real preview element for nearly every face. Originally filed as just the org preview. +** DONE [#A] theme-studio theme.json -> dupre-*.el converter :feature:theme:theme-studio: +CLOSED: [2026-06-08 Mon] +Built as scripts/theme-studio/build-theme.el (sibling to build-inventory.el), emitting a single self-contained themes/<name>-theme.el deftheme (not the palette/faces/theme trio — a theme.json carries resolved per-face hex, not dupre's semantic layer). All four tiers convert: default from assignments.bg/.p, syntax categories -> font-lock/tree-sitter faces with bold/italic sets, UI passthrough, packages with :inherit/:height/weight/slant. 20 ERT tests in tests/test-build-theme.el (Normal/Boundary/Error + an end-to-end load + a WCAG-AA assertion on the round-tripped result). One mapping limitation documented: the dec (decorator) key has no independent Emacs face (Emacs renders decorators with font-lock-type-face, which ty owns), so dec is omitted and decorators follow the type color. + +The last link in the pipeline: turn a theme.json exported by the theme-studio into a real loadable Emacs theme. Elisp (per Craig), TDD — this is the correctness-sensitive piece. + +Inputs (all on disk; no chat history needed): +- theme.json contract: =scripts/theme-studio/README.md= (theme.json section) and =docs/specs/theme-studio-package-faces-spec-doing.org= (State and export policy, Relative height, Inheritance). +- Reference face layout: existing =themes/dupre-palette.el= + =themes/dupre-faces.el= + =themes/dupre-theme.el=, and =tests/test-dupre-theme.el= (WCAG-contrast helper to reuse). +- Conventions: =.claude/rules/elisp.md=, =.claude/rules/elisp-testing.md=. + +Scope: +1. Read theme.json. Set =default= from =assignments.bg= / =assignments.p=. +2. Author the syntax category -> font-lock face map (~21 keys: kw->font-lock-keyword-face, str->font-lock-string-face, fnd->font-lock-function-name-face, fnc->font-lock-function-call-face, op->font-lock-operator-face, punc->font-lock-punctuation-face, etc. incl. the Emacs-29 tree-sitter additions). Apply =bold= / =italic= sets. +3. UI faces: the =ui= keys are already real face names (region, cursor, mode-line, ...) -> near 1:1 passthrough of fg/bg. +4. Package faces: =packages= -> each face spec, writing =:inherit PARENT= for inherited faces + only the overridden attrs, =:height= when != 1.0, weight/slant. +5. Emit a deftheme file (or palette+faces+theme trio mirroring dupre's layout). + +TDD targets: old-JSON (no packages) loads; every category maps; round-trip of fg/bg/bold/italic/inherit/height into valid face specs; WCAG-contrast assertion on the result. Decide whether the converter lives under =scripts/theme-studio/= (emits to =themes/=) or =themes/=. +** DONE [#B] theme-studio tier-3 package faces :feature:theme:theme-studio: +CLOSED: [2026-06-08 Mon] +Package-specific face editing in the theme-studio: org/magit/elfeed bespoke (complete face tables + live previews) plus a generated all-package inventory so every installed package is themeable. Spec is Ready, all opens resolved: [[id:8f37a1fd-cfd3-4b25-92e5-772468092bdc][docs/specs/theme-studio-package-faces-spec-doing.org]]. Phases below run in dependency order; phases 1-5 deliver the three high-value apps, phase 6 opens the long tail, phase 7 documents. The =theme.json= -> =dupre-*.el= converter (Elisp) is a separate downstream task. + +*** 2026-06-08 Mon @ 00:17:41 -0500 Phase 1 — package state + schema landed +Added =APPS= (org starter) and =PKGMAP= ({app:{face:{fg,bg,bold,italic,inherit,height,source}}}), pure helpers (=seedPkgmap= / =packagesForExport= / =mergePackagesInto=), and wired export/import for the =packages= key with old-JSON compat. The =height= float (relative size, read off the face not cascaded through inherit) and the fixed-pitch inherits are seeded in the org starter. No UI yet (Phase 3). Verified: node-check, plus a guarded =#selftest= harness (headless Chrome) confirming seed->export->import round-trip, old-JSON merge, and inherit/height/source survival — all PASS. + +*** 2026-06-08 Mon @ 02:16:24 -0500 Phase 2 — curated app data (org/magit/elfeed) landed +Filled =APPS= with the complete own-defface sets built from embedded face-name lists + a curated seed-color map: org 88 (85 seeded, incl. org-agenda, heading heights, fixed-pitch inherits), magit 98 (64 seeded), elfeed 13 (all seeded). Long-tail faces seed to default fg. Verified: 199 faces total, no seed typos / no dupes, schema self-test PASS seeding all of them. Seeded-default aesthetics still go to Manual testing once the Phase 3 UI lands. + +*** 2026-06-08 Mon @ 02:23:56 -0500 Phase 3 — package face table UI landed +Added the "package faces" section: app selector (org/magit/elfeed), per-app face table with fg/bg dropdowns, bold/italic toggles, inherit dropdown (base faces + the app's own faces), relative-height stepper, live contrast readout on the effective (inherit-resolved) color, per-face and per-app reset, and a text filter. Refactored the fg/bg dropdown into a shared =colorDropdown= helper the ui-faces table now also uses (no =uiSelect= fork). Palette edits propagate to package faces; import/export carry them. Right pane is the generic preview (face names in their own resolved colors) until the bespoke org/magit/elfeed previews land (phases 4-5). Verified: node, headless screenshot, schema self-test PASS. + +*** 2026-06-08 Mon @ 02:27:51 -0500 Phase 4 — org preview landed +Added =renderOrgPreview()=: a mock org document painted live from the org package faces (title, headings with heights, TODO/DONE, tag, scheduled date, property drawer, inline code/verbatim, link, checkbox, quote, src block, header-row table). The preview pane dispatches on the app's preview key; org-mode gets this, others keep the generic list. Verified: node, headless screenshot, self-test PASS. + +*** 2026-06-08 Mon @ 02:30:42 -0500 Phase 5 — magit + elfeed previews landed +Bespoke =renderMagitPreview()= (status buffer: head/branches, untracked, a diff hunk with context/added/removed, recent commits with hashes/authors/keyword/tag) and =renderElfeedPreview()= (search list: filter, dated entries with feed/unread-title/read-title/tags, log lines by level). The preview label now names the app and notes generic vs bespoke. Verified: node, headless screenshots, self-test PASS. + +*** 2026-06-08 Mon @ 02:32:44 -0500 Phase 6 — generated all-package inventory landed +=build-inventory.el= (loaded into a running Emacs) groups every installed package's faces by the defining package and writes =package-inventory.json=. =generate.py= embeds it and merges each package into the dropdown as an editable generic app, leaving org/magit/elfeed bespoke. 40 apps now (3 bespoke + 37 inventory, 643 faces). Committed data artifact, refreshed by reloading the .el; never browser-side discovery. Verified: node, self-test PASS, app count + bespoke-preserved checks. + +*** 2026-06-08 Mon @ 02:34:01 -0500 Phase 7 — docs landed +Rewrote =README.md= for the full tool: three face tiers + palette, the in-page picker (with the AA/AAA mask), package faces (bespoke vs generic previews), modeled inheritance + relative height (family stays in font-config.el), the packages schema with inherit/height/source, export-vs-save, and the inventory-refresh command (=build-inventory.el=) + its loaded-config dependency. Notes =theme-studio.html= is generated. Test-surface fixtures tracked separately below. + +*** 2026-06-08 Mon @ 02:40:00 -0500 theme-studio tier 3 — test surface landed +Extended the guarded =#selftest= harness (headless Chrome) to assert the acceptance criteria against the real emitted code: old-JSON import (no =packages=), full round-trip (fg/bg/bold/italic/inherit/height/source), cleared-state export, unknown-package/face preservation, and inheritance-cycle termination — all PASS. The two DOM-coupled regressions are handled structurally: =updateColor= remaps =PKGMAP= on a palette-color edit, and =PKGMAP= stores hexes so a deleted palette color leaves package refs in the "(gone)" recoverable state. =generate.py= rebuilds =theme-studio.html= each run. +** DONE [#B] theme-studio perceptual color metrics :feature:theme:theme-studio: +CLOSED: [2026-06-08 Mon] +Spec (Ready, opens confirmed 2026-06-08): [[id:15db8ae3-fc14-49f3-9ed5-d5ff59790904][docs/specs/theme-studio-perceptual-color-metrics-spec-implemented.org]]. OKLCH model + perceptual-L/APCA readouts + pairwise ΔE, for building low-contrast themes by metric rather than by eye. All five phases shipped 2026-06-08 (commits 49342bf5, 78260018, 77c7f126, 163d3730, 22605426, 582d8a6a): colormath.js core inlined + WCAG/HSV helpers migrated; picker OKLCH/APCA readouts; palette ΔE warnings; OKLCH edit-model dials; C×L gamut plane. 17 Node tests (colormath 100/93.75/100), six browser hash gates green, inline-integrity guard. vNext deferrals (low-contrast preset, CIEDE2000) remain the two [#D] tasks below. Manual eyeballs tracked under Manual testing. +*** 2026-06-08 Mon @ 19:43:50 -0500 Color-math foundation + Node tests landed +Pure color core in =scripts/theme-studio/colormath.js= (OKLab/OKLCH, APCA-W3 0.1.9 exact constants, ΔE-OK, binary-search gamut clamp returning ={hex,clamped}=) shipped in 49342bf5; this phase finished the integration in 78260018. =generate.py= now inlines the colormath.js body into the page script (export-stripped, =COLORMATH_J= placeholder), and the page's lin/rl/contrast/rating/hsv2rgb/rgb2hsv/hex2rgb/rgb2hex copies moved into the module — =rl= reuses the canonical =lin= (0.04045 cutoff), byte-identical to the old 0.03928 form on every #rrggbb (no 8-bit channel falls between the cutoffs; verified over 200k pairs, zero contrast change). =test-colormath.mjs= gained Normal/Boundary/Error cases for the migrated helpers, a seeded hsv-rgb round-trip property test, and an inline-integrity check that the generated page carries the module body verbatim. Gate met: =node --test scripts/theme-studio/*.mjs= 15 pass, colormath.js 100% line / 93.75% branch / 100% func; =node --check= on the spliced script clean; =#selftest= + =#cursortest= PASS in headless Chrome. NOTE: =node --test <dir>= directory-globbing is broken on Node v26 (tries to load the dir as a module) — use the =*.mjs= glob form. +*** 2026-06-08 Mon @ 19:55:53 -0500 Picker OKLCH/APCA readouts landed +Phase 2 shipped in 77c7f126. Second readout row (=.pinfo2=) under the WCAG ratio: OKLCH L/C/H + signed APCA Lc against the ground color, always shown; sign convention in the APCA tooltip + README. Tables unchanged (APCA picker-only per Agreed-decision #3). =pkReadout= drives the spans from the inlined colormath functions. Gate met: =#readouttest= asserts the spans match the live computation AND the known dupre-blue OKLCH reference (L 0.591 / C 0.052 / H 252°, APCA Lc -34 on ground) with WCAG unchanged; =#selftest= + =#cursortest= still PASS; 15 Node tests green. Headless-rendered values verified against a node cross-check. Visual eyeball is the open "Perceptual readouts read well in the picker" item under Manual testing. +*** 2026-06-08 Mon @ 20:44:39 -0500 Palette ΔE warnings landed +Phase 3 shipped in 163d3730. =renderPalette= runs a pairwise OKLab ΔE over PALETTE via the pure =paletteDeltas()= (one pass → sub-threshold pairs + per-color nearest distance); warns on pairs below the named =DELTAE_MIN= (0.02), sorted closest-first, capped at 5 with "and N more"; each chip's tooltip gains its nearest-neighbor ΔE. Names go through =esc= before the warning markup. Gate met: =#deltatest= PASS (near pair fires + names itself; spread palette quiet; 7-color cluster caps at 5 ascending + overflow suffix). #readouttest/#selftest/#cursortest + 15 Node tests still green. Screenshot-verified the warning render (terracotta "too-similar colors" header + "blue / blue2 — ΔE 0.007, hard to distinguish", placed between palette and add-color controls). Pushed below. +*** 2026-06-08 Mon @ 21:05:28 -0500 OKLCH sliders + color-model control landed +Phase 4a shipped in 22605426. Picker gains an edit-model toggle (HSV/OKLCH) in its own =pkModel= state, orthogonal to =pkMode= (AA/AAA mask) — separate handlers, distinct toggle colors (blue vs gold). OKLCH mode shows L/C/H as paired range+number inputs driving =oklch2hex= → hex/swatch/readouts/HSV-cursor; out-of-gamut chroma snaps the dials to the reachable color + shows "chroma clamped to sRGB". HSV stays default; SV square still edits HSV (C×L plane is 4b); SV drag in OKLCH mode refreshes the dials. =openPicker= re-asserts the model via =setPkModel= so the toggle highlight can't drift (caught on screenshot). Gate met: =#oklchtest= PASS (color preserved on model switch; mask toggle leaves pkModel; model switch leaves pkMode; dials drive color to a known OKLCH target; out-of-gamut C raises clamp status). All 5 browser gates + 15 Node tests green; screenshot-verified the dials + toggle highlight. +*** 2026-06-08 Mon @ 21:41:49 -0500 Chroma×Lightness plane landed +Phase 4b shipped in 582d8a6a. OKLCH mode renders the SV square as a C(x)×L(y) plane at the current hue; crosshair maps to (C,L), hue strip selects H. Out-of-gamut region greyed (#15120f), AA/AAA contrast mask overlays the reachable colors. Per-cell gamut test is forward-only (=oklch2oklab=→=oklab2lrgb=→=inGamut=), never the binary search (that stays in =oklch2hex= for committing). colormath.js exports =oklab2lrgb=/=inGamut=/=lrgb2hex= with direct Node tests (one pins inGamut to oklch2hex's clamped flag). Bitmap cached on (hue+dims+mask+bg) so C/L drags reuse it; hue drags ride browser pointermove-to-frame coalescing (synchronous render measured ~7ms math/5600 cells — no explicit rAF defer; flagged if jank appears). HSV path untouched. Gate met: =#planetest= (crosshair at C/L; OOG cell grey; in-gamut cell colored). Screenshot-verified the plane (gamut-boundary shape, crosshair at C=0 for grey). NOTE for Craig: OKLCH_CMAX=0.4 matches the C dial domain, so much of the plane is gamut-grey at low-chroma hues — a tighter max fills more area but desyncs the crosshair scale from the dial; your eyeball call. +*** 2026-06-08 Mon @ 21:41:49 -0500 Test surface green across the feature +Final state: 17 Node unit tests (colormath.js 100% line / 93.75% branch / 100% func), six browser hash gates (=#cursortest=/=#readouttest=/=#deltatest=/=#oklchtest=/=#planetest=/=#selftest=), inline-integrity check, =node --check= on the spliced page, README updated. All green. NOTE: =node --test <dir>= directory-globbing is broken on Node v26 — use =node --test scripts/theme-studio/*.mjs=. +** DONE [#B] theme-studio refactor — extract app from generate.py :feature:theme-studio:refactor: +CLOSED: [2026-06-09 Tue] +Examined 2026-06-09. generate.py is 1378 lines, ~1300 of them a single triple-quoted string holding the whole app (CSS + HTML + ~1000+ lines of JS). That string is the root of every refactor here: the app logic can't be unit-tested (only =colormath.js= is, because it is the one extracted module); backslash-doubling in the string caused real bugs this session (the multi-line export strip, the =#deltatest= regex); and there is no lint, highlight, or brace-check until Chrome runs it. The rest of the directory is healthy: =colormath.js= (pure, 100/96 tested) and =build-theme.el= (13 small functions) are the model. + +Run the whole set in NO-APPROVALS mode: TDD per stage (characterization hash tests before each behavior-preserving move; node unit tests as extraction makes logic importable), commit + push at each green stage. Tooling committed at c7518d6f before starting. Order: + +DONE (2026-06-09): Stages 1-5 + 7 landed and pushed (origin/main tip dd90eca9); Stage 6 deliberately skipped (optional, works today). generate.py went 1378→~500 lines; the app now lives in real files (styles.css, app.js, app-core.js) inlined at generate time. The escaping-bug class is gone (str.replace is literal), the dedup is done (unified dropdowns/sort/clear-unlocked, shared crHtml/mkStyleButtons/effFg helpers), and the pure app logic is unit-tested (app-core.js, 18 node tests). Three new permanent gates added along the way: =#locktest=, =#sorttest=, and the app-core integrity + node suite. =make theme-studio-test= = 13 python + 43 node + spliced-check + 8 hash gates, all green. +*** 2026-06-09 Tue @ 05:01:11 -0500 Stage 1 — #locktest net + extracted styles.css/app.js +Added the =#locktest= browser gate first (commit d04f44dd): it pins, across all three tiers, that mkLockCell disables a row's control (syntax swatch div via data-locked, UI select via .disabled) and that clear-unlocked wipes unlocked rows while skipping locked ones. Proved it goes red when a lock guard is removed. + +Then extracted the =<style>= block to =styles.css= and the =<script>= body to =app.js= (commit eaf16904), inlined by =generate.py= through STYLES_CSS / APP_JS placeholders the same way =colormath.js= is. Used =ast= to pull the resolved string value so the escapes (single vs doubled backslashes) survive the move — the generated page is byte-identical to before. =generate.py= dropped 1378 → ~500 lines (the remaining bulk is the package face-data dicts; Stage 6 may data-file those). Two integrity tests guard the splice: styles.css inlines verbatim, app.js reaches the page as =fill_data= renders it; both go red if the wiring is dropped. + +Gate green: 12 python templating tests, 25 node tests, spliced-script =node --check=, all 7 hash gates. =node --check app.js= passes standalone (placeholders are valid JS identifiers). The escaping-bug class is gone — =str.replace= is literal, so the JS no longer lives inside a Python string. +*** 2026-06-09 Tue @ 05:07:10 -0500 Stage 2 — unified color dropdowns on the swatch picker +Deleted native =colorDropdown=; routed UI + package fg/bg through =mkColorDropdown= so all three tiers show real swatches (commit aee14bff). The inherit column stays a select — it picks a face name, not a color. Pulled the option-list build into a shared =ddList= helper (default + palette + "(gone)" entry), replacing the inline copy in the syntax table. Preserved value-based sort: the swatch dropdown now exposes =data-val= and =cellVal= reads it. Updated =#locktest='s UI assertion to the div lock path (data-locked). Verified via headless DOM: legbody 21 cdd / 0 select, uibody 40 cdd / 0 select, pkgbody 176 cdd + 88 inherit selects. All gates green. +*** 2026-06-09 Tue @ 05:12:00 -0500 Stage 3 — extracted crHtml + mkStyleButtons +Extracted =crHtml(r)= (the contrast→ratingColor→rating span, was copy-pasted at 5 sites; now syntax/UI/pkg cells share it — the picker readout renders differently and stays) and =mkStyleButtons(isOn,onToggle)= (the B/I/U/S loop, was near-identical in the UI + pkg tables; returns the button list for mkLockCell). Commit 62b53bc5. + +Deliberately NOT done: the syntax bold/italic buttons (2 buttons, BOLD/ITALIC dicts, in-place refresh closure — poor fit for the same helper), and a shared row scaffold (the three tables differ enough in columns/order that one would leak — premature abstraction). Node-unit-testing the pure pieces deferred to Stage 7, where app.js is made importable. + +Verified behavior-preserving by diffing the runtime-rendered DOM (Stage 2 page vs Stage 3 page in headless Chrome): the only differences are inside the inline =<script>= source, never a built tr/td/button/span — the tables build identically. All hash gates + node + python green. +*** 2026-06-09 Tue @ 05:16:33 -0500 Stage 4 — unified syntax table onto the shared sort +Deleted =srt= + =D{}= (the syntax table's own sort); pointed its headers at =srtTable('legbody',col)= so all three tables share =srtTable=/=cellVal=/=applyTableSort= (commit d947944b). Mapping is exact: the legtable color cell is a swatch dropdown whose =data-val= is the hex (what =srt= sorted on via MAP[kind]); elements cell is text; first-click stays ascending. Syntax sorts on click only — it doesn't opt into the cross-rebuild persistence the UI/pkg tables get, preserving its prior behavior. Added a =#sorttest= gate (sort was untested): syntax sorts by color asc, reverses on re-click, sorts by element name; UI + pkg still sort. asc/desc pair is self-validating. +*** 2026-06-09 Tue @ 05:20:22 -0500 Stage 5 — parameterized clear-unlocked + added effFg/effBg +Collapsed the three clear-unlocked functions into =clearUnlockedRows(items,keyFn,resetFn)= (keyFn returns a row's lock key or null to skip; resetFn does the tier-specific clear) — #locktest already guards clear-unlocked-skips-locked per tier. Replaced the 9x =||MAP['p']= / =||MAP['bg']= effective-fg/bg fallback with =effFg(v)=/=effBg(v)= across syntax/UI/pkg render paths (commit 89d079fe). Behavior-preserving: rendered DOM (script stripped) byte-identical; all gates green. Node-unit-testing the pure pieces (effFg/effBg, clearUnlockedRows) deferred to Stage 7 with the rest of the importable-app-logic suite. +*** 2026-06-09 Tue @ 06:03:04 -0500 Stage 6 — skipped (optional, deferred) +Left undone deliberately. Grouping the free module-level state into a state object is churn with no functional gain (works today), and data-filing the inline face dicts is a generate.py size win unrelated to the refactor's goal (testable logic), which Stage 7 already achieved. Can be revived from this entry + the original plan if the generate.py face dicts ever need to become data. Not blocking anything. +*** 2026-06-09 Tue @ 06:03:04 -0500 Stage 7 — extracted app-core.js + unit-tested the app logic +The coverage payoff. Pulled the pure package-face model + dropdown option list into app-core.js (nameToHex, buildPkgmap, packagesForExport, mergePackagesInto, effResolve, optList — every dep a parameter, no DOM/globals), inlined like colormath.js (strip + placeholder + integrity). app.js keeps thin wrappers (pname/seedPkgmap/ddList/pkgEffFg/pkgEffBg) passing live PALETTE/APPS/PKGMAP, so no call site changed and the built DOM is byte-identical. Added test-app-core.mjs: 18 Normal/Boundary/Error tests (name resolution, seed/export/merge round trip, inherit chain incl. a cycle terminating at null, "(gone)" entry) + inline-integrity. Node suite 25→43; python +1 integrity. Commit dd90eca9. GOTCHA found+fixed pre-commit: a code comment that contained the literal token "APP_CORE_J" got inlined by str.replace too (placeholder tokens must not appear in prose that gets templated). +** DONE [#C] M-F9 ai-vterm close removes the window split :quick:solo: +CLOSED: [2026-06-06 Sat] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-02 +:END: +Closing the ai-vterm with M-F9 while its window is in a split deletes the split too (the sibling window goes away) instead of just closing the vterm and leaving the rest of the layout intact. + +*** 2026-06-02 Tue @ 14:12:48 -0500 Audit: still a bug, distinct from the F9 collapse +The F9 toggle-off rework (38dad92) made F9 collapse the split by design, but that's the toggle path. This is M-F9 close (kills the agent process): close should leave the surrounding layout intact, not delete the sibling window. Craig confirmed it's still a bug. cj/--ai-vterm-close-buffer still calls delete-window. + +*** 2026-06-06 Sat @ 18:18:17 -0500 Fixed: close swaps the window to a non-agent buffer instead of deleting it +=cj/--ai-term-close-buffer= no longer calls =delete-window=; it swaps the agent's window to the working buffer (=cj/--ai-term-most-recent-non-agent-buffer=), then kills the agent buffer, so the split survives. F9 hide still collapses the split by design; close no longer does. Regression test =test-ai-term--close-buffer-keeps-window-split=. Commit =1a097b7e=. +** DONE [#B] theme-studio live-preview bevel thinner than Emacs :bug:theme-studio: +CLOSED: [2026-06-10 Wed] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-10 +:END: +Craig confirmed the bevel reads right 2026-06-10 after the reliefColors port (commit bb2aed2f). + +The mode-line box (3D released-button bevel) in the live buffer preview renders slimmer than the bevel Emacs actually draws. Make them match. The bevel comes from =boxCss= in app.js (~line 307), currently =inset 1px 1px 0 #ffffff33,inset -1px -1px 0 #00000066= for the released style — a 1px inset with faint translucent highlight/shadow. Emacs's released-button box is wider/stronger (it shades the highlight and shadow from the actual background color, not a flat translucent white/black). Fix: widen the bevel and derive the highlight/shadow from the box's background so it reads like Emacs. Verify side-by-side against a real Emacs mode-line. +*** 2026-06-10 Wed @ 15:22:48 -0500 Ported Emacs's relief algorithm into boxCss +Implemented =reliefColors= in colormath.js as a direct port of Emacs 30's =x_alloc_lighter_color= (xterm.c): highlight = bg x1.2 (delta 0x8000), shadow = bg x0.6 (delta 0x4000), an additive dark boost below brightness 48000/65535, and the same-color fallback (pure-black shadow lifts to #404040, as Emacs does). =boxCss= now takes the face's effective bg and derives both edges from it; pressed swaps the pair; the translucent pair survives only as a no-bg fallback. Width stays at the box's width (default 1px): dupre declares =:line-width -1=, so Emacs draws 1px lines too — the "wider" impression was the strength of the derived colors (on the dupre mode-line bg, Emacs's highlight is #71767f vs the old overlay's effective #595d63). 5 node tests with hand-computed fixtures from the C source + a new #beveltest gate (derived colors in paintUI, pressed swap, line-style passthrough). Algorithm evidence: emacs-30 xterm.c lines 9599-9665 (fetched 2026-06-10). Awaiting the side-by-side check below. +** DONE [#B] theme-studio color-harmony explainer :feature:theme-studio:docs:solo: +CLOSED: [2026-06-10 Wed] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-10 +:END: +Written 2026-06-10 as [[file:docs/design/theme-studio-color-harmony.org][docs/design/theme-studio-color-harmony.org]]: the OKLCH method (borrow hue, fix L/C per tier, constraints bound the dials), the L≈0.28/C≈0.045 background-tint tier, the fg-vs-bg role split, the worst-case floor / L_max problem (cross-referenced to the shipped ramps spec), ramp generation as shipped, and harmonic fill as the vNext application. Harmonic fill itself stays tracked in the ramps spec. + +Write an explainer in =docs/design/theme-studio-color-harmony.org= capturing the OKLCH harmony method worked out 2026-06-09: harmony is mostly calculable — work in OKLCH, borrow the hue from a semantic accent, fix lightness + chroma across a tier, and let contrast (WCAG/APCA), ΔE separation, and the sRGB gamut bound the free dials. Include the worked background-tint tier (borrow accent hue, fix L≈0.28 C≈0.045 → dim readable bg per hue) and the fg-vs-bg role split (bright accents for text, dim low-chroma tints for backgrounds). + +Two features it enables (both worth building): +1. Ramp generation (focus first): from a base color, generate its tonal ramp — base, +1/+2/+3 (lighter) and -1/-2/-3 (darker) — by stepping OKLCH lightness (and easing chroma) on a fixed hue. Term note: the whole family is a "ramp"/"tonal scale"; darker steps are "shades", lighter are "tints", gray-mixed are "tones" — so "ramp" or "scale" is the precise word, not "shades". +2. Harmonic fill: from a few chosen colors (e.g. slate blue + bg), generate a table of harmonic candidates (hue-angle schemes at matched L/C) to fill the missing palette slots. + +Open design problem to address in the explainer + the ramp feature: a background-over-text effect (highlight/region/isearch/hl-line) must stay readable for EVERY foreground that can appear on it — i.e. the worst-case (lowest) contrast across the whole set of element fg colors, not a single pair. The usable background lightness is therefore capped by the darkest/closest fg in that set. + +The v1 feature (ramp generation + background-contrast safety, with the worst-case-floor UX) is designed in [[file:docs/theme-studio-palette-ramps-spec.org][docs/theme-studio-palette-ramps-spec.org]]. Codex review incorporated 2026-06-09: both open decisions resolved (WCAG AA default target; v1 foreground set = distinct syntax hexes + default fg), v1 covered faces closed to region/hl-line/highlight/lazy-highlight/isearch, ramp defaults + function contracts pinned. Spec is Ready (Craig confirmed 2026-06-09); the v1 build is tracked under the sibling parent below. Harmonic fill (feature 2) stays vNext. This task is the explainer doc itself (=docs/design/theme-studio-color-harmony.org=, the methodology). +** DONE [#B] Telegram mark-read path for triage :bug:telega: +CLOSED: [2026-06-11 Thu] +Work's triage handoff (2026-06-11 09:20): find a reliable way to mark Telegram noise chats read — 49 unread chats keep resurfacing every sweep. Two findings from work's attempt: the plugin's documented verb =telega-chat--mark-read= doesn't exist in the installed telega (=telega-chat-toggle-read= looks right), and the dockerized telega-server reaches Ready but SIGSEGVs (exit 139) the moment =telega-chat-toggle-read= fires — reproduced twice after clean restarts. Scans still work off the cached =telega--chats= hash; no action verb can run. Candidates: call =telega--viewMessages= directly, batch via =telega-filter-read-all= in the root buffer, or bump tdlib in the zevlg/telega-server image. Deliverable: a working verb, then update the canonical =triage-intake.telegram.org= Actions section in rulesets. + +Resolved 2026-06-11: the verbs were never broken (=telega--viewMessages= verified live; =telega-chat-toggle-read= works but toggles, so guard on unread). The SIGSEGVs are spontaneous memory-corruption crashes in the zevlg/telega-server:latest musl build (11 coredumps since 2026-06-09, several with zero verb traffic) — work's correlation was timing. Also deleted 41 join-notice-only chats per Craig's standing call (unread chats 48 → 16). Canonical workflow updated (rulesets e32a7f5); resolution replied to work's inbox. Watchlist: if the spontaneous crashes worsen, pin a pre-2026-06 image digest, build telega-server natively, or report upstream with =coredumpctl= evidence. +** DONE [#B] Memory sweep into the agent KB :chore:quick: +CLOSED: [2026-06-11 Thu] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-11 +:END: +One-time Phase 1.5 sweep from the rulesets agent-KB rollout (handoff 2026-06-10): read this project's harness memory dir, classify each fact against ~/.claude/rules/knowledge-base.md inclusion criteria (KB-worthy / stays local / stale-delete), propose the batch to Craig, write approved facts one-node-per-file under ~/org/roam/agents/ (pull first, commit + push after), then reply to rulesets' inbox with counts. + +Resolved 2026-06-11: 7 memories swept. 3 promoted (no-make-frame-in-live-daemon, proton-bridge cert mismatch, open-images-with-imv — roam commit a915760, pushed); 3 stayed local per Craig (commit-flow waiver is per-project; both theme items held); 1 deleted (numbered-options, superseded by the canonical interaction.md rule). Counts replied to rulesets' inbox. +** DONE [#A] theme-studio contrast cell uses the wrong fg/bg pair :bug:theme-studio:solo: +CLOSED: [2026-06-11 Thu] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-10 +:END: +The contrast readout on every item with two color selections (a fg AND a bg — the UI faces table and the package faces table) is computing the wrong pair. It needs to contrast the face's selected fg against the face's selected bg, not how the bg contrasts with the currently-selected (ground) bg. + +Investigation start: the two-color contrast cells are =paintUI= (UI faces, app.js ~line 740) and =buildPkgTable= (package faces, app.js ~line 430), both currently calling =contrast(effFg(fg), effBg(bg))= where =effFg(v)=v||MAP['p']= and =effBg(v)=v||MAP['bg']=. Reproduce a face that has BOTH a fg and a bg set, confirm the displayed ratio, and check whether it's actually evaluating selected-fg vs selected-bg or falling through to the ground bg. Fix so a two-color face always rates its own fg-on-bg. (Single-color contexts — the picker/palette-chip/plane checks that rate a color against the ground — are correct and out of scope.) Add a characterization gate (a #contrasttest hash gate) pinning fg-vs-bg for a two-color face. +*** 2026-06-10 Wed @ 14:40:22 -0500 Diagnosed and fixed at the root, shared with the preview-bg bug +The ratio computation was already correct (gate-verified: both tables rate a two-color face's own fg-on-bg). What made it READ wrong: (1) =applyGround= blanketed every =.ex= cell — including the per-face preview cells — with the ground bg, so the preview showed fg-on-ground-bg next to a ratio for fg-on-face-bg; (2) a ground-bg change never repainted the UI/package tables, leaving ground-dependent ratios stale. Fix: =applyGround= now blankets only the code panes and =#legbody= example cells and repaints UI faces through =paintUI=; the ground-bg handler also rebuilds the package table/preview. New #contrasttest assertions pin two-color fg-on-bg (both tables), preview-bg survival, ratio stability, and ground-dependent re-rating. Suite green. Awaiting Craig's repro check (manual-test child under the Manual testing parent). +** DONE [#B] theme-studio UI-faces preview cell ignores the face bg :bug:theme-studio:quick:solo: +CLOSED: [2026-06-11 Thu] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-10 +:END: +In the UI faces table, the preview cell for a face with its own bg renders with the ground bg instead. Repro: set mode-line fg=black, bg=blue — the preview cell should be black text on blue, but shows black on black (the live buffer mode-line is fine). Root cause: =applyGround= (app.js:300) blankets EVERY =.ex= element's background to =MAP['bg']=, and the preview cell =cP= shares =className='ex'= (app.js:753), so it clobbers the per-face bg =paintUI= sets (app.js:739) — runs on load and on every ground change. Fix: stop applyGround from touching the UI-face preview cells (scope its =.ex= selector to the code/example cells, give the preview cell its own class, or re-run paintUI after). The contrast cell shares the same staleness, so confirm both. +*** 2026-06-10 Wed @ 14:40:22 -0500 Fixed by the applyGround scoping under the contrast-cell task +Same root cause as the [#A] contrast-cell task, fixed there in one change: =applyGround= scopes its blanket to =#legbody .ex= + the code panes and repaints UI faces through =paintUI=. #contrasttest pins the preview-bg survival. Awaiting the same repro check. +** DONE [#B] cj/undo-kill-buffer off-by-one on plain invocation :bug:quick:solo: +CLOSED: [2026-06-12 Fri] +Fixed in =modules/ui-navigation.el=: indexing is now =(nth (1- arg) ...)=, so a numeric prefix is 1-based and plain M-S-z re-opens the most-recently-killed file (was opening the second). Rewrote the two undo-kill tests to exercise the real no-prefix path (arg=1 -> first) and a 1-based numeric prefix; both red against the bug, green after. Full suite: no new failures (the 4 pre-existing dupre-theme failures are the separate task below). Live-reloaded into the daemon. +** DONE [#B] dashboard-config setq wipes recentf-exclude list :bug:quick:solo: +CLOSED: [2026-06-12 Fri] +Fixed in =modules/dashboard-config.el=: extracted the EMMS exclusion into =cj/--dashboard-exclude-emms-from-recentf= (the =:config= side-effect was not reachable for a test) and switched =setq= to =add-to-list=, so the five exclusions system-defaults adds earlier in init order survive. Two ERT tests in =tests/test-dashboard-config-recentf-exclude.el= (preserves prior entries / adds the pattern); the preservation test was red before, green after. Live-reloaded into the daemon and restored the five wiped entries in the running session. +** DONE [#B] org-roam dailies template writes FILETAGS and TITLE on one line :bug:quick:solo: +CLOSED: [2026-06-12 Fri] +Fixed in =modules/org-roam-config.el=: extracted the dailies head into the =cj/--org-roam-dailies-head= defconst (so it is unit-testable, the value was unreachable inside the use-package =:custom= form) and gave it real newlines — =#+FILETAGS: Journal\n#+TITLE: %<%Y-%m-%d>\n=. Two ERT tests in =tests/test-org-roam-config-dailies-head.el= assert FILETAGS and TITLE sit on separate lines and the head ends in a newline (both red before, green after). Live-reloaded into the daemon. Open follow-up for Craig: existing malformed daily files (with the run-together first line) are data, not code — sweep them by hand if desired. +** DONE [#B] drill-refile clobbers global org-refile-targets with an invalid spec :bug:quick:solo: +CLOSED: [2026-06-12 Fri] +Fixed in =modules/org-drill-config.el=: =cj/drill-refile= now =let=-binds =org-refile-targets= (the session-wide value survives) and supplies =(directory-files drill-dir t "\\.org$")= as the file list instead of the bound =drill-dir= symbol (org reads a bound symbol as a directory string, which yielded nothing). Rewrote the stale test (it asserted the buggy =(assoc 'drill-dir ...)=) into two: targets are a real .org file list, and the global is not clobbered. Both red before, green after. Live-reloaded into the daemon. + +Follow-up 2026-06-12 (Codex review): the first fix reinvented file-listing with a raw =directory-files= call, bypassing the shared validated entry point =cj/--drill-files-or-error= — no missing/unreadable-dir =user-error=, silent fall-through on an empty dir, and it included leading-dot =.org= files the rest of the module excludes. Re-routed through =cj/--drill-files-or-error= + =expand-file-name=; the test was rewritten into three (validated-helper targets, no global clobber, =user-error= on a missing dir). +** CANCELLED [#B] M-S- launcher keys dead: eww, elfeed, calibredb unreachable :bug:quick:solo: +CLOSED: [2026-06-13 Sat] +Not a bug. The audit used =key-binding=, which ignores =key-translation-map=, so it read the M-S- launcher chords as dead. They work in GUI: =keyboard-compat.el= installs a =key-translation-map= entry (=M-E -> M-S-e=, etc.) in GUI frames, so Meta+Shift+letter reaches eww/elfeed/calibredb. The "fix" =4a1ecf64= bound =M-E= directly and broke them instead; reverted here. The real console-reachability problem (the chords are dead outside GUI) is the subject of [[id:540bf06b-16b8-46c6-b459-c40d1b9c795d][the keybinding-console-safety spec]]. +** DONE [#B] Signel Client Open Work +CLOSED: [2026-06-12 Fri] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-12 +:END: +Parent task for the Emacs Signal client bring-up. Engine: signal-cli (linked secondary device). Front end: a fork of signel at =~/code/signel=, wired through =modules/signal-config.el=. Design: [[id:0cabd6ee-c458-47b5-a8af-3ee054b25821][docs/specs/signal-client-spec-doing.org]]. + +Closed 2026-06-12: the bring-up shipped (dated history below). The open signel/signal-cli issues moved to [[file:~/code/smoke/todo.org][the smoke todo]] (smoke is the evolved Signal package) and are tracked there flat (the three open children here — handle-error leak, link-with-QR, groups in picker — moved in that pass). Work on =modules/signal-config.el= stays in this file. + +*** 2026-06-12 Fri @ 07:34:05 -0500 Signel notify-only-for-unviewed-conversation shipped +Wire =cj/signal--should-notify-p= (done) into signel's =signel--handle-receive= notify block (signel.el:277), route through Craig's notify script instead of bare =notifications-notify=, and gate sound behind a defcustom that defaults off. Spec addendum (the four notify details + wiring architecture) accepted 2026-06-11 — see [[id:0cabd6ee-c458-47b5-a8af-3ee054b25821][signal-client-spec-doing.org]] "Notification slice". + +Built 2026-06-11 (TDD; fork commit e263367, dotemacs 9afc6128): =signel-notify-function= customization point in the fork; =cj/signel--notify= + =cj/signal--format-notify-body= + =cj/signel-notify-sound= in signal-config.el, wired in =:config= with a load-time =cj/executable-find-or-warn=. 17 new ERT tests green; full launch smoke clean; live-reloaded into the daemon and a synthetic toast fired through the script path. The two manual checks moved to the Manual testing and validation parent. + +*** 2026-05-26 Tue @ 20:06:58 -0500 Decided: fork signel rather than depend on it +signel is on MELPA but stale (one-author v0.1, all commits in a Jan-2026 burst, unattended tracker, no PRs). The spec needs internal edits (notify behavior, input-clobber fix), which are clean in a fork and hacky via advice, and a dead upstream means no divergence cost. Rejected: adopt-from-MELPA + advice, build-from-scratch, signal-cli-rest-api (Docker), MCP-tool, ERC bridge. Full rationale in the design doc. + +*** 2026-05-26 Tue @ 20:06:58 -0500 Linked as secondary device; contact parser verified against live shape +Installed signal-cli 0.14.4.1 (AUR; imported AsamK's signing key FA10826A... to clear the makepkg verification). Linked the account via QR. Built and unit-tested the pure helper layer in =modules/signal-config.el= (contact-list parsing, notify-when-not-viewing predicate) with =tests/test-signal-config.el=. Confirmed the live =listContacts= shape: givenName/familyName are top-level in 0.14, not under profile as first assumed; corrected the parser and verified it produces a picker entry for all 94 real contacts. Sent a request to archsetup to add signal-cli to the standard install. + +*** 2026-05-27 Wed @ 22:08:40 -0500 Shipped initiate-message workflow: picker + Note-to-Self + keymap +=cj/signel-message= (=C-; M m=) names contacts via =completing-read= over the cj-owned =cj/signel--contact-cache=, with "Note to Self" pinned first. =cj/signel-message-self= (=C-; M s=) sends straight to =signel-account=. Daemon guard =cj/signel--ensure-started= auto-starts the daemon when =signel-account= is set and =user-error='s with the remedy when it isn't; on start it pre-warms the cache. =cj/signel--fetch-contacts= rides the new RPC callback contract (=signel--send-rpc= with success-callback), the result feeds =cj/signal--parse-contacts=, and =cj/signel-refresh-contacts= (=C-; M no leaf=) clears + refetches. Cold-cache invocations =accept-process-output= up to =cj/signel-fetch-timeout= seconds (3s default) and =user-error= on timeout so a wedged daemon can't hang Emacs. Prefix keymap =cj/signel-prefix-map= bound under =C-; M= via =keybindings.el='s =cj/custom-keymap=: m / s / d / q / SPC. 15 new ERT tests in =tests/test-signal-config.el= cover ensure-started branches, fetch contract, cache empty-vs-failure, refresh, picker happy-path + cold-cache resolves + cold-cache timeout, message-self, and the prefix map bindings. + +*** 2026-05-27 Wed @ 21:55:57 -0500 Added JSON-RPC success-result dispatch in the signel fork +Fork commit 4740d97 added =signel--request-handler-map= (id → success callback), extended =signel--send-rpc= with an optional =success-callback= that registers under the new request id, and gave =signel--dispatch= a result branch that invokes the callback and removes the handler. Error responses also remhash the handler entry, and =signel-start= / =signel-stop= both =clrhash= the map so reconnect is reliably empty. Backward-compatible: existing callers that don't pass a callback hit the same code path as before. Five ERT tests in this project (=tests/test-signel-rpc-dispatch.el=, dotemacs commit bfec0eab) lock the contract: Normal (result invokes callback + cleanup, send-rpc registers), Boundary (unknown id is a no-op), Error (error response cleans up handler), reconnect (=signel-stop= empties the map). Refactor audit surfaced a separate pre-existing leak in =signel--handle-error= (request-buffer-map entries aren't removed on error); filed as the [#C] follow-up below. + +*** 2026-05-27 Wed @ 22:08:40 -0500 Shipped clobber fix for both insert paths +Fork commit 5ec56c0 added =signel--pending-input= (capture from input-marker to point-max) and =signel--restore-input= (re-insert after the redrawn prompt; nil-safe), and wired both into =signel--insert-msg= (the receive path) and =signel--insert-system-msg= (the error path). A mid-type send now survives both an incoming message and a system-error insertion. Four ERT tests in =tests/test-signel-input-preservation.el= cover the helpers (typed text, empty) and both insert paths via a temp =signel-chat-mode= buffer. + +*** 2026-05-27 Wed @ 22:08:40 -0500 use-package wired with C-; M keymap and local account config +=use-package signel :load-path "~/code/signel" :ensure nil= already wired earlier with =signel-auto-open-buffer nil=. Account source is =signel-account= set from =cj/signal-private-config-file= (=signal-config.local.el=, gitignored) loaded in =:config=, decided in the workflow spec. Keymap prefix =C-; M= attached via =with-eval-after-load 'keybindings= so the binding survives load-order. + +*** 2026-06-06 Sat @ 12:29:24 -0500 Fixed C-; M load-order bug via canonical register-prefix-map +Root cause: signal-config.el was the only feature module that violated the prefix-registration contract documented in =keybindings.el:41-45=. Every other prefix map uses =(require 'keybindings)= + a top-level =(cj/register-prefix-map "X" map)=; signal-config had neither, mutating =cj/custom-keymap= directly through a =(with-eval-after-load 'keybindings (when (boundp 'cj/custom-keymap) ...))= form. The =boundp= guard turned a load-order miss into a SILENT no-op — no error, the binding just never happened — which is why a live-reload (keybindings definitely loaded by then) papered over it. +Fix: added =(require 'keybindings)= at the top of signal-config.el and replaced the guarded form with =(cj/register-prefix-map "M" cj/signel-prefix-map "signal messages")=, matching the 25+ other prefix maps. +Verified: (1) new contract test =test-signal-config-prefix-map-registered-under-c-semi-m= asserts =C-; M= resolves to =cj/signel-prefix-map= (35/35 green); (2) full =emacs --batch= init.el launch — the exact failing scenario — now shows =C-; M= bound; (3) clean byte-compile; (4) live-reloaded into the daemon, binding confirmed. No unit-level red was possible: the =boundp= guard is robust under all standard test timings, which is the CLAUDE.md launch-only-failure class. + +*** 2026-05-28 Thu @ 03:09:18 -0500 Chat buffer docks bottom 30% and C-c C-k cancels +=display-buffer-alist= entry in =modules/signal-config.el= matches =^\*Signel: = chat buffers and routes them through =display-buffer-at-bottom= with =window-height . 0.3=, so the chat docks to the bottom 30% of the frame. The signel fork's =signel-chat= switched from =switch-to-buffer= to =pop-to-buffer= so the rule can apply (=switch-to-buffer= ignores =display-buffer-alist=). =C-c C-c= was already bound to =signel--send-input= in the mode; =C-c C-k= now binds =signel--cancel-input=, a new fork helper that clears the editable region between =signel--input-marker= and =point-max= and then calls =quit-window=. Buffer stays alive so chat history above the marker survives revisits; cleared input means the next visit lands on a fresh prompt. Five ERT tests in =tests/test-signel-cancel-input.el= (clears pending, empty-area no-op, quit-window called, buffer preserved, keymap binding) and two new tests in =tests/test-signal-config.el= (entry shape + regex match set). Dotemacs commit 998e9c7a, fork commit df02d79. +** DONE [#C] Project-aware bug capture via C-c c t :feature: +CLOSED: [2026-06-12 Fri] +Relocated from the global capture inbox 2026-06-06. When inside a projectile project, C-c c t (Task) files into that project's root todo.org under the "<Project> Open Work" header. If the project has no todo.org, fall back to the global inbox-file and warn naming the project. + +Implemented 2026-06-06 in =modules/org-capture-config.el=: a shared project-aware =function= capture target (=cj/--org-capture-project-location=) used by =C-c c t= (Task, files a top-level TODO) and a new =C-c c b= (Bug, files a top-level TODO [#C]). Matches an existing top-level "... Open Work" heading (so ~/.emacs.d hits "Emacs Open Work") and creates "<Capitalized project> Open Work" only when absent. Outside a project / no todo.org -> global inbox under "Inbox" (with a warning in the no-todo.org case). 15 ERT tests in =tests/test-org-capture-config-project-target.el=; daemon e2e confirmed a real capture lands a second-level TODO entry prepended under Open Work. Manual verify filed under the Manual testing and validation parent. NOTE: the matching "<Project> Resolved Work" header for the wrap-up workflow is a separate concern, not handled here. +** DONE [#A] theme-studio: 2D gallery color picker for assignment dropdowns :feature:studio: +CLOSED: [2026-06-15 Mon] +Replaced the per-face color dropdown (mkColorDropdown popup in app.js) with a 2D grid in the palette-panel shape: galleryModel(cur,palette,ground) in app-core.js (pure; reuses columnsFromPalette) returns a default chip, an optional (gone) cell, and rows = ground strip then one row per family (members dark->light, one selected). 5 node tests + #gallerytest browser gate. Trigger and ‹ › step buttons unchanged; applies to all three tiers. From the roam inbox 2026-06-15. +** DONE [#C] theme-studio: palette display toggle for base colors vs full palette :feature: +CLOSED: [2026-06-15 Mon] +Added an arrow control on the palette: right collapses each column to its base color (ground steps collapse to bg/fg too), down shows the full spans. #paltoggletest covers it. Commit 5ab506d9. +** DONE [#A] theme-studio: flag gone color assignments with a distinctive border :feature:studio: +CLOSED: [2026-06-15 Mon] +Swatches whose assigned color resolves to "(gone)" now carry a solid red outline (distinct from the dashed unused-tile flag). #gonetest covers it. Commit 0529189a. +** DONE [#A] theme-studio: flag unused palette tiles and columns :feature: +CLOSED: [2026-06-15 Mon] +usedPaletteHexes reverse-lookup over syntax/ui/package assignments + ground; a tile referenced nowhere gets a dashed outline, an all-unused column gets a dashed box. Biased safe (never flags a used color). Node tests + #unusedtest. Commit 7e7b871f. +** DONE [#C] theme-studio: equalize style and box button cluster sizing :refactor:quick:studio: +CLOSED: [2026-06-15 Mon] +Shrank .sbtn from 26x24 to the 17x15 box-button size (font 13px), so the style and box clusters match and the row returns to roughly its pre-cluster height. Commit 44128931. +** DONE [#A] Face and font diagnostic popup at point :feature: +CLOSED: [2026-06-15 Mon] +Read-only popup diagnosing why text at point paints as it does (face stack by source, merged attributes, real font vs declared family, theme/config/inherit provenance). Spec: [[id:98f065cf-8bd5-46a0-ac24-da94d66855ad][face-font-diagnostic-popup-spec-implemented.org]]. Building in modules/face-diagnostic.el: pure core cj/--face-diagnosis-at returns the report plist; cj/describe-face-at-point renders it into a read-only help buffer. From the roam inbox — "do this one first." +*** 2026-06-15 Mon @ 12:19:41 -0500 Phase 1 — core read model + buffer classifier landed +modules/face-diagnostic.el: cj/--face-diagnosis-at returns groups 0-2 (buffer classification, character context, face stack by source) via small pure helpers. 17 ERT tests (tests/test-face-diagnostic.el), byte-compile clean. Not yet wired into init.el; the interactive command and keybinding land in Phase 4. +*** 2026-06-15 Mon @ 12:26:52 -0500 Phase 2 — merged attributes + real font landed +cj/--face-diag-merged-attributes folds the ordered, remap-expanded spec stack ("computed"); cj/--face-diag-real-font reports font-at or "unavailable" under batch. Settles spec decision #7 (hand-fold, tested on overlay-over-text-prop, default-remap, and face-symbol fixtures). 23 ERT tests total, byte-compile clean. +*** 2026-06-15 Mon @ 12:30:30 -0500 Phase 3 — provenance trace landed +cj/--face-diag-provenance returns per-face provenance: themes from theme-face, config from saved/customized-face, the :inherit chain, and the attributes still unspecified that fall to the default. Version-sensitive internals sit behind small tolerant accessors. 30 ERT tests total, byte-compile clean. +*** 2026-06-15 Mon @ 12:37:16 -0500 Phase 4 — render + popup wiring landed +cj/describe-face-at-point renders the diagnosis into the read-only *Face Diagnosis* buffer (cj/face-diagnostic-mode), with region-scan mode and an out-of-scope banner; required in init.el; live-verified in the daemon (it already surfaces the auto-dim remaps). Command name settled as cj/describe-face-at-point. Deferred to follow-up: clickable face-name buttons (plain text for now) and the module-header allowlist entry; the keybinding is Craig's to pick. +** DONE [#B] dwim-shell: zip overwrites its own name, backup timestamp never expands, dired menu key dead :bug:quick:solo: +CLOSED: [2026-06-13 Sat] +From the 2026-06 config audit, =modules/dwim-shell-config.el=: +- =:338= — single-file zip is =zip -r '<<fne>>.<<e>>' '<<f>>'= — reconstructs the input filename as the archive ("Zip file structure invalid"; directories produce =foo.=). Should be ='<<fne>>.zip'= like the tar-gzip sibling. +- =:549= — backup destination single-quotes =$(date ...)= so the substitution is literal: =foo.txt.$(date +%Y%m%d_%H%M%S).bak=. Move it outside the quotes or format-time-string in Elisp. +- =:932= — dired-mode binding "M-S-d" is unreachable (Meta+Shift+d generates M-D); the dirvish binding two lines down is correctly "M-D". Fix + the stale commentary at dirvish-config.el:30. +Fixed 2026-06-13: zip single-file template now ='<<fne>>.zip'=; backup uses =format-time-string= in Elisp (real =YYYYMMDD_HHMMSS= stamp, dropped the now-unneeded =date= util); dired key M-S-d→M-D + dirvish-config.el:30 doc corrected. Both command strings extracted into top-level builders (=cj/dwim-shell--zip-single-file-command=, =cj/dwim-shell--dated-backup-command=) so they're unit-testable without the dwim-shell-command package — the command defuns live in its use-package :config, which the batch harness doesn't load. 2 builder tests green in make; live daemon confirms all three (backup stamp, .zip, dired M-D). Real backup/zip run + the dired keypress are a VERIFY. +** DONE [#B] ERC: double mention notifications + tautological server list :bug:quick:solo: +CLOSED: [2026-06-14 Sun] +From the 2026-06 config audit, =modules/erc-config.el=: +- =:281= — =erc-modules= includes the built-in =notifications= module AND :config adds =cj/erc-notify-on-mention= to the same hook — every mention fires two desktop notifications. Pick one path (keep the custom one, slated for messenger unification). +- =:100= — =cj/erc-connected-servers=: inside =with-current-buffer=, the free =erc-server-process= is the buffer's own local value, so the eq test is tautologically true — returns ALL ERC buffers (channels, dead connections). Use =erc-server-buffer-p= + =erc-server-process-alive=. +- =:238= — =user-whole-name= read at load but =user-constants= only required at compile time (same trap as auth-config/keyboard-macros). +Fixed 2026-06-14: removed =notifications= from =erc-modules= (kept the custom =cj/erc-notify-on-mention=, so one notification per mention); rewrote =cj/erc-connected-servers= to filter on =(erc-server-buffer-p)= + =(erc-server-process-alive)= instead of the tautological self-eq; moved =user-constants= to a runtime require. New test-erc-config-connected-servers.el (live-server-only + empty cases) 2 green; module byte-compiles. erc-config not reloaded into the daemon (live IRC session) — takes effect on restart. VERIFY for the one-notification + real-server-list behavior. +** DONE [#B] help-config: three defects in one small file :bug:quick:solo: +CLOSED: [2026-06-13 Sat] +From the 2026-06 config audit, =modules/help-config.el=: +- =:67= — =cl-return-from= inside a plain =defun= (no cl-block): declining the save prompt signals "No catch for tag" instead of canceling. =cl-defun= or restructure. +- =:108= — =:hook (info-mode . info-persist-history-mode)= is dead twice: Info's hook is =Info-mode-hook= (capital I), and =info-persist-history-mode= doesn't exist anywhere. Implement the intent or delete. +- =:111= — auto-mode-alist maps .info to an interactive command that KILLS the buffer mid find-file — programmatic =find-file-noselect= of any .info destroys buffers and pops Info windows. Drop the entry; keep the explicit command. Zero test coverage on this module (the two broken paths are exactly the untested ones). +Fixed 2026-06-13: (1) extracted the save/cancel/open decision into a pure =cj/--info-open-plan= and routed =cj/open-with-info-mode= through it — no more =cl-return-from=, declining cancels cleanly; (2) deleted the dead =:hook= and the empty =:preface=; (3) dropped the destructive =auto-mode-alist= .info entry (kept =cj/open-with-info-mode= as an M-x command and =cj/browse-info-files= on C-h i). New test-help-config.el covers the planner (open / save-then-open / cancel) — 3 green; module loads clean. Stale daemon state (the .info auto-mode entry + the bogus info-mode-hook entry) cleared by hand so the running session is correct without a restart. Interactive Info open + find-file-no-longer-destructive are a VERIFY. +** DONE [#B] markdown live preview clobbered by markdown-mode :bug:quick:solo: +CLOSED: [2026-06-13 Sat] +=modules/markdown-config.el:54= defines bare =markdown-preview=, which markdown-mode redefines the moment the first .md loads — the impatient-mode live preview is dead and F2 silently runs the package command (agent verified in the live daemon). Also =:61= guards on =(boundp 'httpd-process)=, a variable that doesn't exist in simple-httpd — use =(httpd-running-p)=. And the =:config= =(setq imp-set-user-filter 'markdown-html)= at line 41 is doubly dead (function-not-variable, symbol names nothing) — delete. Rename to =cj/markdown-preview=, rebind F2. From the 2026-06 config audit. +Fixed 2026-06-13: renamed the defun to =cj/markdown-preview= and rebound =<f2>=; guard is now =(httpd-running-p)=; deleted the dead =(setq imp-set-user-filter 'markdown-html)= (impatient-mode use-package is now =:defer t= only). Added a guard test (server-down → user-error); 4/4 green; live daemon confirms =cj/markdown-preview= defined and guarding. Browser-render check is a VERIFY. +** DONE [#B] modeline runs synchronous git on the redisplay path, unguarded :bug:solo: +CLOSED: [2026-06-14 Sun] +=modules/modeline-config.el:173,154,145= — the mode-line :eval calls vc-backend/vc-state/vc-working-revision (synchronous git) on TTL expiry; a slow or unmounted filesystem stalls ALL redisplay. The cache key computes =file-truename= on every render (the "one stat per refresh" comment is wrong), and nothing is condition-case-wrapped, so a signal lands inside the mode-line eval. Defer the truename behind the TTL check; wrap the fetch in condition-case caching nil. From the 2026-06 config audit. +Fixed 2026-06-14 (Approach A): dropped =file-truename= from =cj/modeline-vc-cache-key= (key is now =(file show-remote)=, no per-render stat; a moved symlink is caught at the next TTL refresh when vc-backend resolves the link fresh). Wrapped =cj/modeline-vc-fetch= in =condition-case ... (error nil)= so a git signal on a slow/unmounted FS degrades to no-VC-info instead of breaking redisplay. Rewrote the two truename cache-key tests to assert the cheap key; added a fetch-swallows-vc-errors test. 9 modeline vc tests green; live daemon confirms the 2-element key and nil-on-error fetch. +** DONE [#B] org-faces: custom header-row face layer + theme-studio app :feature:theme-studio:spec: +CLOSED: [2026-06-15 Mon] +Named, theme-agnostic faces for org TODO keywords and priorities, wired via org-todo-keyword-faces / org-priority-faces, plus a dedicated theme-studio "org-faces" app beside elfeed and mu4e. Spec: [[id:35578114-8c29-43af-97a2-fdfea01a802e][org-faces-spec-implemented.org]]. All four decisions resolved (prefix org-faces-, real defface defaults, auto-dim repointed to org-faces-*-dim, all 10 keywords). Phase 1 (modules/org-faces-config.el + 5 ERT tests), Phase 2 (auto-dim-config.el repoint), Phase 3 (theme-studio org-faces app) all landed and verified; the build-theme round-trip is confirmed mechanically. Residual visual check is a VERIFY under Manual testing and validation. +** DONE [#B] slack-config lifecycle gaps :bug:quick:solo: +CLOSED: [2026-06-14 Sun] +From the 2026-06 config audit, =modules/slack-config.el=: +- =:265= — w / @ / # bound to commands neither autoloaded nor in :commands — void-function before slack loads. Add to :commands. +- =:246= — =cj/slack-close-all-buffers= reads =slack-current-buffer= (declared but unbound) without the boundp guard its sibling has — void-variable on C-; S Q before slack loads. +- =:259= — raw =global-set-key= for C-; S bypasses =cj/register-prefix-map= (signal/erc use it); invisible to the keybindings registry and the planned unification enumeration. +Fixed 2026-06-14: added =slack-message-write-another-buffer=, =slack-message-embed-mention=, =slack-message-embed-channel= to =:commands= (w/@/# now autoload); guarded =cj/slack-close-all-buffers= with =buffer-local-boundp= (no void-variable on C-; S Q before slack loads); switched =global-set-key= to =(cj/register-prefix-map "S" cj/slack-keymap "slack")= (+require keybindings). New test-slack-config-close-all.el green; module loads, C-; S registered in the registry. Not reloaded into the live daemon (active slack session) — restart to apply. VERIFY for the pre-load key safety. +** DONE [#B] theme-studio color columns :feature:studio: +CLOSED: [2026-06-13 Sat] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-11 +:END: +Show the palette as hue-grouped strips (dark→light) over the existing flat, individually-editable palette. Grouping is by OKLCH hue from the hex, so renaming a color never moves it. A per-strip count control generates a symmetric ramp (N → base ±N) from the strip's most-saturated color; regenerate is authoritative, repointing surviving-step references by lightness rank and leaving removed-step references a visible "(gone)". The ground strip is synthesized from the bg/fg assignments and pinned first; the standalone ramp panel is removed. Designed in [[file:docs/theme-studio-color-families-spec.org][docs/theme-studio-color-families-spec.org]]. Codex-reviewed Ready 2026-06-10 after response folded: pivoted from name-derived families to hex-derived families over a flat palette, which designs out the name-grammar/import-inference and chip-ownership blockers. All review findings dispositioned; both open decisions resolved. Builds on and supersedes the palette-ramps v1 ramp UI. + +All six phases landed 2026-06-10 (commits ebe18d51, 74db9a52, 111687b0, e7ae18c4, 77783126, f6ab0001, 9daeff15, and the Phase 6 commit); =make theme-studio-test= green (98 node tests, 16 browser gates). Code-complete and self-verified. The hue-adjacent warm-color grouping limitation is filed as a separate research task (=~/color-sorting.org=). Remaining: the manual aesthetic/fidelity sign-off under the Manual testing parent (hue grouping reads right, regenerate-replace reads as deliberate, removed-step "(gone)" is clear). Mark this DONE once that passes. +Retired 2026-06-13: the current implementation no longer uses color-derived hue families. Palette entries carry stable structural column ids, generated colors stay in their originating column, renames do not move tiles, and =#columntest= / =#roundtriptest= pin the behavior. +*** 2026-06-10 Wed @ 01:17:45 -0500 Family model core landed +Phase 1 (commit =ebe18d51=, grouping reworked in =77783126=). =familiesFromPalette=, =regenFamily=, =rankByLightness=, =stepRepointPlan= in app-core.js, pure and hex-derived. Grouping started as gap-clustering + flat neutral threshold; after the design discussion it became nearest-hue-anchor bucketing (no single-linkage chaining) + a lightness-scaled neutral threshold (pale tints keep their hue, mid grays go neutral). regenFamily handles n=0 without ramp()'s clamp; stepRepointPlan maps survivors / lists removed by signed lightness rank. 20 node tests including the green/yellow split and the no-chaining case. Open: hue-adjacent warm colors still merge — research task above (=~/color-sorting.org=). +*** 2026-06-10 Wed @ 01:17:45 -0500 Family sort core landed +Phase 2 (commit =74db9a52=). =sortFamilies=/=sortFamilyMembers=: neutrals first, then chromatic by base hue (rounded so a hue hair doesn't outrank lightness), ties by base lightness then hex; members dark→light. Display-only; stored palette order untouched. 4 node tests. +*** 2026-06-10 Wed @ 01:17:45 -0500 Family-strip rendering landed +Phase 3 (commit =111687b0=, columns =e7ae18c4=). renderPalette restructured into the pinned ground strip + hue-sorted family columns (top→bottom dark→light), chips keep per-chip rename/remove/select, move-arrows/drag dropped. #familytest gate locks the structure + rename-stays-in-strip. Existing palette flows stay green. +*** 2026-06-10 Wed @ 01:17:45 -0500 Count control + regenerate landed +Phase 4 (commit =f6ab0001=). Per-chromatic-strip count input (0-4); setting N regenerates the family as base ±N, repointing survivor references by lightness rank and leaving removed-step references on their now-gone hex. Also fixed the neutral-threshold curve to taper at both lightness ends (symmetric Munsell) so chroma-eased dark/light extremes keep their hue. #counttest gate covers count up/down + the survivor/removed reference behavior. +*** 2026-06-10 Wed @ 01:17:45 -0500 Base edit + retire ramp panel landed +Phase 5 (commit =9daeff15=). Editing a family base recolors the whole family (shared =regenFamilyInPlace= with the count control); editing a ground swatch writes the bg/fg assignment. The standalone ramp panel (button, panel, JS, CSS, #ramptest) is removed — fan a color via its column's count instead. #baseedittest gate covers base-edit recolor + reference follow + the bg-swatch edit. +*** 2026-06-10 Wed @ 01:17:45 -0500 Warnings, seeding, export, README close-out landed +Phase 6 (commit =c175e2be=). Export stays a flat palette and import needs no reconstruction (#roundtriptest: export→import→export byte-identical). =seedPkgmap= reads the flat palette unchanged. The too-similar warning stays on the full palette — the planned ramp-step exemption was dropped after analysis: ramp steps are a stepL apart (well above the ΔE threshold) so they never warn, and exempting same-family pairs would hide genuine near-duplicates (caught by #deltatest). README documents families, the ground strip, the count control/regenerate, removed-step references, and the ramp-panel removal. +** DONE [#B] theme-studio delete entire color column :feature:quick:solo:studio: +:PROPERTIES: +:LAST_REVIEWED: 2026-06-13 +:END: +Add a column-level delete affordance to the palette. Deleting a normal color column removes the base color and every generated/imported tile in that column from the screen and from =PALETTE=. Ground remains pinned and non-deletable. Existing assignments that referenced removed tiles should follow the current deleted-color behavior: they remain on the old hex and appear as recoverable =(gone)= values rather than silently repointing. + +Acceptance notes: add a browser gate proving a column delete removes all entries with that stable =columnId=, leaves other columns alone, leaves ground non-deletable, and preserves any references to deleted hexes as gone values. + +Shipped 2026-06-13 in commit =2cf730d5=: normal column headers have a delete button, ground has no delete affordance, deleted names feed =lastGone= for recovery, and =#columntest= pins the behavior. +** DONE [#B] theme-studio palette ramps + contrast safety v1 :feature:studio: +CLOSED: [2026-06-13 Sat] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-10 +:END: +The v1 build from [[file:docs/theme-studio-palette-ramps-spec.org][theme-studio-palette-ramps-spec.org]] (Ready, Codex-reviewed). Two coupled features: a ramp generator (one base color → harmonized tonal ramp) and background-contrast safety (worst-case floor over a face's foreground set + safe-lightness guidance). + +All five phases + the README close-out landed 2026-06-09 (commits 1d51a332, 9da6c663, e7021bfe, 1d8b9f9e, 843bbf08, 23926837); =make theme-studio-test= green (78 node tests, 12 browser gates). Code-complete and self-verified. Remaining: the aesthetic and real-Emacs-fidelity sign-off under the Manual testing parent below (does a ramp harmonize, does the safe band read clearly, does a "safe" tint actually read behind real syntax). Mark this DONE once that passes. +Retired 2026-06-13: this parent is no longer active planning work. The useful pieces are already in the current tool, and later structural-column work replaced the standalone ramp workflow. +*** 2026-06-09 Tue @ 18:40:20 -0500 Ramp generator core landed +Phase 1 (commit =1d51a332=). =ramp(baseHex, {n, stepL, chromaEase})= in app-core.js → ={steps: [{hex, clamped, offset}], adjusted}= or ={steps: [], error: 'bad-hex'}=. Holds the OKLCH hue, steps lightness by =stepL=, quadratic chroma-ease toward the extremes, gamut-clamps each step; knobs clamp to range with the clamped knob named in =adjusted= (n=2/stepL=0.08/chromaEase=0.5 defaults). 10 node tests (mid/near-white/near-black bases, hue-hold, chroma ease, knob clamping, malformed hex), suite 55→65, =make theme-studio-test= green. The app-core integrity stripper now drops =import= lines too. +*** 2026-06-09 Tue @ 19:06:46 -0500 Ramp UI in palette landed +Phase 2 (commit =9da6c663=). A "ramp" button opens a panel that generates from the current color and previews the steps (named per source swatch, clamp badge on out-of-gamut steps); the n/stepL/chroma-ease controls default to 2/0.08/0.5. Click a step or "add all" to insert adjacent to the source in -n..+n order; name collisions skip (no overwrite), hex duplicates add with a flag. New #ramptest gate pins count, ordered insertion, collision skip, and the clamp badge. Verified headless + screenshot. +*** 2026-06-09 Tue @ 18:53:16 -0500 Foreground-set + floor + L_max core landed +Phase 3 (commit =e7021bfe=). =fgSetFor=, =floor=, =lMax= and the =COVERED_FACES= constant in app-core.js, all pure and explicit-state. fgSetFor returns {set:[{hex,label}]} or a structured reason ('out-of-scope'/'empty'); floor returns {ratio, limitingHex, limitingLabel}; lMax scans L from black to bracket the dark-side crossing then binary-searches it (tol 0.001), status ok/none/all/clamp. 13 node tests including the keyword-blue #67809c fixture and lMax's none/all/clamp branches. Suite 65→78, =make theme-studio-test= green. +*** 2026-06-09 Tue @ 19:06:46 -0500 Worst-case contrast readout landed +Phase 4 (commit =1d8b9f9e=). The five covered overlay faces show the worst-case floor over their foreground set (live syntax colors + default fg) and name the limiting foreground; a syntax-color edit repaints them. Out-of-scope faces keep the single-pair cell; an empty set reads "no fg set". Verdict is WCAG AA by default. New #contrasttest gate pins the readout, the keyword-blue limiting case, the single-pair fallback, and the no-set string. +*** 2026-06-09 Tue @ 19:06:46 -0500 Safe-lightness picker guidance landed +Phase 5 (commit =843bbf08=). The OKLCH picker gets a "safe for" selector over the covered faces; the C×L plane shades the lightness band too light to keep that face readable, with the L_max ceiling (via =lMax= at the current chroma) as the band's lower edge. A too-dark foreground shades the whole plane. New #safetest gate pins band-shows-for-covered-face and hides-when-none. Verified headless + screenshot. +*** 2026-06-09 Tue @ 19:06:46 -0500 README + test-surface close-out landed +Commit =23926837=. README documents the ramp controls and defaults, the worst-case floor / limiting foreground, the five covered faces, the safe-lightness guidance, and WCAG-drives-PASS-FAIL with APCA as a diagnostic; the browser-gate list is updated. =make theme-studio-test= carries all new node tests and the #ramptest/#contrasttest/#safetest gates. All acceptance criteria met. +** DONE [#B] theme-studio preview face mislinks (org, erc, flycheck) :bug:quick:solo:studio: +CLOSED: [2026-06-13 Sat] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-11 +:END: +Found by Craig 2026-06-11 during the manual-test walk (org case), then a full audit of all 20 bespoke previews confirmed three mislinks; the rest are clean: + +1. app.js:564 (org) — "Heading three" carries data-face org-headline-todo on a line with no TODO keyword; org-headline-todo's docstring says it applies to the part of the headline after the TODO keyword. Fix: add an org-todo keyword span mirroring the DONE line at app.js:563 (stars = org-level-3, keyword = org-todo, text = org-headline-todo). +2. app.js:765-766 (erc) — swapped: craig's own message text is erc-default-face and bob's is erc-input-face. erc-input-face is "ERC face used for your input"; swap them. +3. app.js:720 (flycheck) — swapped: brackets carry flycheck-delimited-error and the content flycheck-error-delimiter. In flycheck's delimiters highlighting style the delimiter strings get error-delimiter and the enclosed text gets delimited-error; swap them. + +Pin with a browser-gate assertion that these preview elements link the right faces (e.g. the org headline-todo span sits after an org-todo span; the erc my-message line uses input-face). +Fixed 2026-06-13: org heading three now has an =org-todo= keyword before =org-headline-todo=, flycheck delimiters/content are mapped to =flycheck-error-delimiter= / =flycheck-delimited-error= correctly, and ERC own/remote message text use =erc-input-face= / =erc-default-face=. Added =#previewlinktest= to pin all three mappings. +** DONE [#B] theme-studio spans should stop at bg and fg bounds :bug:quick:solo:studio: +CLOSED: [2026-06-15 Mon] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-13 +:END: +Done in commit 25e2d2ad: regenColumn ramps the dark side toward bg and the light side toward fg, bounded by the ground endpoints; pure black/white duplicates still skipped. Node tests + the #counttest bounds assertion pin it. +From the roam inbox: spanning a color should not generate colors beyond the current ground endpoints. No generated color should be darker than =bg= or lighter than =fg=. If the darker side hits =#000000=, do not create duplicate black tiles; if the lighter side hits =#ffffff=, do not create duplicate white tiles. Apply this to normal column spans and ground spans as appropriate, then pin with Node tests for the ramp/column plan and a browser gate for the palette UI. +** DONE [#B] vertico-prescient clobbers orderless filtering :bug:quick:solo: +CLOSED: [2026-06-13 Sat] +=modules/selection-framework.el:250= — =vertico-prescient-mode= defaults =vertico-prescient-enable-filtering t=, overriding =completion-styles= to prescient inside vertico sessions; the orderless config at :151 is dead exactly where it matters. Set =vertico-prescient-enable-filtering nil= — orderless matches, prescient sorts (and this resolves the dead =vertico-sort-function= finding in the buffer/window-libs child the other way around). From the 2026-06 config audit. +Fixed 2026-06-13: added =:custom (vertico-prescient-enable-filtering nil)= to the vertico-prescient use-package. Live daemon confirmed filtering nil + =completion-styles (orderless basic)= with the mode re-enabled — orderless matches, prescient sorts. No ERT test (framework defcustom, unexercisable in the stubbed-use-package harness); the in-session matching check is a VERIFY under Manual testing and validation. +** DONE [#C] Swap buffer delete/diff keys — destructive on capital :refactor:quick:solo: +CLOSED: [2026-06-13 Sat] +=modules/custom-buffer-file.el:515= binds =d= = =cj/delete-buffer-and-file= and =D= = =cj/diff-buffer-with-file=. Destructive commands should be the capital, and diff is the one hit often (when saving a buffer changed on disk). Swap them: =D= = delete, =d= = diff. From the roam inbox. +Swapped 2026-06-13: =cj/buffer-and-file-map= now binds =d= = =cj/diff-buffer-with-file=, =D= = =cj/delete-buffer-and-file=. keymap-lookup test added; live daemon re-bound by hand (defvar-keymap won't reassign a bound var on reload). Keypress check is a VERIFY under Manual testing and validation. +** DONE [#C] theme-studio: remove redundant reset button on package faces :refactor:quick:studio: +CLOSED: [2026-06-15 Mon] +Removed the per-row reset column (package faces was the only tier with one). It was not equivalent to the bulk reset next to "lock all": per-row reset one face, bulk resets every unlocked face. Single reset path now, matching syntax/ui tiers. Commit 7a7b1c16. +** DONE [#C] theme-studio: rename preview sample names :feature:quick:solo:studio: +CLOSED: [2026-06-15 Mon] +Renamed the preview personas Alice→Christine and Eve→Evan across the mu4e/signel/telega previews, with the mu4e header spacing adjusted to stay aligned. Commit 44128931. +** DONE [#C] theme-studio Rust + Zig language previews :feature:studio: +:PROPERTIES: +:LAST_REVIEWED: 2026-06-11 +:END: +Requested by Craig 2026-06-11: add Rust and Zig code samples to the language previews (samples.py currently carries Elisp, Go, Python, TypeScript, Java, C, C++, Shell). Each sample should exercise the treesit token categories distinctive to its language (Rust: lifetimes, macros, attributes, traits; Zig: comptime, builtins, error unions), then regenerate theme-studio.html and extend the test surface. + +Shipped 2026-06-13: Rust and Zig were added to =samples.py= and =generate.py=, with generator tests pinning the language-specific category coverage. +** DONE [#C] theme-studio separate tile selection from name editing :feature:quick:solo:studio: +:PROPERTIES: +:LAST_REVIEWED: 2026-06-13 +:END: +From the roam inbox: clicking a palette tile should have predictable intent. Single-click anywhere on a tile should select the whole color tile for editing/assignment. Double-clicking the name should enter name-edit mode with the cursor at the beginning of the name. Add browser-gate coverage for both paths so accidental single-click name edits do not regress. + +Shipped 2026-06-13: tile names are read-only until double-clicked; single-click selects the tile, and =#columntest= pins single-click vs double-click behavior. +** CANCELLED [#D] Desktop quick-capture: Note + Recipe types :feature:solo: +CLOSED: [2026-06-15 Mon] +Superseded 2026-06-15: the desktop popup was simplified to a single Task into the org-roam inbox (no Bug/Event, no template menu), so adding Note/Recipe types to the popup subset no longer applies. +** DONE [#A] theme-studio: remove the in-table preview column :refactor:studio: +CLOSED: [2026-06-15 Mon 20:57] +Drop the per-row preview from the assignment tables and rely on the live buffer preview alone. Requires auditing every assignment view so each face in the faces column has a situationally appropriate representation in the live preview. Craig wants a reusable project workflow for that periodic audit, created before the refit so it can drive the fix. From the roam inbox. +** DONE [#B] dupre-theme test failures :bug:test:quick:solo: +CLOSED: [2026-06-15 Mon] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-11 +:END: +Moot: dupre was retired (commit 4f0a8d80) and tests/test-dupre-theme.el was deleted with it, so the 4 failures no longer exist. The assertion-fix plan below is superseded. Remaining "dupre" mentions in the suite are benign (a fake theme symbol in test-face-diagnostic; a "dupre-fixture" JSON name in test-build-theme, a separate converter task). + +A full =make test= run (2026-06-07) is green across 516 of 517 files; the only failures are 4 tests in =tests/test-dupre-theme.el=, long pre-existing. Two root causes. For each, decide whether the palette or the test assertion is canonical, then fix the loser so =make test= goes fully green. + +Decided 2026-06-11 (Craig): #0d0b0a is the canonical background — the three drift assertions are stale, update them. org-todo stays the muted red-1 #a7502d — update the test's expected value. Both sides decided; this is now a pure assertion fix. + +*** TODO Background drift: 3 tests expect #151311, palette bg is #0d0b0a +=dupre-get-color-base= (test:46), =dupre-theme-default-face= (test:84), and =dupre-with-colors-binds-values= (test:62) all assert the default background is "#151311", but =themes/dupre-palette.el= defines =bg= as "#0d0b0a". The committed palette looks intentional, so the three assertions are likely just stale -- confirm #0d0b0a is the wanted background, then update the tests. + +*** TODO org-todo color mismatch: test expects #ff2a00, theme renders #a7502d +=dupre-theme-org-todo= (test:130) asserts the org-todo foreground is "#ff2a00" (intense-red), but the theme renders "#a7502d" (red-1). Design call: should org-todo be the bright intense-red or the muted red-1? Fix whichever side loses the decision. +** DONE [#B] reconcile-open-repos skips any repo with a dot in its name :bug:quick:solo: +CLOSED: [2026-06-15 Mon] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-13 +:END: +=modules/reconcile-open-repos.el:174= — discovery regexp ="^[^.]+$"= matches only dot-free names, so =~/code/mcp.el=, =capture.el=, =google-contacts.el=, =auto-dim-other-buffers.el= etc. are never reconciled while M-P still reports "Complete." Replace with =directory-files-no-dot-files-regexp= + a hidden-dir check; add a regression test with a dotted repo name. From the 2026-06 config audit. +*** 2026-06-13 Sat @ 11:01:44 -0500 Fixed: regexp swapped + hidden-dir check +=cj/find-git-repos= now iterates =directory-files-no-dot-files-regexp= (keeps dotted names, drops =.=/=..=) plus a =string-prefix-p "."= guard for hidden dirs. Regression test =test-find-git-repos-boundary-dotted-repo-name-found= (mcp.el/capture.el/plain-repo → 3 found); existing hidden-dirs-skipped test stays green; 11/11. Live daemon confirmed all six dotted repos under ~/code now discovered (mcp.el, gptel-mcp.el, capture.el, google-contacts.el, google-maps.el, auto-dim-other-buffers.el). Re-verified live 2026-06-15 (41 repos, 6 dotted); Craig confirmed. +** DONE [#B] theme-studio save button does not overwrite the current theme file :bug:studio: +CLOSED: [2026-06-15 Mon] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-13 +:END: +Resolved — Craig handled it 2026-06-15. +From the roam inbox: the =save= button currently behaves too much like =export=. The intended workflow is: after a theme file has been opened or saved once, pressing =save= or using the save keybinding overwrites that same file instead of downloading a fresh export. If browser security prevents overwriting a previously exported download without a file handle, make that limitation explicit in the UI and reconsider whether the separate save button should remain. This needs a small product decision around export-vs-save semantics before implementation. +** CANCELLED [#A] Global yes-or-no-p fset defeats every strong confirmation :bug:quick: +CLOSED: [2026-06-15 Mon 22:40] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-13 +:END: +=modules/system-defaults.el:203= =(fset 'yes-or-no-p 'y-or-n-p)= — verified live. Several modules deliberately chose yes-or-no-p as the strong tier for irreversible actions: shutdown/reboot (=system-commands.el:74=, whose comment explicitly says "so a stray RET/space can't trigger them"), "permanently destroy files" (=dwim-shell-config.el:804=), file overwrites (=custom-buffer-file.el:159,199=, =music-config.el:374=). The fset makes all of them single-keystroke — the two-tier design is dead. Drop the fset, or provide a real =cj/confirm-strong= (typed "yes") for the irreversible set. From the 2026-06 config audit. +Fixed 2026-06-13 (Craig chose the surgical option): added =cj/confirm-strong= to system-lib.el (binds =use-short-answers= nil for one =yes-or-no-p= call → typed "yes"); removed the redundant fset (kept =use-short-answers t= so benign prompts stay single-key); routed the 6 irreversible sites through it (shutdown/reboot, permanent-destroy, file overwrites). Note: the fset is baked into the running daemon and can't be cleared from Lisp, so the typed-"yes" tier goes live only after a daemon restart — manual confirm under the Manual testing parent. TDD; tests green. +** DONE [#B] Add Signal to the dashboard :quick:solo: +CLOSED: [2026-06-15 Mon] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-01 +:END: +** DONE [#B] ai-term adaptive side/bottom window placement :feature:quick:solo: +CLOSED: [2026-06-15 Mon] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-13 +:END: +The ai-term window should dock from whichever edge conserves more screen space, chosen at display time from the frame's aspect ratio: when the frame is wider than it is tall, dock from the right; when it is square or taller than wide, dock from the bottom. Compare the frame's pixel width against its height in the display-buffer rule to pick the edge. +** DONE [#B] auth-config: unguarded gpg-connect-agent call + compile-time require :bug:quick:solo: +CLOSED: [2026-06-15 Mon] +Fixed in cd95ea79: guarded gpg-connect-agent with cj/executable-find-or-warn; runtime require of user-constants. +From the 2026-06 config audit. =modules/auth-config.el:88= — bare =(call-process "gpg-connect-agent" ...)= in a =:demand t= :config signals file-missing and aborts init on machines without the binary; guard with =cj/executable-find-or-warn=. =auth-config.el:36= — =user-constants= is required only =eval-when-compile= but =authinfo-file= is read at load time; works from .el source, fails from standalone .elc. Use a runtime require (system-defaults.el:32-35 documents this exact trap). +** DONE [#B] Dashboard keybinding changes :quick:solo: +CLOSED: [2026-06-15 Mon] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-06 +:END: +On the dashboard, =g= should refresh the buffer (=dashboard-refresh-buffer=); =g= currently opens Telegram (=cj/telega=, dashboard-config.el:88), so move Telegram to another key. F1 (=cj/dashboard-only=) should also run a refresh at the end, so re-showing the dashboard always lands on fresh content. F1-refresh folded in from the roam inbox 2026-06-13. +** DONE [#B] eshell: visual-commands nested-list + xterm-color dead hook :bug:quick:solo: +CLOSED: [2026-06-15 Mon] +Fixed in de32ffbe: dolist visual-commands; xterm-color real hook name + filter wiring. +=modules/eshell-config.el:104= — =add-to-list= pushes one LIST into the flat string list =eshell-visual-commands=, so lf/ranger/htop/top never get a visual terminal (and the r→ranger alias garbles). dolist the strings. =:166= — =:hook (eshell-before-prompt-hook . ...)= gets "-hook" appended → registers on nonexistent =eshell-before-prompt-hook-hook=; and =xterm-color-filter= is never added to =eshell-preoutput-filter-functions= anyway while TERM advertises xterm-256color. Wire xterm-color fully per its README or drop it + the TERM override. From the 2026-06 config audit. +** DONE [#B] eww quick-add bookmarks split the store and break the default file :bug:quick:solo: +CLOSED: [2026-06-15 Mon] +Fixed in 7d58ccfb: dropped the dir-creating let-binding so quick-add shares the default store. +=modules/eww-config.el:116-126= — quick-add let-binds =eww-bookmarks-directory= to ~/.emacs.d/eww-bookmarks/ (creating a DIRECTORY at the path where the daemon's default store expects a FILE ~/.emacs.d/eww-bookmarks). After one quick-add, B reads an unreadable path and quick-added bookmarks are invisible post-restart. Drop the let-binding or setq the directory once in :config so both commands share one store. From the 2026-06 config audit. +** DONE [#B] Go: format key void-functions, go-mode :config never runs :bug:quick:solo: +CLOSED: [2026-06-15 Mon] +Fixed in 4038cf59: :commands (gofmt) autoloads gofmt so C-; f pulls go-mode and its :config. +=modules/prog-go.el:99,113-118= — .go maps to go-ts-mode so the go-mode package never loads, and =gofmt= isn't autoloaded in go-mode 1.6.0 — C-; f signals void-function, and the :config (exec-path += ~/go/bin, =gofmt-command "goimports"=) never executes. Wrapper that requires go-mode first (or autoload gofmt), move the setup to top level. From the 2026-06 config audit. +** DONE [#B] prog hooks mutate global state per buffer :bug:quick:solo: +CLOSED: [2026-06-15 Mon] +Fixed in 902290a4: electric-pair-local-mode in go/c/shell hooks; line-number setqs hoisted to top level. +From the 2026-06 config audit: =prog-go.el:64=, =prog-c.el:73=, =prog-shell.el:77= call global =(electric-pair-mode t)= from buffer setup hooks — one Go/C/shell buffer turns on pairing in org/text everywhere (python/webdev correctly use =electric-pair-local-mode=). =prog-general.el:79-80= — =display-line-numbers-type 'relative= setq/setq-default run from the hook AFTER the mode is enabled, so the first prog buffer of a session gets absolute numbers. Local-mode for the three; move the line-number setqs to top level. +The global electric-pair this turns on also paired "<" in org, stranding a ">" after "<"-key snippets (=#+end_src>=, broke cj-scan). That symptom is fixed separately (=d9c90e83=, an =electric-pair-inhibit-predicate= for "<"). This task remains the root fix: pairing should not be global at all. +** DONE [#B] Remove buffer-state cursor coloring :refactor: +CLOSED: [2026-06-15 Mon] +Removed cj/set-cursor-color-according-to-mode + the two cache defvars + the post-command/server-after-make-frame hook registrations from ui-config.el; cursor now uses the theme cursor face. Kept cj/buffer-status-state / cj/buffer-status-color in user-constants.el (modeline still uses them). Deleted tests/test-ui-cursor-color-integration.el (all cursor-function tests) and dropped the one cursor-function test from test-ui-config--buffer-cursor-state.el (kept its 6 classifier tests). Live daemon cleaned (hook removed, fn unbound, cursor reset). + +Craig directed removal (roam inbox, 2026-06-15): the cursor changing color by buffer state is confusing ("strange not knowing what your cursor should look like"). Remove cj/set-cursor-color-according-to-mode, the cj/-cursor-last-color / cj/-cursor-last-buffer defvars, and the post-command-hook + server-after-make-frame-hook registrations in ui-config.el, so the cursor uses the theme's cursor face. Keep the shared cj/buffer-status-state / cj/buffer-status-color classifier (the modeline buffer-name indicator still uses it). Before deleting tests/test-ui-cursor-color-integration.el and tests/test-ui-config--buffer-cursor-state.el, confirm which covers the shared classifier (keep) versus the cursor function (remove). Update the cursor header comment. This settles the earlier keep-vs-remove question: 7ccc3f5c's theme-driven rework is the thing to drop. +** DONE [#B] Split window opens the dashboard in the other window :feature:quick:solo: +CLOSED: [2026-06-15 Mon] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-10 +:END: +When splitting with C-x 2 (=split-window-below=) or C-x 3 (=split-window-right=), the new/other window should default to the =*dashboard*= buffer instead of mirroring the current buffer. Advise =split-window-below= / =split-window-right= (or rebind the keys) to select the dashboard in the freshly-created window. Keep point in the original window. +** DONE [#B] system-defaults: top-level server-start unguarded in batch :bug:quick:solo: +CLOSED: [2026-06-15 Mon] +Fixed in 79a38fe1: (unless noninteractive ...) guards on server-start and the custom-file temp. +=modules/system-defaults.el:140= — raw module load under =--batch= (make validate-modules on a machine with no daemon socket) starts a server from a batch process; the suite only passes because the testutil stubs it. Wrap in =(unless noninteractive ...)= — the repo's established guard for this defect class; same guard stops the =custom-file= =make-temp-file= at line 104 littering temp files per batch load. From the 2026-06 config audit. +** DONE [#C] theme-studio: extract a ground() helper for the repeated bg/fg literal :refactor:quick:solo:studio: +CLOSED: [2026-06-15 Mon] +Done in de6fccc9 as groundPair() (named to avoid the local `ground` destructure collision; 32 call sites). +The literal {bg:MAP['bg'],fg:MAP['p']} repeats 21 times across app.js and palette-actions.js, plus more in the browser gates. Extract a ground() helper that returns it and replace every call site. Purely mechanical, no behavior change; the node tests + browser gates are the safety net. From the 2026-06-15 refactor review. +** DONE [#C] cj/undo-kill-buffer skip-visited uses delq (eq) on path strings :bug:quick:solo: +CLOSED: [2026-06-15 Mon] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-13 +:END: +=modules/ui-navigation.el= — the visited-file filter calls =(delq buf-file recently-killed-list)= where =buf-file= is a fresh string from =expand-file-name=, never =eq= to the =recentf-list= entries, so already-open files are never skipped (the skip logic is dead). Use =delete= (equal-based). Found 2026-06-12 while fixing the off-by-one above; the two bugs cancel exactly when one file is open, which is why it went unnoticed. +** DONE [#B] C-s C-s vertico-repeat path never works :bug:quick:solo:next: +CLOSED: [2026-06-15 Mon] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-13 +:END: +Fixed in b62af096 (prior session): vertico-repeat-save added to minibuffer-setup-hook so a session exists for the second C-s. Re-verified live 2026-06-15: the hook is installed and cj/consult-line-or-repeat is defined. +=modules/selection-framework.el:263= — =cj/consult-line-or-repeat= calls =vertico-repeat= on the second consecutive C-s, but nothing adds =vertico-repeat-save= to =minibuffer-setup-hook= (grep: zero hits config-wide), so it always signals "No Vertico session". Add the hook next to the vertico use-package block. From the 2026-06 config audit. +*** 2026-06-13 Sat @ 10:59:52 -0500 Fixed: vertico-repeat-save hooked +Added top-level =(add-hook 'minibuffer-setup-hook #'vertico-repeat-save)= after the vertico use-package block (placed top-level, not inside use-package, so the stub-use-package test exercises it; =vertico-repeat-save= is autoloaded, deferring the load to first minibuffer). New test asserts hook membership; 5/5 green; evaled into the live daemon (=:on-hook= now t). Awaiting Craig's confirm → DONE. +** DONE [#B] dirvish M (mark all files) marks every other file :bug:quick:solo:next: +CLOSED: [2026-06-15 Mon] +Rewrote cj/dired-mark-all-visible-files with dired-get-filename + file-directory-p and an if/else so dired-mark's own point-advance isn't doubled by forward-line. Added real-dired marked-count tests; retired the now-dead regex helper and its fake-buffer mock test. +=modules/dirvish-config.el:218= — =dired-mark= advances point to the next line itself; the loop's extra =forward-line 1= then skips it, so consecutive files are marked alternately. Live mis-marking on a key that feeds batch operations (delete/copy on marked files) — data-loss adjacent. Drop the manual forward-line when a mark was made (or =dired-unmark-all-marks= + mark dirs + =dired-toggle-marks=). The trivial line-predicate helper is tested; the loop isn't — add the marked-count test. From the 2026-06 config audit. +** DONE [#B] heavy-box comment inserts non-comment lines :bug:solo:next: +CLOSED: [2026-06-15 Mon] +cj/--comment-heavy-box now prefixes the interior empty/text lines with the comment char + suffix (like cj/--comment-box) so they stay valid comments in line-comment languages, and gained the min-length guard (small/negative widths now error cleanly instead of hitting make-string). The two characterization assertions that pinned the broken bare-* lines were updated to the corrected output. +=modules/custom-comments.el:427= — =cj/--comment-heavy-box= interior/empty lines carry no comment prefix, so in line-comment languages (elisp, Python) C-; C h injects syntax-breaking bare =*...= lines. The existing test characterizes the broken output (asserts =^\*.*\*$=). Prefix interiors like =cj/--comment-box= does; add the missing min-length validation (negative width hits make-string with a raw error); fix the test to assert corrected output. From the 2026-06 config audit. +** DONE [#B] Scratch buffer background a shade lighter than default :feature:next: +CLOSED: [2026-06-15 Mon] +cj/scratch-apply-background remaps the *scratch* default background lighter (cj/scratch-background-lighten percent, default 5) via color-lighten-name, applied on the existing emacs-startup-hook. The percent is a tunable defcustom. Pure helper tested for the display-independent contract; the lightening itself is display-dependent (color-name-to-rgb), verified live in the daemon. +Make *scratch* just-noticeably lighter than the normal background so it reads as the scratch buffer. Simplest is a buffer-local face remap on *scratch*; Craig is fine routing it through org-faces if a theme hook is wanted. The exact lightening delta is an aesthetic call to tune visually. From the roam inbox. +** DONE [#C] theme-studio: drop the too-similar-colors message below the palette :refactor:studio:next: +CLOSED: [2026-06-15 Mon] +Removed the renderPaletteWarnings box (function, #palwarn element, .palwarn CSS) and its #deltatest browser gate. The per-chip nearest-ΔE tooltip stays (paletteWarnings still computes `nearest`), so the same info remains reachable inline. +Remove the too-similar-colors warning under the palette display. It isn't useful there; the same information is reachable per-assignment through the inline contrast field. From the roam inbox 2026-06-15. +** CANCELLED [#C] theme-studio: raise the max color spans to 5 :feature:studio: +CLOSED: [2026-06-15 Mon 22:52] +Increase the palette's maximum span count to 5, for a smoother, slower transition across a color. From the roam inbox. +*** CANCELLED which control caps below 5 — current maxes are all 8 +CLOSED: [2026-06-15 Mon 22:52] +On review the per-column span control, the ground span control, and regenColumn all already cap at 8 (well above 5), so there's no sub-5 limit to raise. Either 5 is already reachable, or the intended control is a different one (e.g. the generator emits base-only columns — spanCount is hardcoded 0 in palette-generator-ui.js). Need Craig to point at the control he's hitting. +** DONE [#C] Page-down in a long completing-read selects and dismisses the list :bug:next: +CLOSED: [2026-06-15 Mon] +Bound <next>/<prior> to vertico-scroll-up/down in vertico-map, so Page-Up/Down page the candidate list instead of falling through to history (which selected and dismissed). Verified live (use-package :bind isn't reachable under make test). +In a very long completing-read (vertico), Page-Down selects an item and the list vanishes instead of paging, forcing a cancel. Investigate the completion stack's next-page handling; likely needs vertico-scroll-up / vertico-scroll-down bound in vertico-map. From the roam inbox. +** CANCELLED [#C] theme-studio reconsider the JSON show button :feature:quick:studio: +CLOSED: [2026-06-15 Mon 22:56] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-13 +:END: +From the roam inbox: the =show= button for the raw JSON export does not fit the main theme-design workflow, but it may still be useful for debugging. Decide whether to hide it behind a debugging affordance, rename it, or remove it. Quick UI cleanup once the desired debugging surface is chosen; not marked solo because it is a workflow preference call. +** DONE [#B] TTY-accessible personal C-; keymap :feature:solo:quick: +CLOSED: [2026-06-16 Tue] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-05 +:END: +Done 2026-06-16: keybindings.el binds cj/custom-keymap under C-c ; alongside C-;, so the whole command family is reachable in a terminal frame with the same leaf keys (the single-point fix the body describes; no env-terminal-p branch). Audited every leaf key registered into the family — all are TTY-safe (letters, digits, punctuation, SPC, and arrow keys under C-; b, which terminals do encode); no C-RET, super, or hyper bindings, so nothing needed remapping. TDD: tests/test-keybindings-tty-mirror.el (3 tests, both prefixes share one map); full suite green; live-reloaded and confirmed C-c ; resolves to the family in the daemon. Commit pending. TTY-frame sign-off is a VERIFY under Manual testing and validation. +The personal prefix =C-;= (Control-semicolon) is GUI-only — terminals can't encode it, so the entire custom command family (=C-; g= calendar, =C-; a= AI, =C-; S= Slack, =C-; O= org, =C-; M= Signal, =C-; L= pearl, =C-; j= jump, …) is unreachable in a terminal frame (=emacsclient -nw=, Emacs inside vterm/tmux). Surfaced 2026-06-03 out of the pearl =C-; L= prefix discussion. + +Goal: keep =C-;= in GUI and add a TTY-typable mirror prefix so the same leaf keys work in a terminal. The fix is a single point: =modules/keybindings.el= defines =cj/custom-keymap= once, binds it globally with =(keymap-global-set "C-;" cj/custom-keymap)=, and every module registers into it via =cj/bind-prefix= / =cj/bind-command=. Binding that one keymap under a second prefix mirrors the whole family for free — no per-module edits. + +Easy prefix candidates (home-row-leaning, TTY-safe), same leaf keys under each: +- =C-c ;= (recommended) — keeps the semicolon mnemonic; =C-c= is the standard user prefix and always TTY-encodable, =;= is home row. =C-; L= becomes =C-c ; L=, zero leaf-key relearning. Bind it unconditionally alongside =C-;= so both GUI and TTY reach the identical map — no =env-terminal-p= branch needed. +- =C-c SPC= — easy reach, but collides with =org-table-blank-field= (=C-c SPC=) inside org buffers. +- Bare =C-c <leaf>= (the literal "C-c L" idea) — rejected: =C-c= is shared with org (=C-c l= = =org-store-link=, confirmed live), the LSP prefix (=lsp-keymap-prefix "C-c l"=), and pdf-view; binding the whole family under bare =C-c= would shadow/conflict with those. + +While in here, audit individual leaf chords for other non-TTY keys (any =C-RET=, super/hyper bindings — terminals can't send super/hyper either) and note or remap them. Verify the result in an actual =emacs -nw= / =emacsclient -nw= frame, not just GUI. Relates to the standing "org-mode keybinding consolidation" reminder. +** DONE [#C] theme-studio: open with the palette collapsed to base colors :feature:studio:next: +CLOSED: [2026-06-16 Tue] +Every time theme-studio opens, the palette shows all colors including the span tints. Instead it should open showing the base colors only, and the user expands the spans by clicking the left-side arrow menu. From the roam inbox 2026-06-16. Craig: "just do it. :)" +Done 2026-06-16: initApp sets paletteShowFull=false before the first render, so the studio opens collapsed (arrow ▶); the existing toggle expands the spans. New #paldefaulttest gate asserts the opening collapsed state; #counttest and #paltoggletest now opt into full mode explicitly since they assert span tiles. Full suite green. +** DONE [#C] theme-studio: realistic markdown-mode preview :feature:studio: +CLOSED: [2026-06-16 Tue] +markdown-mode fell back to the generic preview (face names in their own colors). Built renderMarkdownPreview (app.js): a realistic README exercising 28 markdown faces in context (front matter, H1-H3, bold/italic, inline + fenced code with a language tag, links + bare URLs, lists + GFM checkboxes, blockquote + footnote, table, hr, strikethrough, highlight, math, inline HTML, comment). Routed via a PREVIEW_KEYS map in app_inventory.py (markdown-mode -> markdown). #mdtest gate validates every data-face is a real markdown face; full theme-studio suite green. Commit =0682b24f=, pushed. Visual sign-off is a VERIFY under Manual testing and validation. +** DONE [#C] cj/gptel-switch-backend reintroduces the string-model crash :bug:quick:solo: +CLOSED: [2026-06-16 Tue] +=modules/ai-config.el:272= — =(setq gptel-model model)= with the raw completing-read STRING — the documented wrong-type-argument-symbolp modeline hang (CLAUDE.md gotcha), reachable from C-; a B today. =cj/gptel-change-model= (C-; a m) already does backend+model switching and interns correctly. Intern here, or delete switch-backend and keep one command. From the 2026-06 config audit. + +Fixed 2026-06-16: added pure helper =cj/gptel--model-to-symbol= (mirrors =cj/gptel--model-to-string=) and coerced the completing-read value through it before =(setq gptel-model ...)= in =cj/gptel-switch-backend=. 7 ERT tests for the helper (=tests/test-ai-config-model-to-symbol.el=); the existing switch-backend test (=tests/test-ai-config-gptel-commands.el=) updated from asserting the raw string to asserting a symbol + a =symbolp= crash-guard. Full suite green; helper and the redefined command are live in the daemon. Chose "intern" over deleting the redundant command — the dedup is the VERIFY below. +** DONE [#C] theme-studio picker panel blends into the page :bug:quick:solo:studio: +CLOSED: [2026-06-16 Tue] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-11 +:END: +Craig, 2026-06-11 manual-test walk: the color picker's background is hard to distinguish from the page background. Give the picker panel a visibly distinct background or a highlighted border so it stands out. Pin with a gate asserting the picker element carries the distinct style. +Done 2026-06-16: the picker now carries the gold accent border (#e8bd30) and a lighter background (#1f1c19 vs the page's #0d0b0a). The #pickertest gate asserts the accent border and a per-channel background lift of ≥12 over the page, so the distinction can't silently regress. +** DONE [#A] ai-term: selecting an agent kills the whole Emacs process :bug: +CLOSED: [2026-06-18 Thu] +Root cause: a ghostel native-module regression in 0.35.0-0.35.2 (all shipped 2026-06-16..18), not anything in this config and not display-backend related. Reproduced down to a plain =M-x ghostel= in a GUI frame (not ai-term-specific); under gdb it is a clean =exit()= from the PGTK main loop (not a SIGSEGV — hence no core ever produced). Upstream filed it the same day: dakra/ghostel #422 (Linux/glibc — the native PTY path now spawns worker threads, and a SIGSETXID handler calls malloc while the main thread holds the glibc arena lock → crash/hang on =M-x ghostel= in a GUI daemon, exactly our case) and #423 (macOS — recursive os_unfair_lock via =run_window_change_functions=). =ghostel-comint= is not a usable workaround (no cursor positioning, can't run the Claude TUI). + +Fix: pinned ghostel to the last pre-rework build — =ghostel-20260604.2049=, commit 5779a2adceb2, native module 0.33.0 — installed directly into =elpa/= and held there by =:ensure= (won't auto-upgrade). See =modules/term-config.el=. Verified: the exact crash scenario (open a ghostel buffer in a PGTK GUI frame) now survives; ghostel buffer healthy; terminal test suites green. + +Also done this session: =ghostel-module-auto-install= set to =download= (the original "doesn't install" fix); zig 0.15.2 pinned at =/usr/local/bin/zig= as the compile fallback (Arch ships 0.16 which can't build ghostel); archsetup notified of the zig pin. + +*** 2026-06-18 Thu @ 16:33:56 -0500 ai-term confirmed working after the 0.33.0 pin +Craig confirmed in normal use — opening/selecting ai-terms works with no whole-process crash ("everything seems to be working as normal now"). Headless reproduction (open a ghostel buffer in a PGTK GUI frame) had already survived; this is the live-hands confirmation. +** DONE [#C] Reproducible face-coverage generator + coverage diff :feature:solo: +CLOSED: [2026-06-18 Thu] +Built: =face-coverage-dump.el= + =face_coverage.py= + =make face-coverage= / =make face-coverage-diff=. Validated by regenerating and diffing against the hand-built worklist (headings identical; only an intro line and one sharper description differ). Compare mode reports newly-covered / newly-present / disappeared / per-tier deltas. Unrecognized faces route by defface source (elpa -> own package bucket, built-in -> emacs-general child), so a newly-loaded package self-buckets. + +Known edge: a new package whose face prefix collides with an existing family name (e.g. =org-modern= faces start with =org=) folds into that family's bucket instead of getting its own, because the family match wins before the source fallback. Fix when it bites: add the package's prefix to =EXTRA_FAMILIES= in =face_coverage.py=. + +=scripts/theme-studio/face-coverage.org= is hand-regenerated by a throwaway /tmp script each time. Commit a self-contained generator so the worklist regenerates with one command, plus a diff that names what coverage changed between runs. + +Generator — two pieces plus a Makefile target: +- =face-coverage-dump.el= — batch elisp run via =emacsclient= against the live daemon (captures actually-loaded packages), with an =emacs --batch -l init.el= fallback for a clean checkout. For every face in =(face-list)= emit name, first-line docstring, and =(symbol-file f 'defface)=. One JSON/TSV out. +- =face_coverage.py= — read that dump plus the studio's managed set (font-lock map from =build-theme.el=, =UI_FACES= from =generate.py=, =package-inventory.json=); classify each face core/general/package by where its defface lives (=/usr/share/emacs= = built-in, =elpa= = package); group; write =face-coverage.org= with the TODO/DONE tree, =[d/t]= cookies, per-face docstrings, and per-bucket descriptions (group-documentation / package summary). +- =make face-coverage= runs both and writes the file. + +Carry over the manual logic already worked out: the CORE_HINT core-face set; the subsystem/package family buckets (including abbrev, which-func, git-gutter, git-commit, twentyfortyeight, yas, edit-indirect); the erc-ansi and =bg:erc=/=fg:erc= routing; and the separator-aware prefix match (=-=, =:=, =/=). + +Compare mode (=make face-coverage-diff=): +- Parse the committed (HEAD) =face-coverage.org= and the freshly generated one into face→state maps via =^\*+ (TODO|DONE) name=. Report newly covered (TODO→DONE), newly present (new package or Emacs upgrade), disappeared (package removed), and net coverage with per-tier deltas. +- =git diff face-coverage.org= already gives the raw line delta; this is the friendlier summary. +- Optional: append a dated =covered/total= line to a small coverage-log for progress over time. + +Dump from the live daemon by default (reflects the packages actually run); the batch fallback won't see lazily-loaded packages until required. +** DONE [#C] todo.org org-lint follow-ups :refactor: +CLOSED: [2026-06-20 Sat] +From the lint-org sweeps (2026-06-15, refreshed 2026-06-20). Resolved 2026-06-20: the misplaced-heading false positive was reworded (the bug-capture task's prose quoted heading-like "* TODO" strings), and the broken link was repointed from the missing =~/code/signel/todo.org= to =~/code/smoke/todo.org= (smoke is the evolved Signal package). The obsolete-properties-drawer entries no longer reproduce under a full org-lint pass. Both lint-org --check and the built-in org-lint now report zero. +** DONE [#B] F9 toggle collapses a 3-window layout to 2 :bug: +CLOSED: [2026-06-20 Sat] +Fixed 2026-06-20 (option 1 — reversible toggle, Craig's call). In a 3+ window layout where +the agent had its own split, toggle-on reused the working window at the bottom edge, +displacing its buffer and collapsing three windows to two. Added a flag +(=cj/--ai-term-last-toggle-deleted-split=) set when toggle-off delete-windows the agent's own +window; =cj/--ai-term-reuse-edge-window= consumes it and falls through to a fresh re-split, so +the agent returns to its own window and the others are untouched. The flag only changes the 3+ +window case (2-window slot-reuse unchanged). TDD regression +=test-ai-term--reuse-edge-window-3win-toggle-restores-own-window=; full =make test= green; +live-reloaded. Commit 64916462. GUI sign-off is a VERIFY under Manual testing and validation. +** DONE [#B] Codebase refactoring program — remaining batch :refactor:solo: +CLOSED: [2026-06-20 Sat] +Complete 2026-06-20: all 13 scan findings addressed across the day's sessions (see +=.ai/sessions/= for the logs). 5 medium extractions + 2 big single-file refactors + +6 theme-studio items including the browser-gates harness rewrite. The only item not +done is the item-8 plan() factory, consciously skipped as premature abstraction +(heterogeneous call sites — see "Remaining — item-8 plan() factory" below). +The original scan: full-codebase 8-agent fan-out over modules/ + scripts/theme-studio/, +one focused refactor per commit, won't-do items excluded. + +*** Working protocol (apply to every item) +- TDD: write/keep a failing-then-green test; harvest new test seams the refactor opens. +- Behavior-preserving only. If a "dedup" would delete a real test seam or couple + dissimilar code, SKIP it and record why (see skips below). +- Per refactor, verify in this order, then commit + push (no-approvals mode): + 1. =make test-file FILE=<basename.el>= for touched + new tests. + 2. =make validate-modules= (loads all 123 modules; catches load/paren errors). + 3. Init-launch smoke on a throwaway daemon: =emacs --daemon=cj-sNN=, then + =emacsclient -s cj-sNN -e '(emacs-pid)'= to capture the PID, check + =(length features)= = 807 and no init errors in the log, then kill by that + PID (the emacsclient kill-emacs is flaky; pkill -f 'daemon=cj-sNN' + self-matches its own shell — kill the captured PID). + 4. Live-reload the edited module into Craig's running daemon + (=emacsclient -e '(load "/home/cjennings/.emacs.d/modules/<m>.el")'=); skip + the live reload for big use-package modules whose :config restacks (verify via + the fresh smoke daemon instead, as with mail-config). +- Tab-heavy files: =sed -n 'A,Bp' FILE | cat -A= to get exact bytes before an Edit; + write NEW code in the documented 2-space style. +- Shared asset already created: =cj/format-region-with-program= in system-lib.el + (the run-a-formatter-over-the-buffer helper). Reuse it for any further + format-region duplicates. + +*** DONE — medium extractions (2026-06-20 afternoon) +All five shipped: calibredb-epub nov re-render/centering helpers (fccf29b0); +ai-term toggle-off teardown + working-buffer swap (62fee96b); calendar-sync +per-event exception parser (23f405b4); dirvish playlist-target resolution +(a1ca2fb0); custom-case per-word title-case decision (4cc9ca0b). + +*** DONE — big single-file + theme-studio (2026-06-20 afternoon, no-approvals run) +Both big single-file items shipped: dwim-shell branching command builders +(f93b4615); custom-comments divider/box generator dedup (42f0c88a). Five of the +six theme-studio items shipped: face_coverage path_kind (9a52370b), +capture-default-faces condition_matches unify (28b4d1cf), dropdownRowTextColor +delete (10a56789), test-file inline-integrity dedup — subTest loop + shared +inline-strip.mjs (13969c70), generate.py lazy _build()/__getattr__ (6df4ebdc), +browser-gates assertPreviewFaces for the 3 preview gates (5627f137). + +*** DONE — browser-gates harness rewrite (with Craig's go-ahead, 2026-06-20) +- =gate(id, body)= helper (05697e83): the 38 standard gates' ok/notes/A + title + + result-div boilerplate, note format standardized to " fails=". Each call site keeps + its literal =location.hash==='#NAMEtest'=. 6 custom gates stay inline. First automated + attempt deleted gates (a closing-finder spanned boundaries) — caught by a gate-count + guard, reverted, redone anchored on each gate's unique =d.id=. Verified all 44 green + + a forced A(false) in a converted gate still FAILs. +- =withSavedState(keys, body)= (a473aa7c): wraps the 7 restore-nothing gates, scoped to + the globals each mutates; JSON-clone snapshot + finally-restore (structuredClone threw + on the studio objects — caught by the gate run as "no verdict", switched to JSON like + the gates' own local saves). The 14 self-restoring gates left as-is. Verified 44 green, + restore round-trip holds, broken assertion in a wrapped gate still FAILs. + +*** Remaining — item-8 plan() factory (deferred, low value) +The =plan(overrides)= factory for the ~30 planPaletteGenerator calls (test-app-core.mjs ++ test-palette-generator-core.mjs) was deferred. The calls pass heterogeneous options +(scheme/accentCount/sourceMode/vibe/intent vary per call); a factory only dedups the +constant spanCount:0/rng and would hide which options each test actually exercises — +premature abstraction over varying calls. The other two item-8 parts (subTest loop + +shared stripExports) shipped in 13969c70. + +*** WON'T-DO (do not re-attempt — assessed and rejected) +- theme-studio buildTable/buildUITable/buildPkgTable merge: genuine per-tier divergence + (column order, syntax dual fg/bg dropdowns, ui preview cell, pkg nd markers) + the + =.cells[N]= positional sort coupling make a unified builder MORE complex than the + three explicit ones. Close as won't-do. +- Cross-language test overlap (browser-gates preview gate vs test_generate.py + PackageFaceCoverage): don't merge — would couple a fast Python test to a headless + browser run. A one-line comment in each noting the split is the most that's worth it. + +*** Skipped this run (with reasons — don't redo) +- eshell-config ssh-alias "merge the two helpers": =cj/--eshell-ssh-alias-commands= is + a deliberate pure/effectful split with 3 dedicated tests; merging deletes the seam. +- prog-*-setup boilerplate: only python+webdev share the full pattern; shell/c/elisp/ + common-lisp differ materially. A keyword-arg helper would be less readable. No + premature abstraction. +- erc join-command =cj/erc--ensure-active-connection= extraction: nesting-only on + untestable UI (call-interactively/switch-to-buffer), no test seam, risky tab-rewrite. +- coverage-core =simplecov-executable-lines= vs =parse-simplecov= clone: borderline + MEDIUM, differs only by a =(> hits 0)= predicate; parameterize with a keep-line-p + only if revisiting. Low priority. +** CANCELLED [#A] calendar-sync drops final occurrences, resurrects cancelled meetings :bug:solo:next: +CLOSED: [2026-06-20 Sat 22:51] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-13 +:END: +Needs from Craig: a real .ics fixture (or two) that reproduces both symptoms — a recurring event missing its final occurrence, and a cancelled meeting that reappears. This is RFC-5545 recurrence handling (RRULE/UNTIL/EXDATE/STATUS:CANCELLED); I won't guess-patch the parser without a failing case to test against. Drop a sanitized .ics and I'll write the characterization test + fix. +RFC 5545 conformance holes in =modules/calendar-sync.el=, all agenda-visible (from the 2026-06 config audit): +- =:973,1015,1024= — UNTIL treated as exclusive (strict =calendar-sync--before-date-p=); RFC and Google make it inclusive, so the LAST instance of every UNTIL-bounded series vanishes. Tests assert loose count ranges, so it's unpinned. Allow equality. +- =:578= — comma-separated EXDATE lists (Google emits them) never parse; the exclusion drops silently and cancelled occurrences reappear on the agenda. Split on "," before parsing; no comma-case test exists. +- =:902= — timed events without DTEND render as all-day (time lost); multi-day all-day spans collapse to one day (end date unused, exclusive-DTEND unhandled). Emit start-time-only stamps and org date ranges. +----- + +2026-06-20 Sat @ 22:52:51 -0400 Can't reproduce. closing +** DONE [#A] Native compilation disabled config-wide; GC at stock 800KB :bug:next: +CLOSED: [2026-06-20 Sat] +Both fixed 2026-06-20. =early-init.el:69= was =(setq native-comp-deferred-compilation nil)= — the obsolete alias of =native-comp-jit-compilation= — which turned JIT native-comp OFF entirely (not "synchronous"); replaced with =(setq native-comp-jit-compilation t)= + =native-comp-async-report-warnings-errors 'silent=. The old "Selecting deleted buffer" async race was an Emacs 28/29 issue; this is 30.2. GC: dropped the early-init post-startup restore to stock 800KB and the system-defaults minibuffer setup/exit hooks, replaced with gcmh (idle-delay 'auto, 1GB high threshold) — keeps the threshold high during activity, collects on idle. Verified via a clean throwaway-daemon launch (native-comp-jit t, gcmh-mode t, no backtrace) and a batch proof of gcmh's threshold cycle; applied live to the running daemon. Restart confirmation filed under Manual testing and validation. +** DONE [#C] Dirvish: free D for hard-delete, move duplicate :feature:quick:next: +CLOSED: [2026-06-20 Sat] +Decided with Craig 2026-06-20: remove delete-to-trash entirely, bind =d= = =cj/dirvish-duplicate-file= and =D= = =cj/dirvish-hard-delete= (sudo rm -rf after a =yes-or-no-p= naming the exact targets). Built in =modules/dirvish-config.el= (=cj/--dirvish-hard-delete-command= pure builder + =cj/dirvish-hard-delete= command; keymap =d=/=D= swap). 4 ERT tests for the command builder; full suite green; live-reloaded into the daemon (=dirvish-mode-map= =d=/=D= rebinding confirmed). Manual keypress + sudo-flow check filed under Manual testing and validation. +** DONE [#C] Pull a fullscreen terminal window away with C-; b + arrow :feature:next: +CLOSED: [2026-06-20 Sat] +Decided with Craig 2026-06-20: when the selected window is the sole window, =C-; b= + arrow keeps that window on the arrow's edge and slivers =other-buffer= in on the opposite side (=minimize-window=, so the current window keeps almost the whole frame), focus staying put; each further arrow then shrinks it step by step via =windsize=, reading the same as resizing an existing split. Generalizes to any sole window, not just terminals — resize was a no-op there before. Built in =modules/ui-navigation.el= (=cj/window-pull-side= pure mapping + =cj/window--pull-away= + a =one-window-p= branch in =cj/window-resize-sticky=). ERT tests for the mapping and both sticky paths; geometry verified in a headless frame (down -> terminal 37/40 at the bottom, reveal 2 lines slivered on top via window-min-height=1, windsize-down then steps it down); full suite green; live-reloaded into the daemon. Refined from a first cut that split toward the arrow and jumped to 50%, per Craig's feedback. Manual gesture check filed under Manual testing and validation. +** DONE [#B] Migrate All Terminals From Vterm to Ghostel +CLOSED: [2026-06-20 Sat 22:50] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-04 +:END: +Replace vterm with ghostel (libghostty-vt) as the single terminal engine across every workflow, and rename ai-vterm → ai-term. References: [[file:docs/2026-05-25-emacs-terminal-comparison.org][docs/2026-05-25-emacs-terminal-comparison.org]] (vterm vs eat vs ghostel research); migration spec [[id:b54c94a0-d762-4b41-afd7-cf5593ce6675][docs/specs/vterm-to-ghostel-migration-spec-implemented.org]] (READY; external review incorporated 2026-06-04, D1-D7 agreed). Build in 5 phases (0-4); see the spec's Implementation tasks block. + +Decisions D1-D7 are settled in the spec's Agreed-decisions section. Build order below; each phase stays green (suite + byte-compile) at every step. + +*** 2026-06-20 Sat @ 22:49:41 -0400 Follow-up: theme ghostel ANSI faces in dupre +D2 — set the 16 ghostel-color-* + ghostel-default faces in dupre-faces/palette. +Roam-inbox note (2026-06-14): theme-studio assignments don't reach ghostel — it paints from its own ANSI palette, not the theme. Also investigate ghostel's property-file color mechanism as an alternative and surface the options for working with that limitation. + +*** 2026-06-20 Sat @ 22:50:28 -0400 CANCELLED [#B] Follow-up: evaluate ghostel-eshell + ghostel-compile +CLOSED: [2026-06-20 Sat 22:49] +D3 — ghostel-eshell as eshell visual backend; ghostel-compile against F4 dev-fkeys. + +*** 2026-06-20 Sat @ 22:50:32 -0400 DONE [#B] Investigate ghostel selection/highlight color +CLOSED: [2026-06-20 Sat 22:50] +Look at how selected text is highlighted in a ghostel buffer — the region face in =ghostel-copy-mode= and any live selection — surfaced during the copy-mode debugging. Check whether the highlight is legible against the dupre background and consistent with the rest of the config; if it needs theming, fold it in with D2 (theming the ghostel faces in dupre). + +*** 2026-06-04 Thu @ 23:57:09 -0500 Phase 0 done: characterization baseline green +=make test= green except the 5 documented pre-existing failures (4 test-dupre-theme, 1 test-init-module-headers), none terminal-related. Characterization coverage already present + green for all six must-survive behaviors: vterm-toggle--dispatch/display/buffer-filter, vterm-tmux-history, ai-vterm--show-or-create/launch-command/f9-in-vterm, ui-config--buffer-cursor-state + vterm-copy-mode-cursor, dashboard-config-launchers. Add a characterization test before any behavior change in later phases if a gap appears. + +*** 2026-06-05 Fri @ 00:38:34 -0500 Phase 1 done: ghostel + term-config.el +=modules/term-config.el= written (full port of vterm-config: tmux history/copy-mode-dwim preserved via process-tty-name + ghostel-send-string; F12 toggle + display rule + geometry; cj/term-map C-; x menu → ghostel commands; which-key "terminal menu"; ghostel-max-scrollback 10MB; C-; added to ghostel-keymap-exceptions; F12 + C-; in ghostel-mode-map; use-package ghostel guarded per D6). Dropped: mouse-wheel SGR forwarding, vterm-timer-delay hacks, copy-mode cursor hook, goto-address hook. ghostel installed into elpa (MELPA + auto-downloaded native module). Tests: test-term-toggle--{dispatch,display,buffer-filter} + test-term-tmux-history (16) ported with a ghostel stub in testutil-ghostel-buffers; all green. + +*** 2026-06-05 Fri @ 00:38:34 -0500 Phase 2 done: ai-vterm→ai-term on ghostel +=modules/ai-vterm.el= → =modules/ai-term.el=: 6 vterm call sites swapped to ghostel (buffer named via let-bound ghostel-buffer-name + pinned ghostel-buffer-name-function so OSC titles don't rename agent buffers); F9/C-F9/M-F9 on global + ghostel-mode-map; refuse-in-terminal guard removed (D4 — F9 launches in TTY frames); tmux-suppression invariant preserved (cj/--ai-term-suppress-tmux). 23 ai-vterm tests renamed → test-ai-term--* (terminal-guard test deleted, obsolete); show-or-create + f9-in-term rewritten for ghostel; all green. ui-config cursor-state ported (ghostel-mode + ghostel--input-mode; copy/emacs = read-only, else writeable) + its test. init.el now requires term-config + ai-term; vterm-config.el + ai-vterm.el deleted. Full suite green except the 5 documented pre-existing failures (4 dupre-theme, 1 init-module-headers/popper-config-missing — both unrelated). validate-modules ✓; full early-init+init smoke clean (no ghostel/term/ai-term errors). vterm package still installed (Phase 4) — dashboard "Launch VTerm" + dormant auto-dim still reference it until Phase 3/4. Restart Emacs to pick up ghostel (load-order + use-package :config change). + +*** 2026-06-05 Fri @ 00:50:58 -0500 Phase 3 done: satellites ported to ghostel +Deleted auto-dim's vterm color-advice + redraw integration (~165 lines; D1 — terminals don't dim, ghostel bakes its palette per-terminal so there's no per-window color hook); dashboard launcher → =(ghostel)= + "Launch Terminal" label; cj-window-geometry/toggle-lib doc comments; module-inventory + init-load-graph doc refs. (ui-config cursor-state + init.el requires landed in Phase 2.) Trimmed test-auto-dim-config (dropped the 6 vterm tests) + updated the dashboard-launcher test stub. Incidental: removed the stale =popper-config= entry from the test-init-module-headers allowlist (the file doesn't exist + isn't required) — fixes the long-standing pre-existing test failure. + +*** 2026-06-05 Fri @ 00:50:58 -0500 Phase 4 done: vterm + vterm-toggle removed +=package-delete='d vterm + vterm-toggle from elpa. No vterm refs remain in modules/init except intentional historical comments. Suite green except the 4 pre-existing dupre-theme failures (the popper-config one is now fixed). validate-modules ✓; full early-init+init batch smoke = INIT-SMOKE-OK. The migration parent stays DOING until Craig restarts Emacs and walks the ghostel manual-verify matrix under "Emacs Manual Testing and Validation". + +*** 2026-06-05 Fri @ 14:24:02 -0500 Auto-dim revisit cancelled — current no-dim behavior is fine +Craig confirmed the shipped auto-dim setup works fine as-is: terminal buffers don't participate in unfocused-window dimming (D1), and the rest of auto-dim behaves. That is the measured decision the original task asked for — option (a), keep no-dim — so no rework (the focus-loss palette-blend in option (b) or an upstream per-window hook in option (c)) is needed. Closing without further investigation. Context: [[id:b54c94a0-d762-4b41-afd7-cf5593ce6675][migration spec]] D1. + +*** 2026-05-26 Tue @ 15:15:43 -0500 Direction confirmed; Claude Code in eat needs a caveat +Craig confirmed the consolidation: one terminal engine everywhere — eat for standalone terminal buffers (replacing vterm) plus =eat-eshell-mode= as eshell's visual backend, keeping eshell as the shell. Not dropping eshell for eat + zsh. + +Researched whether Claude Code runs cleanly in eat (Craig runs it in his Emacs terminal). Verdict: mostly, with caveats. eat is the default backend for claude-code.el and renders the TUI with color and full key handling, but there is an eat-specific bug where Claude Code's input handling makes the buffer scroll-pop to the top on window-buffer changes and the input box can get stuck mid-buffer (recoverable, but it does not happen in vterm or ghostel), and eat runs about 1.5x slower than vterm on heavy streaming output. claude-code.el's own docs name ghostel as the most faithful Claude TUI renderer. + +Recommendation: consolidate everyday terminals onto eat, but keep ghostel (or vterm) for the Claude Code workflow specifically — the scroll-pop / stuck-input bug and the slower heavy-stream handling are exactly what bites a long Claude session. Sources: [[https://github.com/cpoile/claudemacs][claudemacs]], [[https://github.com/stevemolitor/claude-code.el][claude-code.el]], [[https://codeberg.org/akib/emacs-eat][emacs-eat]]. + +Eval plan (from the research doc): install EAT alongside vterm, run the same workloads through both, decide. Test matrix: Claude Code TUI, lazygit, htop/btop, yazi, a heavy-output build, ssh to a remote, and eshell with =eat-eshell-mode=. Assess rendering fidelity, stability under heavy output, and Emacs-native line editing. Switch only if it covers every workflow without regression. + +*** 2026-06-02 Tue @ 14:12:48 -0500 Audit: eval plan not yet run; back to TODO +Task audit found no eval work recorded since the 2026-05-26 direction-confirmed note. The test matrix above is unrun, so the task isn't actively in progress — moved DOING back to TODO until the eval starts. + +*** 2026-06-04 Thu @ 22:40:27 -0500 Pivot: ghostel as the single engine (not eat) +Direction changed from eat-everyday + ghostel-for-Claude to ghostel-for-everything, and the task is now a migration rather than an eval. Rationale: ghostel is claude-code.el's most-faithful Claude TUI renderer and the fastest engine (81 vs vterm 34 vs eat 4.9 MB/s), and an audit confirmed it exposes an analog for every vterm primitive this config uses (=ghostel-send-string=, =ghostel-keymap-exceptions=, =ghostel-copy-mode=, =ghostel-clear-scrollback=, =ghostel-send-next-key=, =ghostel-next-prompt= / =ghostel-previous-prompt=, =ghostel-max-scrollback=, =ghostel-kill-buffer-on-exit=). eat's washed colors, the scroll-pop / stuck-input bug under Claude Code, and slowest throughput made it the weaker single-engine pick; one engine beats running two. Surface audited: 2 main modules (=vterm-config.el=, =ai-vterm.el=) + 4 satellites (=auto-dim-config.el= is the heavy one) + ~35 test files + init.el. Next: spike ghostel read-only to answer the open migration questions (auto-dim rework — ARCHITECTURE.md forbids the around-redraw color advice vterm uses; tmux pane-id via =process-tty-name= on a ghostel process; buffer naming; TTY-frame behavior; copy-mode keybinding parity), then write the migration spec under =docs/design/= and review it. + +*** 2026-06-04 Thu @ 23:17:54 -0500 Spec review: not ready until decisions and handoff shape are closed +Ran the spec-review workflow against [[id:b54c94a0-d762-4b41-afd7-cf5593ce6675][docs/specs/vterm-to-ghostel-migration-spec-implemented.org]] and wrote a companion review file (incorporated and deleted 2026-06-04). Verdict: =Not ready=. Direction is sound, but the draft still has open D1-D5 decisions, lacks the workflow-required =Implementation phases= section and acceptance criteria, and needs explicit ghostel package/native-module failure behavior before implementation tasks can be emitted. + +*** 2026-06-04 Thu @ 23:24:28 -0500 Spec-response: review incorporated, raised to READY +Folded the external review via spec-response. Craig accepted D1-D5; baked them plus D6 (module-failure = degrade-with-warning, modifying the reviewer's fail-loud) and D7 (=ghostel-max-scrollback= 10 MB) into a new Agreed-decisions section. Added Implementation phases (0-4), Acceptance criteria, Dependency/module-failure behavior, Test strategy, per-phase key/menu ownership, the tmux-suppression contract, and an Implementation-tasks drop-in block. Status DRAFT → READY; review file deleted. Build is now unblocked. + +*** 2026-06-04 Thu @ 23:30:18 -0500 External re-review: ready +Re-reviewed [[id:b54c94a0-d762-4b41-afd7-cf5593ce6675][docs/specs/vterm-to-ghostel-migration-spec-implemented.org]] after incorporation. Verdict: =Ready=. No further blocking review notes; implementation can start from the phase plan and acceptance criteria in the spec. +** DONE [#A] erc-yank silently publishes >5-line pastes as public gists :bug:quick:solo: +CLOSED: [2026-06-20 Sat] +Dropped erc-yank 2026-06-20 (Craig's call: drop, not harden). The package turned a >5-line paste into a PUBLIC gist (=gist -P=, the clipboard-paste flag, no =--private=) behind a single y-or-n-p, with no executable-find guard for =gist=. It also gisted the system clipboard rather than the kill-ring text being yanked. No replacement binding needed: =erc-mode-map= defines no C-y of its own, so removing the package lets C-y fall through to the ordinary global =yank=. Verified live: effective C-y in an ERC buffer = =yank=. (Audit's "no confirmation" was slightly off — the package did prompt — but public-by-default + one-keystroke confirm + no guard made dropping it the clean fix.) +** CANCELLED [#C] page-signal pager account deregistered — re-registration needs your hands +CLOSED: [2026-06-21 Sun] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-12 +:END: +Reported by .emacs.d 2026-06-12 01:01: the dedicated pager number (+15045173983, the Claude Pager Google Voice number on signal-cli) returns "User ... is not registered" on every send — Signal appears to have deregistered it (GV numbers get periodically re-verified). Re-registration requires captcha/SMS, which only you can do. Until then every page-signal call fails; .emacs.d's config-audit page fell back to email. Wrapper lives at claude-templates/bin/page-signal. +** CANCELLED [#C] Lock screen silently fails — slock is X11-only :bug:quick: +CLOSED: [2026-06-21 Sun] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-13 +:END: +=modules/system-commands.el:105= binds the lockscreen command to =slock=, which can't grab a Wayland session; =cj/system-cmd= launches it detached with output silenced, so C-; ! l does nothing and the screen never locks. Security issue: Craig believes the screen locks when it doesn't. Fix: =hyprlock= (or =swaylock=), ideally resolved per session type via =env-wayland-p= so an X11 fallback survives for other machines. From the 2026-06 config audit. +Fixed 2026-06-13: lockscreen-cmd resolves to =loginctl lock-session= on Wayland (logind Lock → hypridle → hyprlock, the path idle/sleep locking already uses), =slock= on X11; also added the missing =(require 'host-environment)=. Live in the daemon; manual lock test under the Manual testing parent. +** CANCELLED [#C] the preview splits an already split window into 3 temporarily. :bug: +CLOSED: [2026-06-21 Sun] +looks strange. potentially problematic for ai-terms. +** CANCELLED [#C] TRAMP/dirvish "?" for remote dates — verify the fix per host :bug: +CLOSED: [2026-06-21 Sun] +:PROPERTIES: +:LAST_REVIEWED: 2026-06-02 +:END: + +Root cause is traced (see the dated investigation entry below). What's left needs a live remote: open each remote host in dirvish and run the three diagnostic evals to find which gate is closed, then close it. + +Diagnostics (run with point in a remote dirvish buffer): +- =M-: (dirvish-prop :remote-async)= — nil means =tramp-direct-async-process-p= is failing for this method/host, so dirvish's remote attribute fetch never runs. +- =M-: (dirvish-prop :gnuls)= — nil means the remote has no GNU =ls= (the =ls --version= probe failed), so the parser gate stays shut. Likely on truenas (FreeBSD). +- =M-: (tramp-direct-async-process-p)= — confirms whether direct-async is actually active for the connection. + +Likely fixes, by which gate is closed: +- =:gnuls= nil → install GNU coreutils on the remote (FreeBSD: =pkg install coreutils=) and make =ls= resolve to GNU on the TRAMP path, or accept "?" on that host. + + - Constraint: nothing gets installed on the remote host, so the =:gnuls= gate is resolved by accepting "?" on that host rather than installing coreutils. +- =:remote-async= nil → the scp/sshx method isn't advertising direct-async; switch to a method that supports it or check =tramp-direct-async-process= is taking effect for that protocol. + +Files involved: =modules/tramp-config.el=, =modules/dirvish-config.el=. + +*** 2026-05-22 Fri @ 20:24:44 -0500 Traced the root cause through dirvish source +Remote dates/sizes don't come from the dired =ls= listing or =dired-listing-switches=. They come from =dirvish-data-for-dir= (=dirvish-tramp.el:95=), which runs =ls -1lahi= on the remote and parses the columns into the attribute cache. That method only fires when both =(dirvish-prop :remote-async)= is a number and =(dirvish-prop :gnuls)= is a string. When either gate is shut, dirvish falls back to its default, which deliberately skips =(file-attributes f-name)= for remote files (=dirvish.el:904=, a perf guard) — leaving attrs nil, so the file-size and file-time widgets render "?" (=dirvish-widgets.el:216,247=). + +That explains why every prior fix missed: dired-listing-switches feed a different code path entirely, and disabling =tramp-direct-async-process= shuts the =:remote-async= gate, which is the one path that populates remote attributes — exactly backwards. The config already enables direct-async for ssh/sshx (=tramp-config.el:79-88=), so the remaining closed gate is per-host: =:gnuls= (no GNU ls on FreeBSD-based truenas) or direct-async not taking effect for the method. Could not verify on a live remote from the work session — handed the per-host diagnostics up into the task body. diff --git a/custom/c-boxes.el b/custom/c-boxes.el deleted file mode 100644 index 273b783ab..000000000 --- a/custom/c-boxes.el +++ /dev/null @@ -1,407 +0,0 @@ -;;; Boxed comments for C mode. -;;; Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc. -;;; Francois Pinard <pinard@iro.umontreal.ca>, April 1991. -;;; -;;; I often refill paragraphs inside C comments, while stretching or -;;; shrinking the surrounding box as needed. This is a real pain to -;;; do by hand. Here is the code I made to ease my life on this, -;;; usable from within GNU Emacs. It would not be fair giving all -;;; sources for a product without also giving the means for nicely -;;; modifying them. -;;; -;;; The function rebox-c-comment adjust comment boxes without -;;; refilling comment paragraphs, while reindent-c-comment adjust -;;; comment boxes after refilling. Numeric prefixes are used to add, -;;; remove, or change the style of the box surrounding the comment. -;;; Since refilling paragraphs in C mode does make sense only for -;;; comments, this code redefines the M-q command in C mode. I use -;;; this hack by putting, in my .emacs file: -;;; -;;; (setq c-mode-hook -;;; '(lambda () -;;; (define-key c-mode-map "\M-q" 'reindent-c-comment))) -;;; (autoload 'rebox-c-comment "c-boxes" nil t) -;;; (autoload 'reindent-c-comment "c-boxes" nil t) -;;; -;;; The cursor should be within a comment before any of these -;;; commands, or else it should be between two comments, in which case -;;; the command applies to the next comment. When the command is -;;; given without prefix, the current comment box type is recognized -;;; and preserved. Given 0 as a prefix, the comment box disappears -;;; and the comment stays between a single opening `/*' and a single -;;; closing `*/'. Given 1 or 2 as a prefix, a single or doubled lined -;;; comment box is forced. Given 3 as a prefix, a Taarna style box is -;;; forced, but you do not even want to hear about those. When a -;;; negative prefix is given, the absolute value is used, but the -;;; default style is changed. Any other value (like C-u alone) forces -;;; the default box style. -;;; -;;; I observed rounded corners first in some code from Warren Tucker -;;; <wht@n4hgf.mt-park.ga.us>. - -(defvar c-box-default-style 'single "*Preferred style for box comments.") -(defvar c-mode-taarna-style nil "*Non-nil for Taarna team C-style.") - -;;; Set or reset the Taarna team's own way for a C style. - -(defun taarna-mode () - (interactive) - (if c-mode-taarna-style - (progn - - (setq c-mode-taarna-style nil) - (setq c-indent-level 2) - (setq c-continued-statement-offset 2) - (setq c-brace-offset 0) - (setq c-argdecl-indent 5) - (setq c-label-offset -2) - (setq c-tab-always-indent t) - (setq c-box-default-style 'single) - (message "C mode: GNU style")) - - (setq c-mode-taarna-style t) - (setq c-indent-level 4) - (setq c-continued-statement-offset 4) - (setq c-brace-offset -4) - (setq c-argdecl-indent 4) - (setq c-label-offset -4) - (setq c-tab-always-indent t) - (setq c-box-default-style 'taarna) - (message "C mode: Taarna style"))) - -;;; Return the minimum value of the left margin of all lines, or -1 if -;;; all lines are empty. - -(defun buffer-left-margin () - (let ((margin -1)) - (goto-char (point-min)) - (while (not (eobp)) - (skip-chars-forward " \t") - (if (not (looking-at "\n")) - (setq margin - (if (< margin 0) - (current-column) - (min margin (current-column))))) - (forward-line 1)) - margin)) - -;;; Return the maximum value of the right margin of all lines. Any -;;; sentence ending a line has a space guaranteed before the margin. - -(defun buffer-right-margin () - (let ((margin 0) period) - (goto-char (point-min)) - (while (not (eobp)) - (end-of-line) - (if (bobp) - (setq period 0) - (backward-char 1) - (setq period (if (looking-at "[.?!]") 1 0)) - (forward-char 1)) - (setq margin (max margin (+ (current-column) period))) - (forward-char 1)) - margin)) - -;;; Add, delete or adjust a C comment box. If FLAG is nil, the -;;; current boxing style is recognized and preserved. When 0, the box -;;; is removed; when 1, a single lined box is forced; when 2, a double -;;; lined box is forced; when 3, a Taarna style box is forced. If -;;; negative, the absolute value is used, but the default style is -;;; changed. For any other value (like C-u), the default style is -;;; forced. If REFILL is not nil, refill the comment paragraphs prior -;;; to reboxing. - -(defun rebox-c-comment-engine (flag refill) - (save-restriction - (let ((undo-list buffer-undo-list) - (marked-point (point-marker)) - (saved-point (point)) - box-style left-margin right-margin) - - ;; First, find the limits of the block of comments following or - ;; enclosing the cursor, or return an error if the cursor is not - ;; within such a block of comments, narrow the buffer, and - ;; untabify it. - - ;; - insure the point is into the following comment, if any - - (skip-chars-forward " \t\n") - (if (looking-at "/\\*") - (forward-char 2)) - - (let ((here (point)) start end temp) - - ;; - identify a minimal comment block - - (search-backward "/*") - (setq temp (point)) - (beginning-of-line) - (setq start (point)) - (skip-chars-forward " \t") - (if (< (point) temp) - (progn - (goto-char saved-point) - (error "text before comment's start"))) - (search-forward "*/") - (setq temp (point)) - (end-of-line) - (if (looking-at "\n") - (forward-char 1)) - (setq end (point)) - (skip-chars-backward " \t\n") - (if (> (point) temp) - (progn - (goto-char saved-point) - (error "text after comment's end"))) - (if (< end here) - (progn - (goto-char saved-point) - (error "outside any comment block"))) - - ;; - try to extend the comment block backwards - - (goto-char start) - (while (and (not (bobp)) - (progn (previous-line 1) - (beginning-of-line) - (looking-at "[ \t]*/\\*.*\\*/[ \t]*$"))) - (setq start (point))) - - ;; - try to extend the comment block forward - - (goto-char end) - (while (looking-at "[ \t]*/\\*.*\\*/[ \t]*$") - (forward-line 1) - (beginning-of-line) - (setq end (point))) - - ;; - narrow to the whole block of comments - - (narrow-to-region start end)) - - ;; Second, remove all the comment marks, and move all the text - ;; rigidly to the left to insure the left margin stays at the - ;; same place. At the same time, recognize and save the box - ;; style in BOX-STYLE. - - (let ((previous-margin (buffer-left-margin)) - actual-margin) - - ;; - remove all comment marks - - (goto-char (point-min)) - (replace-regexp "^\\([ \t]*\\)/\\*" "\\1 ") - (goto-char (point-min)) - (replace-regexp "^\\([ \t]*\\)|" "\\1 ") - (goto-char (point-min)) - (replace-regexp "\\(\\*/\\||\\)[ \t]*" "") - (goto-char (point-min)) - (replace-regexp "\\*/[ \t]*/\\*" " ") - - ;; - remove the first and last dashed lines - - (setq box-style 'plain) - (goto-char (point-min)) - (if (looking-at "^[ \t]*-*[.\+\\]?[ \t]*\n") - (progn - (setq box-style 'single) - (replace-match "")) - (if (looking-at "^[ \t]*=*[.\+\\]?[ \t]*\n") - (progn - (setq box-style 'double) - (replace-match "")))) - (goto-char (point-max)) - (previous-line 1) - (beginning-of-line) - (if (looking-at "^[ \t]*[`\+\\]?*[-=]+[ \t]*\n") - (progn - (if (eq box-style 'plain) - (setq box-style 'taarna)) - (replace-match ""))) - - ;; - remove all spurious whitespace - - (goto-char (point-min)) - (replace-regexp "[ \t]+$" "") - (goto-char (point-min)) - (if (looking-at "\n+") - (replace-match "")) - (goto-char (point-max)) - (skip-chars-backward "\n") - (if (looking-at "\n\n+") - (replace-match "\n")) - (goto-char (point-min)) - (replace-regexp "\n\n\n+" "\n\n") - - ;; - move the text left is adequate - - (setq actual-margin (buffer-left-margin)) - (if (not (= previous-margin actual-margin)) - (indent-rigidly (point-min) (point-max) - (- previous-margin actual-margin)))) - - ;; Third, select the new box style from the old box style and - ;; the argument, choose the margins for this style and refill - ;; each paragraph. - - ;; - modify box-style only if flag is defined - - (if flag - (setq box-style - (cond ((eq flag 0) 'plain) - ((eq flag 1) 'single) - ((eq flag 2) 'double) - ((eq flag 3) 'taarna) - ((eq flag '-) (setq c-box-default-style 'plain) 'plain) - ((eq flag -1) (setq c-box-default-style 'single) 'single) - ((eq flag -2) (setq c-box-default-style 'double) 'double) - ((eq flag -3) (setq c-box-default-style 'taarna) 'taarna) - (t c-box-default-style)))) - - ;; - compute the left margin - - (setq left-margin (buffer-left-margin)) - - ;; - temporarily set the fill prefix and column, then refill - - (untabify (point-min) (point-max)) - - (if refill - (let ((fill-prefix (make-string left-margin ? )) - (fill-column (- fill-column - (if (memq box-style '(single double)) 4 6)))) - (fill-region (point-min) (point-max)))) - - ;; - compute the right margin after refill - - (setq right-margin (buffer-right-margin)) - - ;; Fourth, put the narrowed buffer back into a comment box, - ;; according to the value of box-style. Values may be: - ;; plain: insert between a single pair of comment delimiters - ;; single: complete box, overline and underline with dashes - ;; double: complete box, overline and underline with equal signs - ;; taarna: comment delimiters on each line, underline with dashes - - ;; - move the right margin to account for left inserts - - (setq right-margin (+ right-margin - (if (memq box-style '(single double)) - 2 - 3))) - - ;; - construct the box comment, from top to bottom - - (goto-char (point-min)) - (cond ((eq box-style 'plain) - - ;; - construct a plain style comment - - (skip-chars-forward " " (+ (point) left-margin)) - (insert (make-string (- left-margin (current-column)) ? ) - "/* ") - (end-of-line) - (forward-char 1) - (while (not (eobp)) - (skip-chars-forward " " (+ (point) left-margin)) - (insert (make-string (- left-margin (current-column)) ? ) - " ") - (end-of-line) - (forward-char 1)) - (backward-char 1) - (insert " */")) - ((eq box-style 'single) - - ;; - construct a single line style comment - - (indent-to left-margin) - (insert "/*") - (insert (make-string (- right-margin (current-column)) ?-) - "-.\n") - (while (not (eobp)) - (skip-chars-forward " " (+ (point) left-margin)) - (insert (make-string (- left-margin (current-column)) ? ) - "| ") - (end-of-line) - (indent-to right-margin) - (insert " |") - (forward-char 1)) - (indent-to left-margin) - (insert "`") - (insert (make-string (- right-margin (current-column)) ?-) - "*/\n")) - ((eq box-style 'double) - - ;; - construct a double line style comment - - (indent-to left-margin) - (insert "/*") - (insert (make-string (- right-margin (current-column)) ?=) - "=\\\n") - (while (not (eobp)) - (skip-chars-forward " " (+ (point) left-margin)) - (insert (make-string (- left-margin (current-column)) ? ) - "| ") - (end-of-line) - (indent-to right-margin) - (insert " |") - (forward-char 1)) - (indent-to left-margin) - (insert "\\") - (insert (make-string (- right-margin (current-column)) ?=) - "*/\n")) - ((eq box-style 'taarna) - - ;; - construct a Taarna style comment - - (while (not (eobp)) - (skip-chars-forward " " (+ (point) left-margin)) - (insert (make-string (- left-margin (current-column)) ? ) - "/* ") - (end-of-line) - (indent-to right-margin) - (insert " */") - (forward-char 1)) - (indent-to left-margin) - (insert "/* ") - (insert (make-string (- right-margin (current-column)) ?-) - " */\n")) - (t (error "unknown box style"))) - - ;; Fifth, retabify, restore the point position, then cleanup the - ;; undo list of any boundary since we started. - - ;; - retabify before left margin only (adapted from tabify.el) - - (goto-char (point-min)) - (while (re-search-forward "^[ \t][ \t][ \t]*" nil t) - (let ((column (current-column)) - (indent-tabs-mode t)) - (delete-region (match-beginning 0) (point)) - (indent-to column))) - - ;; - restore the point position - - (goto-char (marker-position marked-point)) - - ;; - remove all intermediate boundaries from the undo list - - (if (not (eq buffer-undo-list undo-list)) - (let ((cursor buffer-undo-list)) - (while (not (eq (cdr cursor) undo-list)) - (if (car (cdr cursor)) - (setq cursor (cdr cursor)) - (rplacd cursor (cdr (cdr cursor)))))))))) - -;;; Rebox a C comment without refilling it. - -(defun rebox-c-comment (flag) - (interactive "P") - (rebox-c-comment-engine flag nil)) - -;;; Rebox a C comment after refilling. - -(defun reindent-c-comment (flag) - (interactive "P") - (rebox-c-comment-engine flag t)) - diff --git a/custom/org-checklist.el b/custom/org-checklist.el index e7d9b4682..170f449e6 100644 --- a/custom/org-checklist.el +++ b/custom/org-checklist.el @@ -47,9 +47,8 @@ ;;; Code: (require 'org) (defvar org-state) -;; FIXME: This library requires -;; https://git.savannah.gnu.org/cgit/a2ps.git/tree/contrib/emacs/a2ps-print.el file -;; It is a part of a2ps distribution. +;; Optional print support: a2ps-print.el ships with a2ps. Without it, checklist +;; reset/export still works, but print commands that call a2ps-buffer are absent. (load "a2ps-print" 'no-error) (defvar a2ps-switches) (declare-function a2ps-buffer "a2ps-print" (argp)) diff --git a/custom/profile-dotemacs.el b/custom/profile-dotemacs.el index f16e8652f..8baee47b2 100644 --- a/custom/profile-dotemacs.el +++ b/custom/profile-dotemacs.el @@ -20,55 +20,16 @@ ;; along with this program. If not, see <http://www.gnu.org/licenses/>. ;;; Commentary: - -;; This is to easily profile your Emacs init file (or any other -;; script-like Emacs Lisp file, for that matter). - -;; It will go over all sexp's (balanced expressions) in the file and -;; run them through `benchmark-run'. It will then show the file with -;; overlays applied in a way that let you easily find out which sexp's -;; take the most time. Since time is relative, it's not the absolute -;; value that counts but the percentage of the total running time. ;; -;; * All other sexp's with a percentage greater than -;; `profile-dotemacs-low-percentage' will be preceded by a -;; highlighted line, showing the results from `benchmark-run'. -;; Also, the more 'reddish' the background of the sexp, the more -;; time it needs. - -;; * All other sexp's will be grayed out to indicate that their -;; running time is miniscule. You can still see the benchmark -;; results in the minibuffer by hovering over the sexp with the -;; mouse. - -;; You can only benchmark full sexp's, so if you wrapped large parts -;; of your init file in some conditional clause, you'll have to remove -;; that for getting finer granularity. - -;;; Usage: - -;; Start emacs as follows: +;; Profiles profile-dotemacs-file by evaluating top-level sexps with +;; benchmark-run, then overlays the source buffer so expensive forms stand out +;; by percentage of total runtime. ;; -;; emacs -Q -l <PATH>/profile-dotemacs.el -f profile-dotemacs +;; Run with: +;; emacs -Q -l /path/to/profile-dotemacs.el -f profile-dotemacs ;; -;; with <PATH> being the path to where this file resides. - -;;; Caveats (thanks to Raffaele Ricciardi for reporting those): - -;; - The usual `--debug-init' for debugging your init file won't work -;; with profile-dotemacs, so you'll have to call -;; `toggle-debug-on-error', either on the commandline or at the -;; beginning of your init file. -;; - `load-file-name' is nil when the init file is being loaded -;; by the profiler. This might matter if you perform the -;; bulk of initializations in a different file. -;; - Starting external shells like IELM or eshell in your init file -;; might mess with overlay creation, so this must not be done. - -;;; Download: - -;; You can always get the latest version from -;; http://randomsample.de/profile-dotemacs.el +;; Full sexps are the unit of measurement; split large conditional blocks before +;; profiling if finer detail is needed. ;;; Code: diff --git a/custom/titlecase-data.el b/custom/titlecase-data.el index a64685861..7415a2104 100644 --- a/custom/titlecase-data.el +++ b/custom/titlecase-data.el @@ -18,91 +18,13 @@ ;; along with this program. If not, see <https://www.gnu.org/licenses/>. ;;; Commentary: - -;; Since the `titlecase' package requires a lot of data, that data lives here so -;; as to not clog up the main package. - -;; Since [[https://github.com/duckwork/titlecase.el/issues/23][Issue #23]] makes -;; a good point that I should like, make more sense in the commentary and README -;; of this repository. At the same time, those couple of comments I wrote in -;; there I don't want to just /delete/, so until I write this up in a proper -;; blog post, I've included it here, in the data file, because this is where -;; these implementation notes will be of most interest. - -;; The only setting you really should need to set is =titlecase-style=, which -;; see. Each of these styles has a different set of rules regarding which words -;; to capitalize in a title. After you've set =titlecase-style=, you can bind -;; the command =titlecase-dwim= to a key, or call it using M-x, and it will -;; either title-case your region (if it's active) or the current line. - -;; The tricky part is figuring out what words to capitalize in the title. - -;; Articles (~a~, ~an~, ~the~) are downcased. - -;; The first word of a title and all "important words" (generally nouns, -;; pronouns, adjectives, verbs, and adverbs) are capitalized. The last word of -;; a title is always capitalized, but only in Chicago, AP, Bluebook, AMA, NY -;; Times, and Wikipedia. - -;; /All/ prepositions are downcased in Chicago, MLA, AP, NY Times, and -;; Wikipedia, regardless of length; for APA, Bluebook, AMA, and Wikipedia, only -;; prepositions shorter than 5 letters are (presumably, capitalize those longer -;; than 5 letters, however only Wikipedia was clear on that point). - -;; Coordinating conjunctions are capitalized in Chicago and APA (presumably), -;; but downcased in MLA, AP, Bluebook, AMA, NY Times, and Wikipedia. - -;; Hyphenated words are tricky: I could possibly figure out a way to have lookup -;; tables to determine when to capitalize the second part of a hyphenated word, -;; but I haven't implemented them yet. At any rate, the rules tend to be vague -;; enough that it's hard to program anyway: For example, Chicago, APA, MLA, and -;; AP lowercase the second word "after a hyphenated prefix (e.g., Mid-, Anti-, -;; Super, etc.) in compound modifiers," but MLA and APA capitalize the second -;; part of "hyphenated major words (e.g., Self-Report not Self-report). - -;; Perhaps unsurprisingly, the AMA (American Medical Association, used in the -;; scientific community) has the most comprehensive capitalization rules around -;; hyphenated words. I'll just copy-paste the bullet points here: - -;; - Lowercase the second word in a hyphenated compound when it is -;; a prefix or suffix (e.g., "Anti-itch","world-wide") or part of a single word. -;; - Capitalize the second word in a hyphenated compound if both words are equal -;; and not suffices or prefixes (e.g., "Cost-Benefit") -;; - Capitalize the first non-Greek letter after a lowercase Greek letter (e.g., -;; "ω-Bromohexanoic") -;; - Lowercase the first non-Greek letter after a capital Greek letter (e.g., -;; "Δ-9-tetrahydrocannabinol") #+end_quote - -;; (The AMA also has a rule about capitilizing the genus but not species -;; epithet, but the lookup on that would be wild as hell, so I trust yall to -;; know on that one.) - -;; ~To~ as an infinitive is downcased in all /except/ AP. This is a rule I -;; simply cannot implement without knowing whether the /next/ word is a verb, -;; which would require expensive lookups, which even then wouldn't be foolproof. - -;; Now that I'm thinking about it, most styles count phrasal verbs (like "play -;; with") as important enough to capitalize, when "with" would usually /not/ be -;; capitalized, but again, open categories like phrasal verbs simply do not work -;; in a package like this. - -;; ALL OF THIS IS TO SAY that titlecase offers a best-effort attempt to -;; titlecase a line or region of text, but you should absolutely -;; double-triple-check against the style guide you're writing for if you're -;; trying for publication or something like that. - -;; SEE ALSO: - -;; Prior art: - -;; - https://emacs.stackexchange.com/questions/66361/#66362 -;; - https://github.com/novoid/title-capitalization.el -;; - https://hungyi.net/posts/programmers-way-to-title-case/ - -;; Rules: - -;; - https://capitalizemytitle.com/#capitalizationrules -;; - https://titlecaseconverter.com/rules/ +;; +;; Data tables for titlecase.el: style-specific lowercase word lists, phrasal +;; verbs, and exceptions used by the title-casing engine. +;; +;; Title casing is best-effort because English style guides disagree and some +;; cases require grammatical knowledge this package does not model. Proofread +;; output before publication. ;;; Code: diff --git a/custom/titlecase.el b/custom/titlecase.el index 439478220..319befefd 100644 --- a/custom/titlecase.el +++ b/custom/titlecase.el @@ -175,7 +175,8 @@ for docs on BEGIN, END and STYLE." titlecase-skip-words-regexps "\\|"))) (goto-char (match-end 0)) - ;; TODO: Document what this does (it's late) + ;; If the skip regexp consumed the final word, exit before the main loop tries + ;; to advance past END. (when (>= (point) end) (throw :done 'skipped))) ;; Phrasal verbs! @@ -210,16 +211,8 @@ for docs on BEGIN, END and STYLE." ((and (memq style titlecase-styles-capitalize-non-short-words) (> (length this-word) titlecase-short-word-length)) (capitalize-word 1)) - ;; Sentence style just capitalizes the first word. Since we can't be - ;; sure how the user has already capitalized anything, we just skip - ;; the current word. HOWEVER, there are times when downcasing the - ;; rest of the sentence is warranted. --- NOTE 2022-05-09: Now I'm - ;; thinking about it, does `sentence' style need to do anything - ;; whatsoever? Maybe I just need to include a test toward the top of - ;; the enclosing function to make `titlecase-default-case-function' - ;; be `downcase-word' if `titlecase-downcase-sentences' is true... or - ;; something of that nature. I might be over-engineering this, is - ;; what I'm saying. Curious, isn't it? + ;; Sentence style either leaves later words unchanged or downcases them, + ;; depending on titlecase-downcase-sentences. ((eq style 'sentence) (funcall (if titlecase-downcase-sentences #'downcase-word diff --git a/custom/utilities/vcf-conversion-helpers.el b/custom/utilities/vcf-conversion-helpers.el index 334edc4e2..4ea340236 100644 --- a/custom/utilities/vcf-conversion-helpers.el +++ b/custom/utilities/vcf-conversion-helpers.el @@ -2,6 +2,9 @@ ;;; Commentary: ;; +;; Helpers for converting exported VCF contacts into org-contacts data. The +;; cleaner normalizes folded fields, birthdays, item-prefixed email/phone fields, +;; and removes cards without useful identifying data before import. ;;; Code: @@ -12,8 +15,8 @@ (insert-file-contents input-vcf) (goto-char (point-min)) - ;; First, clean up multi-line fields (unfold them) BEFORE processing - ;; This ensures PHOTO and other multi-line fields are on single lines + ;; Unfold continuation lines before field-level parsing; PHOTO and NOTE values + ;; often span multiple physical lines in exported VCF files. (goto-char (point-min)) (while (re-search-forward "\n[ \t]+" nil t) (replace-match " " t t)) @@ -57,7 +60,7 @@ (field-value (match-string 3))) (replace-match (format "%s%s:%s" field-type field-params field-value) t t))) - ;; NOW remove unwanted fields (but not the converted TEL/EMAIL fields) + ;; Remove Apple/Google metadata fields after preserving converted TEL/EMAIL data. (let ((remove-patterns '("^PHOTO:.*$" "^X-ABRELATEDNAMES:.*$" @@ -153,7 +156,7 @@ (widen))))))) - ;; Remove VCARDs with no identifying information (in reverse order to preserve positions) + ;; Drop cards with no displayable name, in reverse order to keep positions valid. (dolist (vcard-range (reverse vcards-to-remove)) (delete-region (car vcard-range) (cdr vcard-range)) (message "Removed VCARD with no identifying information"))) diff --git a/docs/design/naming-audit.org b/docs/design/naming-audit.org new file mode 100644 index 000000000..f053ccb25 --- /dev/null +++ b/docs/design/naming-audit.org @@ -0,0 +1,91 @@ +#+TITLE: Naming Audit — Public/Private Boundaries in Owned Elisp +#+AUTHOR: Craig Jennings +#+DATE: 2026-06-29 + +* Purpose + +A one-time audit of symbol-naming boundaries across config-owned Elisp, plus +the standing allowlist future reviews cite instead of re-arguing. The +convention itself lives in =.claude/rules/elisp.md=; this file records what the +scan found and how each finding was classified. + +* Convention (summary) + +- User-facing commands and shared helpers: =cj/name=. +- Private helpers inside cj-owned modules: =cj/--name=. +- Package-like standalone modules: =package-name= for public API, + =package--name= for internals (e.g. =calendar-sync--=, =mouse-trap--=, + =localrepo-=). +- No new unprefixed =defun=/=defvar=/=defcustom=/=defconst= in owned modules. +- Tested private helpers may stay private; the test references them directly. + +* Scan method + +#+begin_src sh +rg -n '^\((defun|defvar|defcustom|defconst|defgroup|defmacro) [^ )/]+' modules custom +#+end_src + +The raw scan over-reports. Two large classes are not findings: + +- *Foreign forward-declarations.* A bare =(defvar foreign-var)= with no value + declares another package's special variable to quiet the byte-compiler. It + defines nothing owned. The bulk of the raw hits are these (=org-*=, =emms-*=, + =lsp-*=, =eat-*=, =mu4e-*=, and so on). +- *Vendored third-party files* under =custom/= (=elpa-mirror.el= =elpamr-=, + =eplot.el= =eplot-=). These keep their upstream prefixes by policy. + +* Findings + +** Renamed (clear low-risk, done 2026-06-29) + +| Old | New | Why | +|------------------------------------------+-------------------------------+-------------------------------------------| +| =car-member= (local-repository.el) | =localrepo--car-member= | Unprefixed, generic name with real | +| | | collision risk; pure non-interactive | +| | | helper used only within its module + | +| | | test. | +|------------------------------------------+-------------------------------+-------------------------------------------| +| =unpropertize-kill-ring= | =cj/--unpropertize-kill-ring= | Unprefixed; non-interactive | +| (system-defaults.el) | | =kill-emacs-hook= function, contained to | +| | | its module + tests. | +|------------------------------------------+-------------------------------+-------------------------------------------| + +** Acceptable package prefixes (allowlist — no change) + +These are deliberate, consistent module prefixes, not unprefixed leaks: + +- =env-= / =env--= — host-environment.el. +- =localrepo-= — local-repository.el (public API + defcustoms). +- =mouse-trap-= / =mouse-trap--= — mousetrap-mode.el. +- =show-kill-= — show-kill-ring.el. +- =my-eww-= / =my-eww--= — eww-config.el. +- =signel-= / =signel--= — signal-config.el. + +** Deferred — needs a focused, approved pass (not unattended) + +Each carries a risk that argues for Craig's eyes rather than a no-approvals +rename: + +- *Keybound / interactive commands*: =toggle-window-split= (bound =M-S-t=), + =ensure-macros-file=, =empty-kill-ring=. A rename touches muscle-memory keys + and =M-x= history; do it with =defalias= shims and a live check. +- *Cross-module macro*: =with-timer= (config-utilities.el, used in wrap-up.el + and an architecture test). A macro rename forces recompilation of every + caller; verify the whole graph. +- *defcustoms*: =theme-file=, =fallback-theme-name= (ui-theme.el). Renaming a + =defcustom= orphans any persisted Customize value; use + =define-obsolete-variable-alias=. (No custom-file currently sets them, so the + risk is latent, not active.) +- *High-blast user constants*: the unprefixed =*-dir= / =*-file= constants in + user-constants.el (=org-dir=, =projects-dir=, =books-dir=, and so on) are + referenced across the whole config. They want their own dedicated rename + task, not a drive-by. + +* Acceptance + +- The scan resolves to: two renames done, a documented allowlist of acceptable + prefixes, and a deferred list with rationale. No unexplained unprefixed owned + symbols remain. +- The two renames are covered by their existing module tests (updated in place). +- Future module reviews cite this file and =elisp.md= rather than re-deriving + the boundary. diff --git a/docs/subr-mock-migration-spec.org b/docs/subr-mock-migration-spec.org new file mode 100644 index 000000000..26f1dd576 --- /dev/null +++ b/docs/subr-mock-migration-spec.org @@ -0,0 +1,158 @@ +#+TITLE: Spec: Migrate Tests Off Mocking C Primitives +#+AUTHOR: Craig Jennings +#+DATE: 2026-06-30 +#+STATUS: Draft — for discussion + +* Status + +Draft. Pulled out of =todo.org= (=** TODO [#C] Migrate tests off mocking +primitives (native-comp robustness) :test:refactor:solo:=) so the scope and +approach can be settled before any code moves. Execution is deferred; this +document is the discussion vehicle. + +Companion reference: [[file:native-comp-subr-mocking.org][native-comp-subr-mocking.org]] holds the full mechanism, the +upstream research, and the 2026-06-21 decision. This spec does not restate the +mechanism; it plans the remaining work that decision deferred. + +* Background — how we hit this + +We re-enabled native compilation config-wide (early-init.el, commit 3fd28987, +2026-06-20). Tests that had been green for months immediately started failing +with no change to their source — the first 8 were window-primitive mocks in +=test-dirvish-config-wrappers.el= and =test-calibredb-epub-config.el= +(=window-body-width=, =window-margins=, =current-window-configuration=, +=get-buffer-window=), throwing =wrong-number-of-arguments= for a zero-arg mock +lambda called with one argument. + +** What we struggled with (the consequences) + +- *Intermittent, non-deterministic failure.* The same test passed, then + crashed, then passed again within a session. Native-comp generates a + per-primitive trampoline =.eln= lazily and caches it on disk; whether a mock + "works" depends on whether that trampoline has been built yet. The + non-determinism was the tell, and it made the failures hard to trust or + reproduce. +- *Three distinct failure modes from one cause* (full detail in the companion + doc): (1) trampoline generation failure under =--batch=; (2) silent bypass — + natively-compiled callers ignore the mock and run the real primitive, so a + test passes for the wrong reason; (3) arity mismatch — the trampoline calls + the mock with the primitive's *maximum* arity, so a fixed-arity mock narrower + than the primitive throws. Mode 3 is the one that bit us; modes 1 and 2 sit + latent. +- *The tempting quick fix is the dangerous one.* Disabling subr trampolines + (=native-comp-enable-subr-trampolines nil=) is the most-cited workaround, but + in our native-comp-heavy setup it produces mode 2 — tests that pass while + asserting against the real primitive. A quiet false pass is worse than a loud + crash. +- *Scale of the latent surface.* The suite mocks subrs in hundreds of places. + The variadic sweep touched 188 arity-narrow mocks. + +** What is already done (the stopgap, 2026-06-21) + +Not currently broken — two things shipped (commits 571da499, b62c3c88): + +1. *Variadic sweep.* Every arity-narrow subr mock got =&rest _= appended, which + tolerates the trampoline's full-arity call. Deterministic, keeps trampolines + on, so no silent bypass. Fixes mode 3. +2. *Meta-test gate.* =tests/test-meta-subr-mock-arity.el= statically scans every + test file for =symbol-function= / =fset= / =setf= subr redefinitions and + fails =make test= if any mock can't accept the primitive's maximum arity. A + new arity-narrow mock can't merge silently. + +The stopgap fixes the mode we actually suffered. It leaves modes 1 and 2 latent. +The durable fix the ecosystem (and our own =elisp-testing.md=) points to is to +*not redefine primitives at all*. That is the work this spec scopes. + +* The real scope — most mocks should NOT move + +The raw inventory is large, but the headline number is misleading. =testing.md= +says to mock external boundaries; converting those to "drive real state" would +mean running real shells and touching the real filesystem in unit tests — the +opposite of what we want. So the actual migration target is narrow. + +Current subr-mock sites across 261 test files (=cl-letf= / =fset= / =advice-add= +on the named primitive): + +| Primitive | Sites | Classification | Disposition | +|-------------------------+-------+-------------------------+-----------------------------------| +| shell-command-to-string | 62 | external boundary | keep mocked (variadic) | +|-------------------------+-------+-------------------------+-----------------------------------| +| executable-find | 60 | external boundary | keep mocked (variadic) | +|-------------------------+-------+-------------------------+-----------------------------------| +| shell-command | 29 | external boundary | keep mocked (variadic) | +|-------------------------+-------+-------------------------+-----------------------------------| +| call-process | 17 | external boundary | keep mocked (variadic) | +|-------------------------+-------+-------------------------+-----------------------------------| +| current-time | 11 | time boundary | keep mocked (variadic) | +|-------------------------+-------+-------------------------+-----------------------------------| +| save-buffer | 10 | file I/O boundary | keep, or real temp-file fixture | +|-------------------------+-------+-------------------------+-----------------------------------| +| write-region | 4 | file I/O boundary | keep, or real temp-file fixture | +|-------------------------+-------+-------------------------+-----------------------------------| +| message | 69 | output-silencing | keep mocked (variadic) | +|-------------------------+-------+-------------------------+-----------------------------------| +| completing-read | 25 | UI prompt | MIGRATE — extract pure internal | +|-------------------------+-------+-------------------------+-----------------------------------| +| read-string | 16 | UI prompt | MIGRATE — extract pure internal | +|-------------------------+-------+-------------------------+-----------------------------------| +| yes-or-no-p | 14 | UI prompt | MIGRATE — extract pure internal | +|-------------------------+-------+-------------------------+-----------------------------------| +| read-from-minibuffer | 6 | UI prompt | MIGRATE — extract pure internal | +|-------------------------+-------+-------------------------+-----------------------------------| + +The genuine migration target is the UI-prompt bucket: ~61 sites. Per +=elisp-testing.md='s Interactive-vs-Internal rule, the fix is to extract a pure +internal that takes the value as an argument and test that directly, leaving the +interactive wrapper a thin un-tested (or smoke-tested) shell. That removes the +prompt mock entirely — immune to all three failure modes — and improves the +production code's testability as a side effect. + +Boundary mocks (shell, file I/O, time, =executable-find=, =call-process=) stay +mocked: that is correct unit-test practice, and the variadic form already +handles native-comp. =message= is output-silencing, not logic — keep it. + +* Proposed approach + +Not a single sweep. The migration touches production code (each extraction is a +small design change), so it is incremental and reviewable, not mechanical. + +1. *Scoped exemplar pass first.* Pick one module with a few prompt-mocks, do the + extract-internal conversion there, set the pattern, and measure the per-case + effort. This calibrates the rest. +2. *Batch by module afterward.* Convert remaining UI-prompt sites a module at a + time, each its own commit, with the suite green between. +3. *Leave boundaries alone.* No conversion of shell / file / time / process + mocks. The meta-test keeps them arity-safe. + +* Open decisions (resolve in discussion) + +** TODO Confirm the scope: UI-prompt mocks only, boundaries stay +Is the migration scoped to the ~61 UI-prompt sites (completing-read, read-string, +yes-or-no-p, read-from-minibuffer), with all boundary mocks explicitly out of +scope? Or is there an appetite to also convert the file-I/O mocks +(=save-buffer=, =write-region=) to real temp-file fixtures where it reads +cleaner? + +** TODO Reframe the todo.org task title to match the real scope +The current title — "Migrate tests off mocking primitives" — reads as all 300+ +sites. If we agree on UI-prompt-only, retitle to something like "Extract pure +internals for UI-prompt-mocked tests" so a future session does not re-scope it +as a wholesale sweep. + +** TODO Pick the exemplar module for the first pass +Which module gets the calibrating conversion? A small one with 2-4 prompt-mocks +is ideal. Candidate selection needs a per-module breakdown of the ~61 sites +(not yet collected). + +** TODO Decide priority and timing +Currently =[#C]=, =:solo:=. The suite is not broken (stopgap holds), so this is +test-quality debt, not urgent. Confirm it stays low and gets done in batches +between other work, rather than as a dedicated push. + +* Non-goals + +- Re-deriving or re-documenting the native-comp trampoline mechanism (see the + companion doc). +- Converting boundary mocks (shell, file I/O, time, process, executable-find). +- Removing the variadic-mock convention or the meta-test gate — both stay; they + are the standing protection for every mock that legitimately remains. diff --git a/early-init.el b/early-init.el index 7ae814734..f2ed5bfa3 100644 --- a/early-init.el +++ b/early-init.el @@ -1,36 +1,14 @@ -;;; early-init.el --- -*- lexical-binding: t; coding: utf-8; no-byte-compile: t; -*- +;;; early-init.el --- Startup bootstrap before init.el -*- lexical-binding: t; coding: utf-8; no-byte-compile: t; -*- ;;; Commentary: - -;; DEBUG FLAGS -;; Debug flags are default on while this config is loading since errors should -;; be loud and highly noticeable. They are restored to their default off once -;; the config has completed. - -;; STARTUP PERFORMANCE -;; Increasing garbage collection to a very high number decreases startup time. -;; setting the file-name-handler and vc-handled-backends avoids some regexp -;; slowness during startup. All original values are restored once Emacs is -;; finished with startup. - -;; LOCAL REPOSITORIES -;; This config doesn't work if the packages it relies on fail. Having local -;; package repositories also allows for full config portability behind corporate -;; firewalls and fast recovery from package issues no matter the network -;; situation. - -;; The localrepo directory contains all the last known good packages for this -;; config. The directory is added as a repository to the package archive list -;; first, and given the highest priority number. This allows for a portable -;; installation and reinstallation. This directory averages ~70 MB. - -;; Having a full local mirror of all elpa, melpa, and org repositories gives you -;; more flexibility but at a higher storage cost. The script -;; 'create-elpa-mirror.sh in user-emacs-directory/scripts directory will clone -;; them all locally. As of Saturday, March 30, 2024 the directory containing all -;; gnu, nongnu, melpa, melpa-stable, and org packages takes around 1.9 GB. -;; For more information on the localrepo and elpa mirrors, read the commentary -;; in local-repository.el. +;; +;; Early startup policy: make init errors loud, speed package/bootstrap work, +;; configure package archives, and suppress expensive UI defaults before the +;; first frame appears. +;; +;; Package archives prefer the checked-in localrepo, then local ELPA mirrors, +;; then online archives. Startup-only GC and file-name-handler changes are +;; paired with later session owners such as gcmh. ;;; Code: @@ -43,7 +21,8 @@ ;; (add-hook 'after-init-hook 'benchmark-init/deactivate)) ;; -------------------------------- Debug Flags -------------------------------- -;; debugging enabled during Emacs startup. disabled again after Emacs startup. +;; Keep debug-on-error enabled only during startup; the startup hook restores the +;; normal interactive behavior after init has loaded. ;; uncomment when repo signatures expire and package installation is necessary ;; (setq package-check-signature nil) @@ -317,6 +296,8 @@ early-init.el.") bidi-inhibit-bpa t) ;; additional speedup ;; Disable global font lock mode until after initialization +;; Defer global font-lock until init finishes; major modes re-enable normal +;; highlighting after startup. (setq-default global-font-lock-mode nil) (add-hook 'emacs-startup-hook #'global-font-lock-mode) @@ -36,7 +36,9 @@ (require 'custom-datetime) ;; date/timestamp insertion in various formats (require 'custom-buffer-file) ;; custom buffer and file operations and keymap (require 'custom-line-paragraph) ;; operations on lines and paragraphs -(require 'custom-misc) ;; miscellaneous functions +(require 'custom-counts) ;; word and character counts +(require 'custom-format) ;; region/buffer reformatting +(require 'custom-text-transform) ;; fraction-glyph text transforms (require 'custom-ordering) ;; ordering and sorting operations (require 'custom-text-enclose) ;; operations to append, prepend, and surround text (require 'custom-whitespace) ;; whitespace operations @@ -78,8 +80,8 @@ (require 'telega-config) ;; telegram client via telega.el (TDLib in docker) (require 'signal-config) ;; signal client via forked signel + signal-cli (require 'eshell-config) ;; emacs shell configuration -(require 'term-config) ;; ghostel + F12 toggle + tmux history copy -(require 'ai-term) ;; in-Emacs Claude launcher (vertical-split ghostel) +(require 'eat-config) ;; EAT terminal + the F12 dock-and-remember toggle +(require 'ai-term) ;; in-Emacs Claude launcher (vertical-split EAT terminal) (require 'help-utils) ;; search: arch-wiki, devdoc, tldr, wikipedia (require 'help-config) ;; info, man, help config (require 'face-diagnostic) ;; describe face/font at point (cj/describe-face-at-point) @@ -88,6 +90,7 @@ ;; ---------------------- Added Features And Integrations ---------------------- +(require 'nov-reading) ;; epub reading-view theme layer (palettes + size) (require 'calibredb-epub-config) ;; ebook reader/manager settings (require 'dashboard-config) ;; the nice landing page with links (require 'dirvish-config) ;; file manager configuration diff --git a/modules/ai-term.el b/modules/ai-term.el index b463da90b..6dfb669a9 100644 --- a/modules/ai-term.el +++ b/modules/ai-term.el @@ -1,4 +1,4 @@ -;;; ai-term.el --- In-Emacs AI-agent launcher with vertical-split terminal -*- lexical-binding: t; -*- +;;; ai-term.el --- AI-agent terminals backed by EAT and tmux -*- lexical-binding: t; -*- ;; Author: Craig Jennings <c@cjennings.net> @@ -7,70 +7,18 @@ ;; Layer: 3 (Domain Workflow). ;; Category: D. ;; Load shape: eager. -;; Eager reason: registers four global keys for the AI-agent terminal launcher; a -;; command-loaded deferral candidate. -;; Top-level side effects: four global key bindings. -;; Runtime requires: cl-lib, seq, cj-window-geometry-lib, cj-window-toggle-lib, -;; host-environment. +;; Eager reason: binds M-SPC and the C-; a AI-agent prefix. +;; Top-level side effects: global M-SPC binding and C-; a prefix map. +;; Runtime requires: cl-lib, seq, window-toggle/geometry helpers, host-environment. ;; Direct test load: yes. ;; -;; Picks an AI-agent project (a dir under ~/.emacs.d, ~/code/*, or -;; ~/projects/* containing .ai/protocols.org), opens or reuses a terminal -;; buffer named "agent [<basename>]", sends the agent's startup -;; instruction to it, and routes the buffer to a side window via -;; display-buffer-alist. When the frame already has a window forming the -;; half the agent would occupy (a right column on a desktop, a bottom row -;; on a laptop), the agent reuses that slot rather than splitting a third -;; window in; toggling off restores the displaced buffer to the slot. -;; Otherwise placement is a host-aware split: a right-side split at 50% -;; width on a desktop, a bottom split at 75% height on a laptop (see -;; `cj/--ai-term-default-direction'). Multiple -;; projects produce multiple coexisting buffers that share the same -;; slot; switching among them is a buffer-switch, not a -;; kill-and-recreate. +;; Opens project-scoped AI agents in EAT buffers backed by tmux sessions. Project +;; candidates come from configured roots that contain .ai/protocols.org. ;; -;; Each project's agent runs inside a tmux session named -;; "<cj/ai-term-tmux-session-prefix><basename>" (default prefix "aiv-"). -;; The prefix lets `tmux ls' be filtered to AI-term's own sessions, so -;; after an Emacs crash the project picker can match surviving sessions -;; back to their directories: matched projects sort to the top of the -;; picker (flagged "[detached]" -- session alive, no Emacs buffer -- or -;; "[running]" when a live terminal buffer exists), the rest follow in -;; alphabetical order. -;; -;; Four F-key entry points: -;; -;; - F9 `cj/ai-term' -- DWIM dispatch. If an agent buffer is -;; currently displayed in this frame, F9 toggles it off: when it -;; took over an existing window (a reused slot) the buffer it -;; displaced returns to that slot, when it was split into its own -;; window that window is removed, and when it fills the frame it -;; is buried. Otherwise, if exactly one agent buffer is alive, -;; F9 re-displays it; if zero or two-plus are alive, F9 falls -;; through to the project picker. -;; - C-F9 `cj/ai-term-pick-project' -- always show the project -;; picker, even when an agent buffer is currently displayed. -;; Used when the user wants to start a new project session -;; instead of toggling the current one. -;; - s-F9 `cj/ai-term-next' -- step to the next active agent in the -;; queue. The queue is every active agent in buffer-name order -;; (a stable rotation): attached agents (a live buffer) and -;; detached ones (a live tmux session with no Emacs buffer). -;; Stepping onto a detached agent attaches it. When an agent -;; window is on screen, swap it to the next agent and focus it, -;; wrapping after the last; when none is shown but agents exist, -;; show the first. This is the "switch among existing agents" -;; surface F9 deliberately doesn't provide. -;; - M-F9 `cj/ai-term-close' -- gracefully close an agent: kill its -;; tmux session (stopping the agent process), then its terminal -;; buffer. Its window stays in the layout (swapped to the -;; working buffer), so closing never collapses a split. Confirms -;; first. Targets the current agent, the sole live agent, or -;; prompts among several. -;; -;; Existing windmove (Shift-arrows) handles code <-> agent focus -;; toggling. Buffer-move (C-M-arrows) handles side-swap. Neither -;; needs anything new from this module. +;; Agent display reuses the host-appropriate side slot when possible, otherwise +;; splits right on desktop frames and below on laptop frames. Attached buffers +;; and detached tmux sessions share the same rotation; selecting a detached +;; agent recreates its EAT buffer and attaches to the live session. ;;; Code: @@ -81,16 +29,13 @@ (require 'host-environment) (require 'keybindings) ;; provides cj/register-prefix-map (C-; a) -(declare-function ghostel "ghostel" (&optional arg)) -(declare-function ghostel-send-string "ghostel" (string)) -(declare-function ghostel--rebuild-semi-char-keymap "ghostel" ()) -(defvar ghostel-keymap-exceptions) -(defvar ghostel-mode-map) -(defvar ghostel-buffer-name) -(defvar ghostel-buffer-name-function) +(declare-function eat "eat" (&optional program arg)) +(declare-function cj/make-buffer-pattern-undead "undead-buffers") +(defvar eat-buffer-name) +(defvar eat-semi-char-mode-map) (defgroup ai-term nil - "In-Emacs AI-agent launcher with a vertical-split ghostel terminal." + "In-Emacs AI-agent launcher with a vertical-split EAT terminal." :group 'tools) (defcustom cj/ai-term-agent-command @@ -102,15 +47,6 @@ agent you run (aider, an open-source LLM TUI, etc.)." :type 'string :group 'ai-term) -(defvar cj/--ai-term-suppress-tmux nil - "When non-nil, the generic ghostel tmux-launch hook skips its auto-tmux step. - -ai-term dynamically binds this around `(ghostel)' so the hook in -term-config.el doesn't send a bare \"tmux\\n\" before the named -session launch command runs. The hook reads the variable via -`bound-and-true-p' so loading order between the two modules doesn't -matter.") - (defcustom cj/ai-term-project-roots (list (expand-file-name "~/.emacs.d")) "Directories that are themselves AI-agent projects. @@ -228,7 +164,7 @@ which the step materializes by attaching." Walks `buffer-list' (most-recently-selected first) and returns the first buffer that is not an AI-term agent buffer (per `cj/--ai-term-buffer-p') and is not an internal buffer (name starting -with a space). Used by the single-window F9 toggle-off so dismissing a +with a space). Used by the single-window toggle-off so dismissing a full-frame agent returns to the file the user was working in (e.g. todo.org) rather than swapping in another agent." (seq-find (lambda (b) @@ -300,7 +236,7 @@ looked up in SESSIONS, so the lossy whitespace->hyphen transform in (defun cj/--ai-term-launch-command (dir) "Return the shell command line that runs the AI tool in a project tmux session. -Uses `tmux new-session -A' so a second F9 on the same project reattaches +Uses `tmux new-session -A' so a second toggle on the same project reattaches to the running session instead of spawning a new one. The session name comes from `cj/--ai-term-tmux-session-name'; the first window is named `cj/ai-term-tmux-window-name' (default \"ai\") so a later hand-opened @@ -465,7 +401,7 @@ direction applies. Captured at toggle-off by `cj/--ai-term-display-saved'.") (defvar cj/--ai-term-last-was-bury nil - "Non-nil when the last F9 toggle-off used `bury-buffer'. + "Non-nil when the last toggle-off used `bury-buffer'. Set by `cj/ai-term' in its `toggle-off' branch: t when the agent window was the only window in the frame (so toggle-off buried @@ -475,7 +411,7 @@ buried agent in the current window (the only one) or splitting per the saved direction.") (defvar cj/--ai-term-last-toggle-deleted-split nil - "Non-nil when the last F9 toggle-off deleted the agent's own split window. + "Non-nil when the last toggle-off deleted the agent's own split window. Set t by `cj/--ai-term-toggle-off' only when it actually `delete-window's the agent (a multi-window layout where the agent had its own window); @@ -487,7 +423,7 @@ working window at the edge, displacing its buffer and collapsing the layout -- the toggle must be reversible (off then on returns the same windows).") (defvar cj/--ai-term-last-hidden-buffer nil - "The agent buffer hidden by the most recent F9 toggle-off. + "The agent buffer hidden by the most recent toggle-off. Captured in `cj/ai-term' just before an agent window is torn down, and consumed by `cj/--ai-term-dispatch' so the next toggle-on reopens the @@ -529,11 +465,24 @@ and a fraction-of-frame produces the wrong size on replay (squeezes the other windows). An integer is unambiguous, at the cost of not auto-scaling if the frame itself resizes.") +(defvar cj/--ai-term-last-fullscreen nil + "Non-nil when the agent window was last seen filling its frame. + +Maintained by `cj/--ai-term-track-geometry' on +`window-configuration-change-hook': set t whenever a live agent window is +the sole window in its frame, cleared when the agent is shown as a split +\(its dock direction and size are captured then instead). Consulted by +`cj/--ai-term-display-saved' so a summon into a single-window frame +restores the agent fullscreen rather than docking it -- the sole-window +state isn't a representable dock size, so this flag is how it round-trips. +Unlike `cj/--ai-term-last-was-bury' it does not depend on a toggle-off, so +it also covers leaving the agent by switching buffers or `C-x 1'.") + (defun cj/--ai-term-capture-state (window) "Capture WINDOW's direction and size into module-level state. Sets `cj/--ai-term-last-direction' and `cj/--ai-term-last-size' -so a subsequent F9 display can restore the user's chosen orientation +so a subsequent display can restore the user's chosen orientation and size. Called at toggle-off (just before the window is torn down). The default direction is host-aware via `cj/--ai-term-default-direction' (used only when WINDOW fills its @@ -545,6 +494,35 @@ is not live." 'cj/--ai-term-last-size '(right below left))) +(defun cj/--ai-term-window-sole-p (window) + "Return non-nil when WINDOW is the only live window in its frame. +A frame's sole window is its root window; once split, the root is an +internal window and no live window equals it." + (and (window-live-p window) + (eq window (frame-root-window (window-frame window))))) + +(defun cj/--ai-term-track-geometry (&rest _) + "Track whether the displayed agent window is fullscreen. + +Run from `window-configuration-change-hook'. Sets +`cj/--ai-term-last-fullscreen' to whether a live agent window is the sole +window in its frame, and leaves it untouched when no agent window is +displayed -- that retained value is the just-left state a later summon +replays. Dock direction and size stay owned by the toggle-off capture +\(`cj/--ai-term-capture-state'); this hook must not re-capture them, or the +repeated capture/replay drifts the dock height a couple rows per cycle." + (let ((win (cj/--ai-term-displayed-agent-window))) + (when (window-live-p win) + (setq cj/--ai-term-last-fullscreen (cj/--ai-term-window-sole-p win))))) + +(add-hook 'window-configuration-change-hook #'cj/--ai-term-track-geometry) + +;; Agent buffers ("agent [<project>]") are buried, not killed, by the +;; kill-all sweep (F1 / `cj/dashboard-only'). Register the family pattern so +;; every agent -- however and whenever created -- survives with its session. +(with-eval-after-load 'undead-buffers + (cj/make-buffer-pattern-undead "\\`agent \\[")) + (defun cj/--ai-term-reuse-existing-agent (buffer _alist) "Display-buffer action: reuse any window in this frame already showing an agent buffer. @@ -557,7 +535,7 @@ action in the chain runs. This is more specific than `display-buffer-use-some-window', which would happily steal any non-selected window (e.g. a code window above the agent split) when the user is focused in agent and -swaps projects via C-F9. The selective lookup here keeps non-agent +swaps projects via C-; a s. The selective lookup here keeps non-agent windows undisturbed and preserves the user's split geometry across project changes." (let ((win (cj/--ai-term-displayed-agent-window))) @@ -605,19 +583,27 @@ keeping the toggle reversible." win)))) (defun cj/--ai-term-display-saved (buffer alist) - "Display-buffer action: split per saved direction and size. + "Display-buffer action: restore fullscreen in a single-window frame, +otherwise split per saved direction and size. -When the prior toggle-off was a bury (single-window state, flagged -via `cj/--ai-term-last-was-bury') and the frame is still single- -window, restore the agent into the selected window in place rather -than splitting -- preserves the user's lone-window layout across -F9 toggles. +When the frame is a single window and the agent was last fullscreen +\(`cj/--ai-term-last-fullscreen', tracked by `cj/--ai-term-track-geometry') +or the prior toggle-off was a single-window bury +\(`cj/--ai-term-last-was-bury'), restore the agent into the selected window +in place rather than splitting. This round-trips a fullscreen agent -- +left by toggle-off, `C-x 1', or switching buffers -- since the sole-window +state isn't a representable dock size. Otherwise delegates to `cj/window-toggle-display-saved' against the -F9 state vars, falling back to the host-aware defaults from +toggle state vars, falling back to the host-aware defaults from `cj/--ai-term-default-direction' and `cj/--ai-term-default-size'." (cond - ((and cj/--ai-term-last-was-bury (one-window-p)) + ;; NOMINI t: don't count an active minibuffer as a second window. A summon + ;; can run with a picker prompt up, and a bare `one-window-p' then returns + ;; nil on a structurally single-window frame, misfiring the fullscreen + ;; restore into a dock -- which clears the fullscreen flag and cascades. + ((and (or cj/--ai-term-last-fullscreen cj/--ai-term-last-was-bury) + (one-window-p t)) (setq cj/--ai-term-last-was-bury nil) (let ((win (selected-window))) (set-window-buffer win buffer) @@ -640,7 +626,7 @@ through four actions in order: 2. `cj/--ai-term-reuse-existing-agent' -- otherwise, if any window in this frame already shows an agent-prefixed buffer, swap its buffer for the new one (preserves geometry across - project changes via C-F9). + project changes via C-; a s). 3. `cj/--ai-term-reuse-edge-window' -- otherwise, if the frame already has a window forming the half the agent would occupy (the right column on a desktop, the bottom row on a laptop), @@ -669,19 +655,26 @@ split) when the user is focused in agent and switches projects." (dolist (entry (cj/--ai-term-display-rule-list)) (add-to-list 'display-buffer-alist entry)) +(defun cj/--ai-term-send-string (buffer string) + "Send STRING to BUFFER's terminal process (the agent's shell). +Sends to the pty directly so the launch command reaches the shell EAT runs." + (let ((proc (get-buffer-process buffer))) + (when (process-live-p proc) + (process-send-string proc string)))) + (defun cj/--ai-term-show-or-create (dir name) "Show or create the AI-term buffer for project DIR with buffer NAME. If a buffer named NAME exists with a live process, display it. If the buffer exists but its process is dead, kill it and recreate. If -no such buffer exists, create a new ghostel terminal in DIR and send +no such buffer exists, create a new EAT terminal in DIR and send the project's tmux launch command (see `cj/--ai-term-launch-command') so the same project basename reattaches across Emacs restarts. -The dynamic binding of `cj/--ai-term-suppress-tmux' around `(ghostel)' -suppresses the generic tmux-launch hook in term-config.el so -it doesn't fire a bare \"tmux\\n\" before the project-named launch -command runs. +EAT runs a plain shell with no auto-tmux hook, so the named +`tmux new-session -A' launch command is the only thing that starts the +session -- the spike confirmed EAT + tmux detach and reattach exactly +like ghostel + tmux did. Records DIR in `cj/--ai-term-mru' (whichever branch runs) so the project picker can list recently-opened projects first. Returns the @@ -695,28 +688,22 @@ buffer." (t (when existing (kill-buffer existing)) - ;; `ghostel' switches to its buffer in the selected window before our + ;; `eat' switches to its buffer in the selected window before our ;; display-buffer-alist rule can route it; `save-window-excursion' ;; reverts that, and the explicit display-buffer below routes the buffer - ;; through the alist into the agent slot. `ghostel-buffer-name' is bound - ;; to NAME so the terminal is created under the agent name, and - ;; `ghostel-buffer-name-function' is pinned nil (dynamically during - ;; creation, then buffer-locally) so OSC title escapes from the agent - ;; don't rename it out from under the "agent [" prefix that buffer - ;; detection and the display rule key on. + ;; through the alist into the agent slot. `eat-buffer-name' is bound to + ;; NAME so the terminal is created under the agent name; EAT (unlike + ;; ghostel) does not rename the buffer from the terminal's OSC title, so + ;; the "agent [" prefix that buffer detection and the display rule key on + ;; stays put. (save-window-excursion (let ((default-directory dir) - (ghostel-buffer-name name) - (ghostel-buffer-name-function nil) - (cj/--ai-term-suppress-tmux t)) - (let ((buf (ghostel))) - (when (buffer-live-p buf) - (with-current-buffer buf - (setq-local ghostel-buffer-name-function nil)))))) + (eat-buffer-name name)) + (eat))) (let ((buf (get-buffer name))) (with-current-buffer buf - (ghostel-send-string (cj/--ai-term-launch-command dir)) - (ghostel-send-string "\n")) + (cj/--ai-term-send-string + buf (concat (cj/--ai-term-launch-command dir) "\n"))) (display-buffer buf) buf))))) @@ -785,17 +772,17 @@ Signals `user-error' when no candidates exist." (expand-file-name chosen))))) (defun cj/--ai-term-dispatch () - "Compute the F9 (`cj/ai-term') action without performing it. + "Compute the `cj/ai-term' (C-; a a) action without performing it. Returns one of: - (toggle-off . WINDOW) -- agent is displayed in WINDOW; quit it. - (redisplay-recent . BUFFER) -- 1+ alive agent buffers; show MRU. - (pick-project) -- zero alive agent buffers; prompt. -When 2+ agent buffers are alive, F9 redisplays the most-recently- -selected one rather than opening the project picker. C-F9 is the -explicit \"start a different project\" surface; M-F9 is the explicit -\"switch among existing agents\" surface. F9 keeps a single, simple +When 2+ agent buffers are alive, C-; a a redisplays the most-recently- +selected one rather than opening the project picker. C-; a s is the +explicit \"start a different project\" surface; C-; a n is the explicit +\"switch among existing agents\" surface. C-; a a keeps a single, simple job: toggle whichever agent was last in use. A pure-decision helper so the dispatch logic is exercisable in tests @@ -818,7 +805,7 @@ without firing real `display-buffer' or `quit-window' calls." (t '(pick-project)))))))) (defun cj/ai-term-pick-project (&optional arg) - "Pick an AI-agent project and open or reuse its ghostel terminal. + "Pick an AI-agent project and open or reuse its EAT terminal. The project is picked from a filtered completing-read list of dirs that contain .ai/protocols.org. The terminal buffer is named @@ -828,11 +815,11 @@ buffers; reinvoking on the same project reuses its existing terminal. With prefix ARG, display the buffer without selecting its window. -Bound to C-F9 -- always shows the project picker, even when an agent +Bound to C-; a s -- always shows the project picker, even when an agent buffer is currently displayed. -ghostel renders in terminal frames as well as GUI frames, so this -launches from either (only kitty inline-graphics degrade in a TTY)." +EAT renders in terminal frames as well as GUI frames, so this +launches from either." (interactive "P") (let* ((dir (cj/--ai-term-pick-project)) (name (cj/--ai-term-buffer-name dir)) @@ -854,7 +841,7 @@ the agent itself." (other-buffer (window-buffer win) t))))) (defun cj/--ai-term-toggle-off (win) - "Hide the agent shown in WIN for an F9 toggle-off. Always returns nil. + "Hide the agent shown in WIN for a toggle-off. Always returns nil. Two cases, by window count: @@ -867,7 +854,7 @@ Two cases, by window count: force a swap to a non-agent buffer to keep the toggle observable. - Multi-window: collapse the agent split outright by deleting its window, so - the working buffer (e.g. todo.org) reclaims the space. F9 is a pure + the working buffer (e.g. todo.org) reclaims the space. The toggle is a pure show/hide toggle of THE agent split -- it must never surface a different agent. `quit-restore-window' can't guarantee that here: switching among several agents reuses the one slot via `set-window-buffer' (see @@ -909,21 +896,21 @@ Two cases, by window count: nil) (defun cj/ai-term (&optional arg) - "Smart F9 dispatch for the AI-term launcher. + "DWIM dispatch for the AI-term launcher. Bound to C-; a a. Behavior depends on the current state: -- If an AI-term buffer is currently displayed in this frame, F9 +- If an AI-term buffer is currently displayed in this frame, it quits its window (toggle off, buffer stays alive). -- Else, if exactly one alive AI-term buffer exists, F9 re-displays +- Else, if exactly one alive AI-term buffer exists, it re-displays it (DWIM -- the obvious next step is to look at it). -- Else (zero or 2+), F9 falls through to `cj/ai-term-pick-project'. +- Else (zero or 2+), it falls through to `cj/ai-term-pick-project'. With prefix ARG, display the buffer without selecting its window when a buffer is being shown (no effect on the toggle-off branch). -See `cj/ai-term-pick-project' (C-F9) to force the project picker. -M-F9 closes an agent via `cj/ai-term-close'." +See `cj/ai-term-pick-project' (C-; a s) to force the project picker. +C-; a k closes an agent via `cj/ai-term-close'." (interactive "P") (pcase (cj/--ai-term-dispatch) (`(toggle-off . ,win) @@ -957,7 +944,7 @@ Derives the tmux session name from BUFFER's `default-directory' (the project dir the terminal was created in) and kills it so the agent process stops. When BUFFER is shown, swaps its window to a non-agent buffer (the working file) rather than deleting the window -- closing an -agent must not collapse the user's window layout; the F9 hide toggle is +agent must not collapse the user's window layout; the hide toggle is what collapses the split. Then kills BUFFER (suppressing the process-still-running prompt -- the session is already down). No-op when BUFFER isn't an AI-term buffer." @@ -971,6 +958,8 @@ when BUFFER isn't an AI-term buffer." (let ((kill-buffer-query-functions nil)) (kill-buffer buffer)))) +(require 'system-lib) + (defun cj/--ai-term-close-target () "Return the AI-term buffer `cj/ai-term-close' should act on, or nil. @@ -985,7 +974,8 @@ buffers; nil when none are alive." ((null (cdr buffers)) (car buffers)) (t (get-buffer (completing-read "Close AI terminal: " - (mapcar #'buffer-name buffers) nil t)))))))) + (cj/completion-table 'buffer (mapcar #'buffer-name buffers)) + nil t)))))))) (defun cj/ai-term-close () "Gracefully close an AI-term agent: kill its tmux session and buffer. @@ -993,7 +983,7 @@ buffers; nil when none are alive." Targets the current agent buffer, the sole live agent, or prompts when several are alive (see `cj/--ai-term-close-target'). Asks for confirmation first -- this kills the running agent process, which can -interrupt work in progress. Bound to M-<f9>." +interrupt work in progress. Bound to C-; a k." (interactive) (let ((buffer (cj/--ai-term-close-target))) (unless buffer @@ -1067,16 +1057,13 @@ picker and C-; a k closes an agent." "C-; a k" "kill agent" "M-SPC" "ai-term: next agent")) -;; In ghostel's semi-char mode, keys not in `ghostel-keymap-exceptions' are -;; forwarded to the pty, and `ghostel-semi-char-mode-map' outranks the major -;; mode map. M-SPC (swap to the next agent) must reach Emacs from inside an -;; agent buffer, so add it to the exceptions, rebuild the semi-char map, and -;; bind it in `ghostel-mode-map'. C-; is already an exception (term-config), -;; so the C-; a family resolves through the global prefix without extra wiring. -(with-eval-after-load 'ghostel - (keymap-set ghostel-mode-map "M-SPC" #'cj/ai-term-next) - (add-to-list 'ghostel-keymap-exceptions "M-SPC") - (ghostel--rebuild-semi-char-keymap)) +;; In EAT's semi-char mode, keys not bound in `eat-semi-char-mode-map' are +;; forwarded to the pty. M-SPC (swap to the next agent) must reach Emacs from +;; inside an agent buffer, so bind it in that map -- no exception-list or rebuild +;; dance like ghostel needed. C-; is already bound there (eat-config), so the +;; C-; a family resolves through the global prefix without extra wiring. +(with-eval-after-load 'eat + (keymap-set eat-semi-char-mode-map "M-SPC" #'cj/ai-term-next)) ;; ------------------- Wrap-it-up teardown + shutdown ------------------------- ;; diff --git a/modules/auth-config.el b/modules/auth-config.el index 62d773057..c2df244b5 100644 --- a/modules/auth-config.el +++ b/modules/auth-config.el @@ -1,4 +1,4 @@ -;; auth-config.el --- Configuration for Authentication Utilities -*- lexical-binding: t; coding: utf-8; -*- +;;; auth-config.el --- Authentication and GPG integration -*- lexical-binding: t; coding: utf-8; -*- ;; author Craig Jennings <c@cjennings.net> ;;; Commentary: @@ -6,29 +6,16 @@ ;; Layer: 1 (Foundation). ;; Category: F/D. ;; Load shape: eager. -;; Eager reason: auth-source and GPG/epa setup that other modules rely on for -;; credentials early in the session. -;; Top-level side effects: auth-source/epa configuration via use-package and setq. +;; Eager reason: credentials and GPG setup are needed by other modules early. +;; Top-level side effects: auth-source/epa setup and oauth2-auto cache advice. ;; Runtime requires: system-lib, user-constants. -;; Direct test load: yes (configuration only). +;; Direct test load: yes. ;; -;; Configuration for Emacs authentication and GPG integration: - -;; • auth-source -;; – Forces use of your default authinfo file -;; – Disable external GPG agent in favor of Emacs's own prompt -;; – Keeps auth-source debug logging disabled by default - -;; • Easy PG Assistant (epa) -;; – Force using the 'gpg2' executable for encryption/decryption operations - -;; • oauth2-auto cache fix (via advice) -;; – oauth2-auto version 20250624.1919 has caching bug on line 206 -;; – Function oauth2-auto--plstore-read has `or nil` disabling cache -;; – This caused GPG passphrase prompts every ~15 minutes during gcal-sync -;; – Fix: Advice to enable hash-table cache without modifying package -;; – Works across package updates -;; – Fixed 2025-11-11 +;; Central auth-source, GPG, and credential-debug setup. Auth lookups use the +;; configured authinfo file; passphrase caching is left to gpg-agent. +;; +;; Advises oauth2-auto's plstore reader to restore in-memory caching and avoid +;; repeated GPG prompts during calendar/mail refreshes. ;;; Code: diff --git a/modules/auto-dim-config.el b/modules/auto-dim-config.el index a143f8fe0..efae5341b 100644 --- a/modules/auto-dim-config.el +++ b/modules/auto-dim-config.el @@ -19,11 +19,10 @@ ;; auto-dim-other-buffers-hide) live in the active theme (the generated ;; theme-studio theme) so they track theme switches. ;; -;; Terminal buffers (ghostel) do not participate in window dimming: ghostel -;; bakes its color palette into the native module per-terminal, not per-window, -;; so there is no per-window color hook to dim through (the vterm engine had -;; one via `vterm--get-color', which this module used to advise). See the -;; terminal-migration follow-up task in todo.org for revisiting this. +;; EAT terminals render in real Emacs faces and use the `default' face for the +;; terminal background, so -- unlike the old ghostel/vterm engines, which baked +;; color per-terminal with no per-window hook -- they follow the per-window +;; dimmed background like any other buffer. ;;; Code: diff --git a/modules/browser-config.el b/modules/browser-config.el index d596b9e9d..564e7a275 100644 --- a/modules/browser-config.el +++ b/modules/browser-config.el @@ -76,7 +76,10 @@ Includes built-in Emacs browsers (those with nil executable)." (defun cj/save-browser-choice (browser-plist) "Save BROWSER-PLIST to the persistence file." (with-temp-file cj/browser-choice-file - (insert ";;; Browser choice - Auto-generated\n") + (insert ";;; browser-choice.el --- Generated browser selection -*- lexical-binding: t; -*-\n") + (insert ";;\n") + (insert ";; Generated by browser-config.el. Do not edit by hand; use\n") + (insert ";; `cj/choose-browser' to rewrite this file.\n") (insert (format "(setq cj/saved-browser-choice '%S)\n" browser-plist)))) (defun cj/load-browser-choice () @@ -102,7 +105,6 @@ Returns: \\='success if applied successfully, (program-var (plist-get browser-plist :program-var))) (if (null browse-fn) 'invalid-plist - ;; Set the main browse-url function (setq browse-url-browser-function browse-fn) ;; Set the specific browser program variable if it exists (when program-var diff --git a/modules/calendar-sync-ics.el b/modules/calendar-sync-ics.el new file mode 100644 index 000000000..9cb57e96b --- /dev/null +++ b/modules/calendar-sync-ics.el @@ -0,0 +1,582 @@ +;;; calendar-sync-ics.el --- iCalendar parsing primitives for calendar-sync -*- coding: utf-8; lexical-binding: t; -*- + +;; Author: Craig Jennings <c@cjennings.net> +;; Created: 2025-11-16 + +;;; Commentary: +;; +;; Layer: 3 (Domain Workflow). +;; Category: D. +;; Load shape: library. +;; Top-level side effects: none (defuns plus one internal state defvar). +;; Runtime requires: cl-lib, subr-x. +;; Direct test load: yes. +;; +;; Base layer of the calendar-sync parser: RFC 5545 text cleaning, VEVENT +;; property extraction, attendee/organizer/URL parsing, timezone and +;; timestamp conversion, date arithmetic, and single-event parsing. It has +;; no dependency on the other calendar-sync modules, so the recurrence, org, +;; and source layers build on it. The sync-window and user-identity +;; configuration it reads is owned by calendar-sync.el and forward-declared +;; here so this base layer never requires the top module back. + +;;; Code: + +(require 'cl-lib) +(require 'subr-x) + +;; Configuration owned by calendar-sync.el; declared special here so this +;; base module reads it without a back-require onto the top module. +(defvar calendar-sync-past-months) +(defvar calendar-sync-future-months) +(defvar calendar-sync-user-emails) +(defvar calendar-sync-skip-declined) + +;;; Logging + +(defun calendar-sync--log-silently (format-string &rest args) + "Log FORMAT-STRING with ARGS without requiring the full config." + (if (fboundp 'cj/log-silently) + (apply #'cj/log-silently format-string args) + (apply #'message format-string args))) + +;;; Internal state + +(defvar calendar-sync--last-timezone-offset nil + "Timezone offset in seconds from UTC at last sync. +Used to detect timezone changes (e.g., when traveling).") + +;;; Timezone Detection + +(defun calendar-sync--current-timezone-offset () + "Get current timezone offset in seconds from UTC. +Returns negative for west of UTC, positive for east. +Example: -21600 for CST (UTC-6), -28800 for PST (UTC-8)." + (car (current-time-zone))) + +(defun calendar-sync--format-timezone-offset (offset) + "Format timezone OFFSET (in seconds) as human-readable string. +Example: -21600 → `UTC-6' or `UTC-6:00'." + (if (null offset) + "unknown" + (let* ((hours (/ offset 3600)) + (minutes (abs (mod (/ offset 60) 60))) + (sign (if (>= hours 0) "+" "-")) + (abs-hours (abs hours))) + (if (= minutes 0) + (format "UTC%s%d" sign abs-hours) + (format "UTC%s%d:%02d" sign abs-hours minutes))))) + +(defun calendar-sync--timezone-changed-p () + "Return t if timezone has changed since last sync." + (and calendar-sync--last-timezone-offset + (not (= (calendar-sync--current-timezone-offset) + calendar-sync--last-timezone-offset)))) + +;;; Line Ending Normalization + +(defun calendar-sync--normalize-line-endings (content) + "Normalize line endings in CONTENT to Unix format (LF only). +Removes all carriage return characters (\\r) from CONTENT. +The iCalendar format (RFC 5545) uses CRLF line endings, but Emacs +and `org-mode' expect LF only. This function ensures consistent line +endings throughout the parsing pipeline. + +Returns CONTENT with all \\r characters removed." + (if (not (stringp content)) + content + (replace-regexp-in-string "\r" "" content))) + +;;; Text Cleaning (ICS unescape + HTML strip) + +(defun calendar-sync--unescape-ics-text (text) + "Unescape RFC 5545 escape sequences in TEXT. +Converts: \\n→newline, \\,→comma, \\\\→backslash, \\;→semicolon. +Returns nil for nil input." + (when text + ;; Use placeholder for literal backslash to avoid double-unescaping. + ;; replace-regexp-in-string with LITERAL=t avoids backslash interpretation. + (let ((result (replace-regexp-in-string "\\\\\\\\" "\000" text))) + (setq result (replace-regexp-in-string "\\\\n" "\n" result t t)) + (setq result (replace-regexp-in-string "\\\\," "," result t t)) + (setq result (replace-regexp-in-string "\\\\;" ";" result t t)) + (replace-regexp-in-string "\000" "\\" result t t)))) + +(defun calendar-sync--strip-html (text) + "Strip HTML tags from TEXT and decode common HTML entities. +Converts <br>, <br/>, <br /> to newlines. Strips all other tags. +Decodes & < > ". Collapses excessive blank lines. +Returns nil for nil input." + (when text + (let ((result text)) + ;; Convert <br> variants to newline (must come before tag stripping) + (setq result (replace-regexp-in-string "<br[ \t]*/?>[ \t]*" "\n" result)) + ;; Strip all remaining HTML tags + (setq result (replace-regexp-in-string "<[^>]*>" "" result)) + ;; Decode HTML entities + (setq result (replace-regexp-in-string "&" "&" result)) + (setq result (replace-regexp-in-string "<" "<" result)) + (setq result (replace-regexp-in-string ">" ">" result)) + (setq result (replace-regexp-in-string """ "\"" result)) + ;; Collapse 3+ consecutive newlines to 2 + (setq result (replace-regexp-in-string "\n\\{3,\\}" "\n\n" result)) + result))) + +(defun calendar-sync--clean-text (text) + "Clean TEXT by unescaping ICS sequences, stripping HTML, and trimming. +Returns nil for nil input. Returns empty string for whitespace-only input." + (when text + (string-trim (calendar-sync--strip-html (calendar-sync--unescape-ics-text text))))) + +;;; Date Utilities + +(defun calendar-sync--add-months (date months) + "Add MONTHS to DATE. +DATE is (year month day), returns new (year month day)." + (let* ((year (nth 0 date)) + (month (nth 1 date)) + (day (nth 2 date)) + (total-months (+ (* year 12) month -1 months)) + (new-year (/ total-months 12)) + (new-month (1+ (mod total-months 12)))) + (list new-year new-month day))) + +(defun calendar-sync--get-date-range () + "Get date range for event expansion as (start-time end-time). +Returns time values for -3 months and +12 months from today." + (let* ((now (decode-time)) + (today (list (nth 5 now) (nth 4 now) (nth 3 now))) + (start-date (calendar-sync--add-months today (- calendar-sync-past-months))) + (end-date (calendar-sync--add-months today calendar-sync-future-months)) + (start-time (apply #'encode-time 0 0 0 (reverse start-date))) + (end-time (apply #'encode-time 0 0 0 (reverse end-date)))) + (list start-time end-time))) + +(defun calendar-sync--date-in-range-p (date range) + "Check if DATE is within RANGE. +DATE is (year month day hour minute), RANGE is (start-time end-time)." + (let* ((year (nth 0 date)) + (month (nth 1 date)) + (day (nth 2 date)) + (date-time (encode-time 0 0 0 day month year)) + (start-time (nth 0 range)) + (end-time (nth 1 range))) + (and (time-less-p start-time date-time) + (time-less-p date-time end-time)))) + +(defun calendar-sync--weekday-to-number (weekday) + "Convert WEEKDAY string (MO, TU, etc.) to number (1-7). +Monday = 1, Sunday = 7." + (pcase weekday + ("MO" 1) + ("TU" 2) + ("WE" 3) + ("TH" 4) + ("FR" 5) + ("SA" 6) + ("SU" 7) + (_ nil))) + +(defun calendar-sync--date-weekday (date) + "Get weekday number for DATE (year month day). +Monday = 1, Sunday = 7." + (let* ((year (nth 0 date)) + (month (nth 1 date)) + (day (nth 2 date)) + (time (encode-time 0 0 0 day month year)) + (decoded (decode-time time)) + (dow (nth 6 decoded))) ; 0 = Sunday, 1 = Monday, etc. + (if (= dow 0) 7 dow))) + +(defun calendar-sync--add-days (date days) + "Add DAYS to DATE (year month day). +Returns new (year month day). +Uses noon internally to avoid DST boundary issues where adding +86400 seconds to midnight can land on the same calendar date +during fall-back transitions." + (let* ((year (nth 0 date)) + (month (nth 1 date)) + (day (nth 2 date)) + (time (encode-time 0 0 12 day month year)) + (new-time (time-add time (days-to-time days))) + (decoded (decode-time new-time))) + (list (nth 5 decoded) (nth 4 decoded) (nth 3 decoded)))) + +(defun calendar-sync--date-to-time (date) + "Convert DATE to time value for comparison. +DATE should be a list starting with (year month day ...). +Only the first three elements are used; extra elements (hour, minute) are +ignored." + (let ((day (nth 2 date)) + (month (nth 1 date)) + (year (nth 0 date))) + (encode-time 0 0 0 day month year))) + +(defun calendar-sync--before-date-p (date1 date2) + "Return t if DATE1 is before DATE2. +Both dates should be lists like (year month day)." + (time-less-p (calendar-sync--date-to-time date1) + (calendar-sync--date-to-time date2))) + +;;; Datetime Parsing + +(defun calendar-sync--parse-ics-datetime (value) + "Parse iCal datetime VALUE into (year month day hour minute) list. +Returns nil for invalid input. For date-only values, returns +(year month day nil nil). +Handles formats: 20260203T090000Z, 20260203T090000, 20260203." + (when (and value + (stringp value) + (not (string-empty-p value))) + (cond + ;; DateTime format: 20260203T090000Z or 20260203T090000 + ((string-match "\\`\\([0-9]\\{4\\}\\)\\([0-9]\\{2\\}\\)\\([0-9]\\{2\\}\\)T\\([0-9]\\{2\\}\\)\\([0-9]\\{2\\}\\)\\([0-9]\\{2\\}\\)Z?\\'" value) + (list (string-to-number (match-string 1 value)) + (string-to-number (match-string 2 value)) + (string-to-number (match-string 3 value)) + (string-to-number (match-string 4 value)) + (string-to-number (match-string 5 value)))) + ;; Date-only format: 20260203 + ((string-match "\\`\\([0-9]\\{4\\}\\)\\([0-9]\\{2\\}\\)\\([0-9]\\{2\\}\\)\\'" value) + (list (string-to-number (match-string 1 value)) + (string-to-number (match-string 2 value)) + (string-to-number (match-string 3 value)) + nil nil)) + (t nil)))) + +;;; .ics Property Extraction + +(defun calendar-sync--split-events (ics-content) + "Split ICS-CONTENT into individual VEVENT blocks. +Returns list of strings, each containing one VEVENT block." + (let ((events '())) + (with-temp-buffer + (insert ics-content) + (goto-char (point-min)) + (while (search-forward "BEGIN:VEVENT" nil t) + (let ((start (match-beginning 0))) + (when (search-forward "END:VEVENT" nil t) + (push (buffer-substring-no-properties start (point)) events))))) + (nreverse events))) + +(defun calendar-sync--unfold-continuation (text value start) + "Unfold RFC 5545 continuation lines from TEXT starting at START. +VALUE is the initial content to append to. Continuation lines begin +with a space or tab after a newline. Returns (unfolded-value . new-pos)." + (while (and (< start (length text)) + (string-match "\n[ \t]\\([^\n]*\\)" text start) + (= (match-beginning 0) start)) + (setq value (concat value (match-string 1 text))) + (setq start (match-end 0))) + (cons value start)) + +(defun calendar-sync--get-property (event property) + "Extract PROPERTY value from EVENT string. +Handles property parameters (e.g., DTSTART;TZID=America/Chicago:value). +Handles multi-line values (lines starting with space). +Returns nil if property not found." + (when (string-match (format "^%s[^:\n]*:\\(.*\\)$" (regexp-quote property)) event) + (car (calendar-sync--unfold-continuation + event (match-string 1 event) (match-end 0))))) + +(defun calendar-sync--get-property-line (event property) + "Extract full PROPERTY line from EVENT string, including parameters. +Returns the complete line like +`DTSTART;TZID=Europe/Lisbon:20260202T190000'. +Returns nil if property not found." + (when (string-match (format "^\\(%s[^\n]*\\)$" (regexp-quote property)) event) + (match-string 1 event))) + +(defun calendar-sync--get-all-property-lines (event property) + "Extract ALL lines matching PROPERTY from EVENT string. +Unlike `calendar-sync--get-property-line' which returns the first match, +this returns a list of all matching lines. Handles continuation lines +\(lines starting with space or tab). +Returns nil if EVENT or PROPERTY is nil, or no matches found." + (when (and event property (stringp event) (not (string-empty-p event))) + (let ((lines '()) + (pattern (format "^%s[^\n]*" (regexp-quote property))) + (pos 0)) + (while (string-match pattern event pos) + (let* ((result (calendar-sync--unfold-continuation + event (match-string 0 event) (match-end 0))) + (line (car result)) + (end (cdr result))) + (push line lines) + (setq pos (if (< end (length event)) (1+ end) end)))) + (nreverse lines)))) + +(defun calendar-sync--extract-cn (line) + "Extract and dequote CN parameter from iCal LINE. +Returns the CN value string, or nil if not found." + (when (string-match ";CN=\\([^;:]+\\)" line) + (let ((cn (match-string 1 line))) + (if (and (string-prefix-p "\"" cn) (string-suffix-p "\"" cn)) + (substring cn 1 -1) + cn)))) + +(defun calendar-sync--extract-email (line) + "Extract email address from mailto: value in iCal LINE. +Returns email string, or nil if not found." + (when (string-match "mailto:\\([^>\n ]+\\)" line) + (match-string 1 line))) + +(defun calendar-sync--parse-attendee-line (line) + "Parse single ATTENDEE LINE into plist. +Returns plist (:cn NAME :email EMAIL :partstat STATUS :role ROLE). +Returns nil for nil, empty, or malformed input." + (when (and line (stringp line) (not (string-empty-p line)) + (string-match-p "^ATTENDEE" line)) + (let ((cn (calendar-sync--extract-cn line)) + (email (calendar-sync--extract-email line)) + (partstat nil) + (role nil)) + (when (string-match ";PARTSTAT=\\([^;:]+\\)" line) + (setq partstat (match-string 1 line))) + (when (string-match ";ROLE=\\([^;:]+\\)" line) + (setq role (match-string 1 line))) + (when email + (list :cn cn :email email :partstat partstat :role role))))) + +(defun calendar-sync--find-user-status (attendees user-emails) + "Find user's PARTSTAT from ATTENDEES list using USER-EMAILS. +ATTENDEES is list of plists from `calendar-sync--parse-attendee-line'. +USER-EMAILS is list of email strings to match against. +Returns lowercase status string (\"accepted\", \"declined\", etc.) or nil." + (when (and attendees user-emails) + (let ((user-emails-lower (mapcar #'downcase user-emails)) + (found nil)) + (cl-dolist (attendee attendees) + (let ((attendee-email (downcase (or (plist-get attendee :email) "")))) + (when (member attendee-email user-emails-lower) + (let ((partstat (plist-get attendee :partstat))) + (when partstat + (setq found (downcase partstat)) + (cl-return found)))))) + found))) + +(defun calendar-sync--filter-declined (events) + "Return EVENTS with declined entries removed when the toggle is on. +EVENTS is a list of plists produced by `calendar-sync--parse-event'. +Each plist's :status is the lowercase PARTSTAT for the user (set by +`calendar-sync--find-user-status'), or nil for events without an +attendee block. Drops only events whose :status is exactly the string +\"declined\" so that nil / accepted / tentative / needs-action all +survive. When `calendar-sync-skip-declined' is nil, returns EVENTS +unchanged." + (if (and calendar-sync-skip-declined events) + (cl-remove-if (lambda (event) + (equal (plist-get event :status) "declined")) + events) + events)) + +(defun calendar-sync--parse-organizer (event-str) + "Parse ORGANIZER property from EVENT-STR into plist. +Returns plist (:cn NAME :email EMAIL), or nil if no ORGANIZER found." + (when (and event-str (stringp event-str)) + (let ((line (calendar-sync--get-property-line event-str "ORGANIZER"))) + (when line + (let ((email (calendar-sync--extract-email line))) + (when email + (list :cn (calendar-sync--extract-cn line) :email email))))))) + +(defun calendar-sync--extract-meeting-url (event-str) + "Extract meeting URL from EVENT-STR. +Prefers X-GOOGLE-CONFERENCE over URL property. +Returns URL string or nil." + (when (and event-str (stringp event-str)) + (or (calendar-sync--get-property event-str "X-GOOGLE-CONFERENCE") + (calendar-sync--get-property event-str "URL")))) + +(defun calendar-sync--extract-tzid (property-line) + "Extract TZID parameter value from PROPERTY-LINE. +PROPERTY-LINE is like `DTSTART;TZID=Europe/Lisbon:20260202T190000'. +Returns timezone string like `Europe/Lisbon', or nil if no TZID. +Returns nil for malformed lines (missing colon separator)." + (when (and property-line + (stringp property-line) + ;; Must have colon (property:value format) + (string-match-p ":" property-line) + (string-match ";TZID=\\([^;:]+\\)" property-line)) + (match-string 1 property-line))) + +;;; Timezone / Timestamp Conversion + +(defun calendar-sync--convert-utc-to-local (year month day hour minute second) + "Convert UTC datetime to local time. +Returns list (year month day hour minute) in local timezone." + (let* ((utc-time (encode-time second minute hour day month year 0)) + (local-time (decode-time utc-time))) + (list (nth 5 local-time) ; year + (nth 4 local-time) ; month + (nth 3 local-time) ; day + (nth 2 local-time) ; hour + (nth 1 local-time)))) + +(defun calendar-sync--convert-tz-to-local (year month day hour minute source-tz) + "Convert datetime from SOURCE-TZ timezone to local time. +SOURCE-TZ is a timezone name like `Europe/Lisbon' or `Asia/Yerevan'. +Returns list (year month day hour minute) in local timezone, or nil on error. + +Uses Emacs built-in timezone support (encode-time/decode-time with ZONE +argument) for fast, subprocess-free conversion. Uses the same system +TZ database as the `date' command." + (when (and source-tz (not (string-empty-p source-tz))) + (condition-case err + (let* ((abs-time (encode-time 0 minute hour day month year source-tz)) + (local (decode-time abs-time))) + (list (nth 5 local) ; year + (nth 4 local) ; month + (nth 3 local) ; day + (nth 2 local) ; hour + (nth 1 local))) ; minute + (error + (calendar-sync--log-silently "calendar-sync: Error converting timezone %s: %s" + source-tz (error-message-string err)) + nil)))) + +(defun calendar-sync--localize-parsed-datetime (parsed is-utc tzid) + "Convert PARSED datetime to local time using timezone info. +PARSED is (year month day hour minute) or (year month day nil nil). +IS-UTC non-nil means the value had a Z suffix. + +TZID is a timezone string like \"Europe/Lisbon\", or nil. +Returns PARSED converted to local time, or PARSED unchanged if no +conversion needed." + (cond + (is-utc + (calendar-sync--convert-utc-to-local + (nth 0 parsed) (nth 1 parsed) (nth 2 parsed) + (or (nth 3 parsed) 0) (or (nth 4 parsed) 0) 0)) + (tzid + (or (calendar-sync--convert-tz-to-local + (nth 0 parsed) (nth 1 parsed) (nth 2 parsed) + (or (nth 3 parsed) 0) (or (nth 4 parsed) 0) + tzid) + parsed)) + (t parsed))) + +(defun calendar-sync--parse-timestamp (timestamp-str &optional tzid) + "Parse iCal timestamp string TIMESTAMP-STR. +Returns (year month day hour minute) or (year month day) for all-day events. +Converts UTC times (ending in Z) to local time. +If TZID is provided (e.g., `Europe/Lisbon'), converts from that timezone +to local. +Returns nil if parsing fails." + (cond + ;; DateTime format: 20251116T140000Z or 20251116T140000 + ((string-match "\\([0-9]\\{4\\}\\)\\([0-9]\\{2\\}\\)\\([0-9]\\{2\\}\\)T\\([0-9]\\{2\\}\\)\\([0-9]\\{2\\}\\)\\([0-9]\\{2\\}\\)\\(Z\\)?" timestamp-str) + (let* ((year (string-to-number (match-string 1 timestamp-str))) + (month (string-to-number (match-string 2 timestamp-str))) + (day (string-to-number (match-string 3 timestamp-str))) + (hour (string-to-number (match-string 4 timestamp-str))) + (minute (string-to-number (match-string 5 timestamp-str))) + (second (string-to-number (match-string 6 timestamp-str))) + (is-utc (match-string 7 timestamp-str))) + (cond + ;; UTC timestamp (Z suffix) - convert from UTC + (is-utc + (calendar-sync--convert-utc-to-local year month day hour minute second)) + ;; TZID provided - convert from that timezone + (tzid + (or (calendar-sync--convert-tz-to-local year month day hour minute tzid) + ;; Fallback to raw time if conversion fails + (list year month day hour minute))) + ;; No timezone info - assume local time + (t + (list year month day hour minute))))) + ;; Date format: 20251116 + ((string-match "\\([0-9]\\{4\\}\\)\\([0-9]\\{2\\}\\)\\([0-9]\\{2\\}\\)" timestamp-str) + (list (string-to-number (match-string 1 timestamp-str)) + (string-to-number (match-string 2 timestamp-str)) + (string-to-number (match-string 3 timestamp-str)))) + (t nil))) + +(defun calendar-sync--format-timestamp (start end) + "Format START and END timestamps as org timestamp. +START and END are lists from `calendar-sync--parse-timestamp'. +Returns string like '<2025-11-16 Sun 14:00-15:00>' or '<2025-11-16 Sun>'." + (let* ((year (nth 0 start)) + (month (nth 1 start)) + (day (nth 2 start)) + (start-hour (nth 3 start)) + (start-min (nth 4 start)) + (end-hour (and end (nth 3 end))) + (end-min (and end (nth 4 end))) + (date-str (format-time-string + "<%Y-%m-%d %a" + (encode-time 0 0 0 day month year))) + (time-str (when (and start-hour end-hour) + (format " %02d:%02d-%02d:%02d" + start-hour start-min end-hour end-min)))) + (concat date-str time-str ">"))) + +;;; Single Event Parsing + +(defun calendar-sync--parse-event (event-str) + "Parse single VEVENT string EVENT-STR into plist. +Returns plist with :uid :summary :description :location :start :end +:attendees :organizer :url :status. +Returns nil if event lacks required fields (DTSTART, SUMMARY). +Skips events with RECURRENCE-ID (individual instances of recurring events +are handled separately via exception collection). +Handles TZID-qualified timestamps by converting to local time. +Cleans text fields (description, location, summary) via +`calendar-sync--clean-text'." + ;; Skip individual instances of recurring events (they're collected as exceptions) + (unless (calendar-sync--get-property event-str "RECURRENCE-ID") + (let* ((uid (calendar-sync--get-property event-str "UID")) + (summary (calendar-sync--clean-text + (calendar-sync--get-property event-str "SUMMARY"))) + (description (calendar-sync--clean-text + (calendar-sync--get-property event-str "DESCRIPTION"))) + (location (calendar-sync--clean-text + (calendar-sync--get-property event-str "LOCATION"))) + ;; Get raw property values + (dtstart (calendar-sync--get-property event-str "DTSTART")) + (dtend (calendar-sync--get-property event-str "DTEND")) + ;; Extract TZID from property lines (if present) + (dtstart-line (calendar-sync--get-property-line event-str "DTSTART")) + (dtend-line (calendar-sync--get-property-line event-str "DTEND")) + (start-tzid (calendar-sync--extract-tzid dtstart-line)) + (end-tzid (calendar-sync--extract-tzid dtend-line)) + ;; Extract attendees + (attendee-lines (calendar-sync--get-all-property-lines event-str "ATTENDEE")) + (attendees (delq nil (mapcar #'calendar-sync--parse-attendee-line attendee-lines))) + ;; Extract organizer and URL + (organizer (calendar-sync--parse-organizer event-str)) + (url (calendar-sync--extract-meeting-url event-str)) + ;; Determine user status from attendees + (status (calendar-sync--find-user-status attendees calendar-sync-user-emails))) + (when (and summary dtstart) + (let ((start-parsed (calendar-sync--parse-timestamp dtstart start-tzid)) + (end-parsed (and dtend (calendar-sync--parse-timestamp dtend end-tzid)))) + (when start-parsed + (list :uid uid + :summary summary + :description description + :location location + :start start-parsed + :end end-parsed + :attendees attendees + :organizer organizer + :url url + :status status))))))) + +(defun calendar-sync--event-start-time (event) + "Extract comparable start time from EVENT plist. +Returns time value suitable for comparison, or 0 if no start time." + (let ((start (plist-get event :start))) + (if start + (apply #'encode-time + 0 ; second + (or (nth 4 start) 0) ; minute + (or (nth 3 start) 0) ; hour + (nth 2 start) ; day + (nth 1 start) ; month + (nth 0 start) ; year + nil) + 0))) + +(provide 'calendar-sync-ics) +;;; calendar-sync-ics.el ends here diff --git a/modules/calendar-sync-org.el b/modules/calendar-sync-org.el new file mode 100644 index 000000000..9ea5a129d --- /dev/null +++ b/modules/calendar-sync-org.el @@ -0,0 +1,94 @@ +;;; calendar-sync-org.el --- Org rendering and atomic file output -*- coding: utf-8; lexical-binding: t; -*- + +;; Author: Craig Jennings <c@cjennings.net> +;; Created: 2025-11-16 + +;;; Commentary: +;; +;; Layer: 3 (Domain Workflow). +;; Category: D. +;; Load shape: library. +;; Top-level side effects: none (defuns only). +;; Runtime requires: subr-x, cj-org-text-lib, calendar-sync-ics. +;; Direct test load: yes (requires calendar-sync-ics explicitly). +;; +;; Output layer of the calendar-sync parser: render a parsed event plist +;; into an Org entry (heading, property drawer, body) and write generated +;; content to disk atomically via a same-directory temp file plus rename, +;; so a reader never sees a half-written calendar. + +;;; Code: + +(require 'subr-x) +(require 'cj-org-text-lib) +(require 'calendar-sync-ics) + +;;; Org Rendering + +(defun calendar-sync--event-to-org (event) + "Convert parsed EVENT plist to org entry string. +Produces property drawer with LOCATION, ORGANIZER, STATUS, URL when present. +Description appears as body text after the drawer." + (let* ((summary (cj/org-sanitize-heading + (or (plist-get event :summary) "(No Title)"))) + (description (plist-get event :description)) + (location (plist-get event :location)) + (start (plist-get event :start)) + (end (plist-get event :end)) + (organizer (plist-get event :organizer)) + (status (plist-get event :status)) + (url (plist-get event :url)) + (timestamp (calendar-sync--format-timestamp start end)) + ;; Build property drawer entries + (props '())) + ;; Collect non-nil properties + (when (and location (not (string-empty-p location))) + (push (format ":LOCATION: %s" + (cj/org-sanitize-property-value location)) + props)) + (when organizer + (let ((org-name (or (plist-get organizer :cn) + (plist-get organizer :email)))) + (when org-name + (push (format ":ORGANIZER: %s" + (cj/org-sanitize-property-value org-name)) + props)))) + (when (and status (not (string-empty-p status))) + (push (format ":STATUS: %s" + (cj/org-sanitize-property-value status)) + props)) + (when (and url (not (string-empty-p url))) + (push (format ":URL: %s" + (cj/org-sanitize-property-value url)) + props)) + (setq props (nreverse props)) + ;; Build output + (let ((parts (list timestamp (format "* %s" summary)))) + ;; Add property drawer if any properties exist + (when props + (push ":PROPERTIES:" parts) + (dolist (prop props) + (push prop parts)) + (push ":END:" parts)) + ;; Add description as body text (sanitized to prevent org heading conflicts) + (when (and description (not (string-empty-p description))) + (push (cj/org-sanitize-body-text description) parts)) + (string-join (nreverse parts) "\n")))) + +;;; Atomic File Output + +(defun calendar-sync--write-file (content file) + "Write CONTENT to FILE atomically. +Creates parent directories if needed, then writes a temp file in the same +directory and renames it into place, so org-agenda or chime reading mid-write +never sees a half-written calendar." + (let ((dir (file-name-directory file))) + (unless (file-directory-p dir) + (make-directory dir t)) + (let ((tmp (make-temp-file (expand-file-name ".calendar-sync-" dir)))) + (with-temp-file tmp + (insert content)) + (rename-file tmp file t)))) + +(provide 'calendar-sync-org) +;;; calendar-sync-org.el ends here diff --git a/modules/calendar-sync-recurrence.el b/modules/calendar-sync-recurrence.el new file mode 100644 index 000000000..d4f70b7d1 --- /dev/null +++ b/modules/calendar-sync-recurrence.el @@ -0,0 +1,405 @@ +;;; calendar-sync-recurrence.el --- RRULE / EXDATE / RECURRENCE-ID expansion -*- coding: utf-8; lexical-binding: t; -*- + +;; Author: Craig Jennings <c@cjennings.net> +;; Created: 2025-11-16 + +;;; Commentary: +;; +;; Layer: 3 (Domain Workflow). +;; Category: D. +;; Load shape: library. +;; Top-level side effects: none (defuns and defaliases only). +;; Runtime requires: cl-lib, subr-x, calendar-sync-ics. +;; Direct test load: yes (requires calendar-sync-ics explicitly). +;; +;; Recurrence layer of the calendar-sync parser: RECURRENCE-ID exception +;; collection and application, EXDATE exclusion, RRULE parsing, and +;; expansion of daily/weekly/monthly/yearly series into concrete +;; occurrences. Builds on calendar-sync-ics for property extraction, +;; timestamp parsing, date arithmetic, and single-event parsing. + +;;; Code: + +(require 'cl-lib) +(require 'subr-x) +(require 'calendar-sync-ics) + +;; Configuration owned by calendar-sync.el; declared special here. +(defvar calendar-sync-user-emails) + +;;; RECURRENCE-ID Exception Handling + +(defun calendar-sync--get-recurrence-id (event-str) + "Extract RECURRENCE-ID value from EVENT-STR. +Returns the datetime value (without TZID parameter), or nil if not found. +Handles both simple values and values with parameters like TZID." + (when (and event-str (stringp event-str)) + (calendar-sync--get-property event-str "RECURRENCE-ID"))) + +(defun calendar-sync--get-recurrence-id-line (event-str) + "Extract full RECURRENCE-ID line from EVENT-STR, including parameters. +Returns the complete line like +`RECURRENCE-ID;TZID=Europe/Tallinn:20260203T170000'. +Returns nil if not found." + (when (and event-str (stringp event-str)) + (calendar-sync--get-property-line event-str "RECURRENCE-ID"))) + +(defalias 'calendar-sync--parse-recurrence-id #'calendar-sync--parse-ics-datetime + "Parse RECURRENCE-ID value. See `calendar-sync--parse-ics-datetime'.") + +(defun calendar-sync--parse-exception-event (event-str) + "Parse a RECURRENCE-ID override EVENT-STR into an exception plist, or nil. +Returns nil when EVENT-STR carries no RECURRENCE-ID, or its recurrence-id / +start time fail to parse. The plist holds :recurrence-id (localized), +:recurrence-id-raw, :start, :end, :summary, :description, :location." + (let ((recurrence-id (calendar-sync--get-recurrence-id event-str))) + (when recurrence-id + (let* ((recurrence-id-line (calendar-sync--get-recurrence-id-line event-str)) + (recurrence-id-tzid (calendar-sync--extract-tzid recurrence-id-line)) + (recurrence-id-is-utc (string-suffix-p "Z" recurrence-id)) + (recurrence-id-parsed (calendar-sync--parse-recurrence-id recurrence-id)) + ;; Parse the new times from the exception + (dtstart (calendar-sync--get-property event-str "DTSTART")) + (dtend (calendar-sync--get-property event-str "DTEND")) + (dtstart-line (calendar-sync--get-property-line event-str "DTSTART")) + (dtend-line (calendar-sync--get-property-line event-str "DTEND")) + (start-tzid (calendar-sync--extract-tzid dtstart-line)) + (end-tzid (calendar-sync--extract-tzid dtend-line)) + (start-parsed (calendar-sync--parse-timestamp dtstart start-tzid)) + (end-parsed (and dtend (calendar-sync--parse-timestamp dtend end-tzid))) + (summary (calendar-sync--clean-text + (calendar-sync--get-property event-str "SUMMARY"))) + (description (calendar-sync--clean-text + (calendar-sync--get-property event-str "DESCRIPTION"))) + (location (calendar-sync--clean-text + (calendar-sync--get-property event-str "LOCATION")))) + (when (and recurrence-id-parsed start-parsed) + (list :recurrence-id (calendar-sync--localize-parsed-datetime + recurrence-id-parsed recurrence-id-is-utc recurrence-id-tzid) + :recurrence-id-raw recurrence-id + :start start-parsed + :end end-parsed + :summary summary + :description description + :location location)))))) + +(defun calendar-sync--collect-recurrence-exceptions (ics-content) + "Collect all RECURRENCE-ID events from ICS-CONTENT. +Returns hash table mapping UID to list of exception event plists. +Each exception plist contains :recurrence-id (parsed), :start, :end, +:summary, etc." + (let ((exceptions (make-hash-table :test 'equal))) + (when (and ics-content (stringp ics-content)) + (dolist (event-str (calendar-sync--split-events ics-content)) + (let ((uid (calendar-sync--get-property event-str "UID")) + (exception-plist (calendar-sync--parse-exception-event event-str))) + (when (and uid exception-plist) + (puthash uid + (cons exception-plist (gethash uid exceptions)) + exceptions))))) + exceptions)) + +(defun calendar-sync--occurrence-matches-exception-p (occurrence exception) + "Check if OCCURRENCE matches EXCEPTION's recurrence-id. +Compares year, month, day, hour, minute." + (let ((occ-start (plist-get occurrence :start)) + (exc-recid (plist-get exception :recurrence-id))) + (and occ-start exc-recid + (= (nth 0 occ-start) (nth 0 exc-recid)) ; year + (= (nth 1 occ-start) (nth 1 exc-recid)) ; month + (= (nth 2 occ-start) (nth 2 exc-recid)) ; day + ;; Hour/minute check (handle nil for all-day events) + (or (and (null (nth 3 occ-start)) (null (nth 3 exc-recid))) + (and (nth 3 occ-start) (nth 3 exc-recid) + (= (nth 3 occ-start) (nth 3 exc-recid)) + (= (or (nth 4 occ-start) 0) (or (nth 4 exc-recid) 0))))))) + +(defun calendar-sync--apply-single-exception (occurrence exception) + "Apply EXCEPTION to OCCURRENCE, returning modified occurrence." + (let ((result (copy-sequence occurrence))) + ;; Update time from exception + (plist-put result :start (plist-get exception :start)) + (when (plist-get exception :end) + (plist-put result :end (plist-get exception :end))) + ;; Update summary if exception has one + (when (plist-get exception :summary) + (plist-put result :summary (plist-get exception :summary))) + ;; Update other fields + (when (plist-get exception :description) + (plist-put result :description (plist-get exception :description))) + (when (plist-get exception :location) + (plist-put result :location (plist-get exception :location))) + ;; Pass through new fields if exception overrides them + (when (plist-get exception :attendees) + (plist-put result :attendees (plist-get exception :attendees)) + ;; Re-derive the user's status from the overridden attendees so a + ;; singly-declined occurrence drops its inherited series "accepted" + ;; (otherwise `calendar-sync--filter-declined' can't drop it). Leave the + ;; inherited status when the override doesn't name the user. + (let ((status (calendar-sync--find-user-status + (plist-get exception :attendees) calendar-sync-user-emails))) + (when status + (plist-put result :status status)))) + (when (plist-get exception :organizer) + (plist-put result :organizer (plist-get exception :organizer))) + (when (plist-get exception :url) + (plist-put result :url (plist-get exception :url))) + result)) + +(defun calendar-sync--apply-recurrence-exceptions (occurrences exceptions) + "Apply EXCEPTIONS to OCCURRENCES list. +OCCURRENCES is list of event plists from RRULE expansion. +EXCEPTIONS is hash table from `calendar-sync--collect-recurrence-exceptions'. +Returns new list with matching occurrences replaced by exception times." + (if (or (null occurrences) (null exceptions)) + occurrences + (mapcar + (lambda (occurrence) + (let* ((uid (plist-get occurrence :uid)) + (uid-exceptions (and uid (gethash uid exceptions)))) + (if (null uid-exceptions) + occurrence + ;; Check if any exception matches this occurrence + (let ((matching-exception + (cl-find-if (lambda (exc) + (calendar-sync--occurrence-matches-exception-p occurrence exc)) + uid-exceptions))) + (if matching-exception + (calendar-sync--apply-single-exception occurrence matching-exception) + occurrence))))) + occurrences))) + +;;; EXDATE (Excluded Date) Handling + +(defun calendar-sync--get-exdates (event-str) + "Extract all EXDATE values from EVENT-STR. +Returns list of datetime strings (without TZID parameters), or nil if +none found. +Handles both simple values and values with parameters like TZID." + (when (and event-str (stringp event-str) (not (string-empty-p event-str))) + (let ((exdates '()) + (pos 0)) + ;; Find all EXDATE lines + (while (string-match "^EXDATE[^:\n]*:\\([^\n]+\\)" event-str pos) + (push (match-string 1 event-str) exdates) + (setq pos (match-end 0))) + (nreverse exdates)))) + +(defun calendar-sync--get-exdate-line (event-str exdate-value) + "Find the full EXDATE line containing EXDATE-VALUE from EVENT-STR. +Returns the complete line like +`EXDATE;TZID=America/New_York:20260210T130000'. +Returns nil if not found." + (when (and event-str (stringp event-str) exdate-value) + (let ((pattern (format "^\\(EXDATE[^:]*:%s\\)" (regexp-quote exdate-value)))) + (when (string-match pattern event-str) + (match-string 1 event-str))))) + +(defalias 'calendar-sync--parse-exdate #'calendar-sync--parse-ics-datetime + "Parse EXDATE value. See `calendar-sync--parse-ics-datetime'.") + +(defun calendar-sync--collect-exdates (event-str) + "Collect all excluded dates from EVENT-STR, handling timezone conversion. +Returns list of parsed datetime lists (year month day hour minute). +Converts TZID-qualified and UTC times to local time." + (if (or (null event-str) + (not (stringp event-str)) + (string-empty-p event-str)) + '() + (let ((exdate-values (calendar-sync--get-exdates event-str)) + (result '())) + (dolist (exdate-value exdate-values) + (let* ((exdate-line (calendar-sync--get-exdate-line event-str exdate-value)) + (exdate-tzid (and exdate-line (calendar-sync--extract-tzid exdate-line))) + (exdate-is-utc (and exdate-value (string-suffix-p "Z" exdate-value))) + (exdate-parsed (calendar-sync--parse-exdate exdate-value))) + (when exdate-parsed + (push (calendar-sync--localize-parsed-datetime + exdate-parsed exdate-is-utc exdate-tzid) + result)))) + (nreverse result)))) + +(defun calendar-sync--exdate-matches-p (occurrence-start exdate) + "Check if OCCURRENCE-START matches EXDATE. +OCCURRENCE-START is (year month day hour minute). +EXDATE is (year month day hour minute) or (year month day nil nil) for +date-only. +Date-only EXDATE matches any time on that day." + (and occurrence-start exdate + (= (nth 0 occurrence-start) (nth 0 exdate)) ; year + (= (nth 1 occurrence-start) (nth 1 exdate)) ; month + (= (nth 2 occurrence-start) (nth 2 exdate)) ; day + ;; If EXDATE has nil hour/minute (date-only), match any time + (or (null (nth 3 exdate)) + (and (nth 3 occurrence-start) + (= (nth 3 occurrence-start) (nth 3 exdate)) + (= (or (nth 4 occurrence-start) 0) (or (nth 4 exdate) 0)))))) + +(defun calendar-sync--filter-exdates (occurrences exdates) + "Filter OCCURRENCES list to remove entries matching EXDATES. +OCCURRENCES is list of event plists with :start key. +EXDATES is list of parsed datetime lists from `calendar-sync--collect-exdates'. +Returns filtered list with excluded dates removed." + (if (or (null occurrences) (null exdates)) + (or occurrences '()) + (cl-remove-if + (lambda (occurrence) + (let ((occ-start (plist-get occurrence :start))) + (cl-some (lambda (exdate) + (calendar-sync--exdate-matches-p occ-start exdate)) + exdates))) + occurrences))) + +;;; RRULE Parsing and Expansion + +(defun calendar-sync--create-occurrence (base-event occurrence-date) + "Create an occurrence from BASE-EVENT with OCCURRENCE-DATE. +OCCURRENCE-DATE should be a list (year month day hour minute second)." + (let* ((occurrence (copy-sequence base-event)) + (end (plist-get base-event :end))) + (plist-put occurrence :start occurrence-date) + (when end + ;; Use the date from occurrence-date but keep the time from the original end + (let ((date-only (list (nth 0 occurrence-date) + (nth 1 occurrence-date) + (nth 2 occurrence-date)))) + (plist-put occurrence :end (append date-only (nthcdr 3 end))))) + occurrence)) + +(defun calendar-sync--parse-rrule (rrule-str) + "Parse RRULE string into plist. +Returns plist with :freq :interval :byday :until :count." + (let ((parts (split-string rrule-str ";")) + (result '())) + (dolist (part parts) + (when (string-match "\\([^=]+\\)=\\(.+\\)" part) + (let ((key (match-string 1 part)) + (value (match-string 2 part))) + (pcase key + ("FREQ" (setq result (plist-put result :freq (intern (downcase value))))) + ("INTERVAL" (setq result (plist-put result :interval (string-to-number value)))) + ("BYDAY" (setq result (plist-put result :byday (split-string value ",")))) + ("UNTIL" (setq result (plist-put result :until (calendar-sync--parse-timestamp value)))) + ("COUNT" (setq result (plist-put result :count (string-to-number value)))))))) + ;; Set defaults + (unless (plist-get result :interval) + (setq result (plist-put result :interval 1))) + result)) + +(defun calendar-sync--expand-simple-recurrence (base-event rrule range advance-fn) + "Expand a simple (non-weekly) recurring event using ADVANCE-FN to step dates. +BASE-EVENT is the event plist, RRULE is parsed rrule, RANGE is date range. +ADVANCE-FN takes (current-date interval) and returns the next date." + (let* ((start (plist-get base-event :start)) + (interval (plist-get rrule :interval)) + (until (plist-get rrule :until)) + (count (plist-get rrule :count)) + (occurrences '()) + (current-date (list (nth 0 start) (nth 1 start) (nth 2 start))) + (num-generated 0) + (range-end-time (cadr range))) + (while (and (or count until (time-less-p (calendar-sync--date-to-time current-date) range-end-time)) + (or (not until) (calendar-sync--before-date-p current-date until)) + (or (not count) (< num-generated count))) + (let ((occurrence-datetime (append current-date (nthcdr 3 start)))) + (setq num-generated (1+ num-generated)) + (when (calendar-sync--date-in-range-p occurrence-datetime range) + (push (calendar-sync--create-occurrence base-event occurrence-datetime) + occurrences))) + (setq current-date (funcall advance-fn current-date interval))) + (nreverse occurrences))) + +(defun calendar-sync--expand-daily (base-event rrule range) + "Expand daily recurring event. +BASE-EVENT is the event plist, RRULE is parsed rrule, RANGE is date range." + (calendar-sync--expand-simple-recurrence + base-event rrule range #'calendar-sync--add-days)) + +(defun calendar-sync--expand-weekly (base-event rrule range) + "Expand weekly recurring event. +BASE-EVENT is the event plist, RRULE is parsed rrule, RANGE is date range." + (let* ((start (plist-get base-event :start)) + (interval (plist-get rrule :interval)) + (byday (plist-get rrule :byday)) + (until (plist-get rrule :until)) + (count (plist-get rrule :count)) + (occurrences '()) + (current-date (list (nth 0 start) (nth 1 start) (nth 2 start))) + (num-generated 0) + (range-end-time (cadr range)) + (max-iterations 1000) ;; Safety: prevent infinite loops + (iterations 0) + (weekdays (if byday + (mapcar #'calendar-sync--weekday-to-number byday) + (list (calendar-sync--date-weekday current-date))))) + ;; Validate interval + (when (<= interval 0) + (error "Invalid RRULE interval: %s (must be > 0)" interval)) + ;; Start from the first week + ;; For infinite recurrence (no COUNT/UNTIL), stop at range-end for performance + ;; For COUNT, generate all occurrences from start regardless of range + (while (and (< iterations max-iterations) + (or count until (time-less-p (calendar-sync--date-to-time current-date) range-end-time)) + (or (not count) (< num-generated count)) + (or (not until) (calendar-sync--before-date-p current-date until))) + (setq iterations (1+ iterations)) + ;; Generate occurrences for each weekday in this week + (dolist (weekday weekdays) + (let* ((current-weekday (calendar-sync--date-weekday current-date)) + (days-ahead (mod (- weekday current-weekday) 7)) + (occurrence-date (calendar-sync--add-days current-date days-ahead)) + (occurrence-datetime (append occurrence-date (nthcdr 3 start)))) + ;; Check UNTIL date first + (when (or (not until) (calendar-sync--before-date-p occurrence-date until)) + ;; Check COUNT - increment BEFORE range check so COUNT is absolute from start + (when (or (not count) (< num-generated count)) + (setq num-generated (1+ num-generated)) + ;; Only add to output if within date range + (when (calendar-sync--date-in-range-p occurrence-datetime range) + (push (calendar-sync--create-occurrence base-event occurrence-datetime) + occurrences)))))) + ;; Move to next interval week + (setq current-date (calendar-sync--add-days current-date (* 7 interval)))) + (when (>= iterations max-iterations) + (calendar-sync--log-silently "calendar-sync: WARNING: Hit max iterations (%d) expanding weekly event" max-iterations)) + (nreverse occurrences))) + +(defun calendar-sync--expand-monthly (base-event rrule range) + "Expand monthly recurring event. +BASE-EVENT is the event plist, RRULE is parsed rrule, RANGE is date range." + (calendar-sync--expand-simple-recurrence + base-event rrule range #'calendar-sync--add-months)) + +(defun calendar-sync--expand-yearly (base-event rrule range) + "Expand yearly recurring event. +BASE-EVENT is the event plist, RRULE is parsed rrule, RANGE is date range." + (calendar-sync--expand-simple-recurrence + base-event rrule range + (lambda (date interval) (calendar-sync--add-months date (* 12 interval))))) + +(defun calendar-sync--expand-recurring-event (event-str range) + "Expand recurring event EVENT-STR into individual occurrences within RANGE. +Returns list of event plists, or nil if not a recurring event. +Filters out dates excluded via EXDATE properties." + (let ((rrule (calendar-sync--get-property event-str "RRULE"))) + (when rrule + (let* ((base-event (calendar-sync--parse-event event-str)) + (parsed-rrule (calendar-sync--parse-rrule rrule)) + (freq (plist-get parsed-rrule :freq)) + (exdates (calendar-sync--collect-exdates event-str))) + (when base-event + (let ((occurrences + (pcase freq + ('daily (calendar-sync--expand-daily base-event parsed-rrule range)) + ('weekly (calendar-sync--expand-weekly base-event parsed-rrule range)) + ('monthly (calendar-sync--expand-monthly base-event parsed-rrule range)) + ('yearly (calendar-sync--expand-yearly base-event parsed-rrule range)) + (_ (calendar-sync--log-silently "calendar-sync: Unsupported RRULE frequency: %s" freq) + nil)))) + ;; Filter out EXDATE occurrences + (if exdates + (calendar-sync--filter-exdates occurrences exdates) + occurrences))))))) + +(provide 'calendar-sync-recurrence) +;;; calendar-sync-recurrence.el ends here diff --git a/modules/calendar-sync-source.el b/modules/calendar-sync-source.el new file mode 100644 index 000000000..d9efc885b --- /dev/null +++ b/modules/calendar-sync-source.el @@ -0,0 +1,426 @@ +;;; calendar-sync-source.el --- Feed fetch, state, and conversion workers -*- coding: utf-8; lexical-binding: t; -*- + +;; Author: Craig Jennings <c@cjennings.net> +;; Created: 2025-11-16 + +;;; Commentary: +;; +;; Layer: 3 (Domain Workflow). +;; Category: D/S. +;; Load shape: library. +;; Top-level side effects: none (defuns plus internal state defvars). +;; Runtime requires: subr-x, system-lib, calendar-sync-ics. +;; Direct test load: yes (requires calendar-sync-ics explicitly). +;; +;; Source layer of calendar-sync: per-calendar sync state and its on-disk +;; persistence, asynchronous .ics fetching via curl, the batch Emacs +;; conversion worker, and the Google Calendar API fetch path. Drives a +;; single calendar from either its .ics feed or the API helper. +;; +;; The batch worker loads the top calendar-sync module (whose path is held +;; in `calendar-sync--module-file') and there calls `calendar-sync--parse-ics' +;; and `calendar-sync--write-file'. Those live in the top and org modules +;; respectively, which require this one, so they are forward-declared here +;; rather than required (the worker has the full graph loaded, and these +;; functions are only ever invoked inside it). + +;;; Code: + +(require 'subr-x) +(require 'system-lib) ;; provides cj/auth-source-secret-value +(require 'calendar-sync-ics) + +;; Owned by calendar-sync.el (config) / calendar-sync-org.el (output); +;; forward-declared so this module compiles and reads them without a cycle. +(defvar calendar-sync-calendars) +(defvar calendar-sync-fetch-timeout) +(defvar calendar-sync-python-command) +(defvar calendar-sync-past-months) +(defvar calendar-sync-future-months) +(defvar calendar-sync-user-emails) +(defvar calendar-sync-skip-declined) +(defvar calendar-sync-private-config-file) +(defvar calendar-sync--module-file) +(declare-function calendar-sync--parse-ics "calendar-sync" (ics-content)) +(declare-function calendar-sync--write-file "calendar-sync-org" (content file)) + +;;; Internal state + +(defvar calendar-sync--calendar-states (make-hash-table :test 'equal) + "Per-calendar sync state. +Hash table mapping calendar name (string) to state plist with: + :last-sync - Time of last successful sync + :status - Symbol: ok, error, or syncing + :last-error - Error message string, or nil") + +(defvar calendar-sync--state-file + (expand-file-name "persist/calendar-sync-state.el" user-emacs-directory) + "File to persist sync state across Emacs sessions.") + +;;; State Persistence + +(defun calendar-sync--save-state () + "Save sync state to disk for persistence across sessions." + (let* ((calendar-states-alist + (let ((result '())) + (maphash (lambda (name state) + (push (cons name state) result)) + calendar-sync--calendar-states) + result)) + (state `((timezone-offset . ,calendar-sync--last-timezone-offset) + (calendar-states . ,calendar-states-alist))) + (dir (file-name-directory calendar-sync--state-file))) + (unless (file-directory-p dir) + (make-directory dir t)) + (let ((tmp (make-temp-file (expand-file-name ".calendar-sync-state-" dir)))) + (with-temp-file tmp + (prin1 state (current-buffer))) + (rename-file tmp calendar-sync--state-file t)))) + +(defun calendar-sync--load-state () + "Load sync state from disk." + (when (file-exists-p calendar-sync--state-file) + (condition-case err + (with-temp-buffer + (insert-file-contents calendar-sync--state-file) + (let ((state (read (current-buffer)))) + (setq calendar-sync--last-timezone-offset + (alist-get 'timezone-offset state)) + ;; Load per-calendar states + (let ((cal-states (alist-get 'calendar-states state))) + (clrhash calendar-sync--calendar-states) + (dolist (entry cal-states) + (puthash (car entry) (cdr entry) calendar-sync--calendar-states))))) + (error + (calendar-sync--log-silently "calendar-sync: Error loading state: %s" (error-message-string err)))))) + +(defun calendar-sync--get-calendar-state (calendar-name) + "Get state plist for CALENDAR-NAME, or nil if not found." + (gethash calendar-name calendar-sync--calendar-states)) + +(defun calendar-sync--set-calendar-state (calendar-name state) + "Set STATE plist for CALENDAR-NAME." + (puthash calendar-name state calendar-sync--calendar-states)) + +;;; Debug Logging + +(defun calendar-sync--debug-p () + "Return non-nil if calendar-sync debug logging is enabled. +Checks `cj/debug-modules' for symbol `calendar-sync' or t (all)." + (and (boundp 'cj/debug-modules) + (or (eq cj/debug-modules t) + (memq 'calendar-sync cj/debug-modules)))) + +;;; Private Config + +(defun calendar-sync--load-private-config () + "Load private calendar-sync configuration when available." + (when (file-readable-p calendar-sync-private-config-file) + (condition-case err + (load calendar-sync-private-config-file nil t) + (error + (message "calendar-sync: Failed to load private config %s: %s" + (abbreviate-file-name calendar-sync-private-config-file) + (error-message-string err)))))) + +;;; .ics Fetch + +(defun calendar-sync--fetch-ics (url callback) + "Fetch .ics file from URL asynchronously using curl. +Calls CALLBACK with the .ics content as string (normalized to Unix line endings) +or nil on error. CALLBACK signature: (lambda (content) ...). + +The fetch happens asynchronously and doesn't block Emacs. The callback is +invoked when the fetch completes, either successfully or with an error." + (condition-case err + (let ((buffer (generate-new-buffer " *calendar-sync-curl*"))) + (make-process + :name "calendar-sync-curl" + :buffer buffer + :command (list "curl" "-s" "-L" "--fail" + "--connect-timeout" "10" + "--max-time" (number-to-string calendar-sync-fetch-timeout) + url) + :sentinel + (lambda (process event) + (when (memq (process-status process) '(exit signal)) + (let ((buf (process-buffer process))) + (when (buffer-live-p buf) + (let ((content + (with-current-buffer buf + (if (and (eq (process-status process) 'exit) + (= (process-exit-status process) 0)) + (calendar-sync--normalize-line-endings (buffer-string)) + (calendar-sync--log-silently "calendar-sync: Fetch error: curl failed: %s" (string-trim event)) + nil)))) + (kill-buffer buf) + (funcall callback content)))))))) + (error + (calendar-sync--log-silently "calendar-sync: Fetch error: %s" (error-message-string err)) + (funcall callback nil)))) + +(defun calendar-sync--fetch-ics-file (url callback) + "Fetch .ics from URL to a temp file asynchronously. +Calls CALLBACK with the temp file path on success, or nil on error. The caller +owns deleting the temp file after a successful callback." + (condition-case err + (let ((buffer (generate-new-buffer " *calendar-sync-curl*")) + (temp-file (make-temp-file "calendar-sync-" nil ".ics"))) + (make-process + :name "calendar-sync-curl" + :buffer buffer + :command (list "curl" "-s" "-L" "--fail" + "--connect-timeout" "10" + "--max-time" (number-to-string calendar-sync-fetch-timeout) + "-o" temp-file + url) + :sentinel + (lambda (process event) + (when (memq (process-status process) '(exit signal)) + (let ((buf (process-buffer process)) + (success (and (eq (process-status process) 'exit) + (= (process-exit-status process) 0)))) + (when (buffer-live-p buf) + (unless success + (calendar-sync--log-silently "calendar-sync: Fetch error: curl failed: %s" + (string-trim event))) + (kill-buffer buf)) + (if success + (funcall callback temp-file) + (when (file-exists-p temp-file) + (delete-file temp-file)) + (funcall callback nil))))))) + (error + (calendar-sync--log-silently "calendar-sync: Fetch error: %s" (error-message-string err)) + (funcall callback nil)))) + +;;; Batch Conversion Worker + +(defun calendar-sync--emacs-binary () + "Return the Emacs executable to use for calendar conversion workers." + (let ((candidate (expand-file-name invocation-name invocation-directory))) + (if (file-executable-p candidate) + candidate + invocation-name))) + +(defun calendar-sync--batch-convert-file (ics-file output-file past-months future-months user-emails) + "Convert ICS-FILE to Org format and write OUTPUT-FILE. +PAST-MONTHS, FUTURE-MONTHS, and USER-EMAILS mirror the interactive session's +calendar conversion settings. This is intended for noninteractive worker +processes, not direct interactive use." + (setq calendar-sync-past-months past-months + calendar-sync-future-months future-months + calendar-sync-user-emails user-emails) + (let* ((ics-content + (with-temp-buffer + (insert-file-contents ics-file) + (calendar-sync--normalize-line-endings (buffer-string)))) + (org-content (calendar-sync--parse-ics ics-content))) + (unless org-content + (error "calendar-sync: parse failed")) + (calendar-sync--write-file org-content output-file))) + +(defun calendar-sync--worker-command (ics-file output-file) + "Build the batch Emacs command that converts ICS-FILE to OUTPUT-FILE." + (let ((module-dir (file-name-directory calendar-sync--module-file)) + (private-config-file + (make-temp-name (expand-file-name "calendar-sync-worker-config-" + temporary-file-directory))) + (state-file + (make-temp-name (expand-file-name "calendar-sync-worker-state-" + temporary-file-directory)))) + (list (calendar-sync--emacs-binary) + "--batch" + "--no-site-file" + "--no-site-lisp" + "--eval" (format "(setq load-prefer-newer t calendar-sync-auto-start nil calendar-sync-private-config-file %S calendar-sync--state-file %S)" + private-config-file state-file) + "-L" module-dir + "-l" calendar-sync--module-file + "--eval" (format "(calendar-sync--batch-convert-file %S %S %S %S '%S)" + ics-file + output-file + calendar-sync-past-months + calendar-sync-future-months + calendar-sync-user-emails)))) + +(defun calendar-sync--convert-ics-file-async (ics-file output-file callback) + "Convert ICS-FILE to OUTPUT-FILE in a batch Emacs worker. +Calls CALLBACK as (CALLBACK SUCCESS ERROR-MESSAGE). Deletes ICS-FILE after the +worker exits." + (condition-case err + (let ((buffer (generate-new-buffer " *calendar-sync-worker*"))) + (make-process + :name "calendar-sync-worker" + :buffer buffer + :command (calendar-sync--worker-command ics-file output-file) + :sentinel + (lambda (process _event) + (when (memq (process-status process) '(exit signal)) + (let* ((buf (process-buffer process)) + (success (and (eq (process-status process) 'exit) + (= (process-exit-status process) 0))) + (error-message + (when (buffer-live-p buf) + (with-current-buffer buf + (string-trim (buffer-string)))))) + (when (file-exists-p ics-file) + (delete-file ics-file)) + (when (buffer-live-p buf) + (kill-buffer buf)) + (funcall callback success error-message)))))) + (error + (when (file-exists-p ics-file) + (delete-file ics-file)) + (funcall callback nil (error-message-string err))))) + +(defun calendar-sync--mark-sync-failed (name reason) + "Record failed sync state for calendar NAME with REASON." + (calendar-sync--set-calendar-state + name + (list :status 'error + :last-sync (plist-get (calendar-sync--get-calendar-state name) :last-sync) + :last-error reason)) + (calendar-sync--save-state) + (message "calendar-sync: [%s] Sync failed (see *Messages*)" name)) + +;;; Google Calendar API Fetch Path + +(defun calendar-sync--api-script () + "Return the absolute path to the Google Calendar API helper script. +Resolved relative to this module so batch workers and tests don't depend +on `user-emacs-directory'." + (let ((module-dir (file-name-directory calendar-sync--module-file))) + (expand-file-name "calendar_sync_api.py" + (expand-file-name "scripts" + (file-name-parent-directory module-dir))))) + +(defun calendar-sync--api-command (account calendar-id output-file) + "Build the command list that runs the API helper. +ACCOUNT and CALENDAR-ID select the OAuth account and calendar; OUTPUT-FILE +is where the helper writes rendered org content. The past/future window +mirrors the .ics path's `calendar-sync-past-months' / +`calendar-sync-future-months'. When `calendar-sync-skip-declined' is nil, +passes --keep-declined so the API path honors the same toggle." + (append + (list calendar-sync-python-command + (calendar-sync--api-script) + "--account" account + "--calendar-id" calendar-id + "--output" output-file + "--past-months" (number-to-string calendar-sync-past-months) + "--future-months" (number-to-string calendar-sync-future-months)) + (unless calendar-sync-skip-declined + (list "--keep-declined")))) + +(defun calendar-sync--sync-calendar-api (calendar) + "Sync a single Google CALENDAR via the API helper script. +CALENDAR is a plist with :name, :account, :calendar-id, and :file keys. +The helper fetches, filters, and renders org in one pass and writes :file +directly, so it runs in a single external process off the interactive thread." + (let* ((name (plist-get calendar :name)) + (account (plist-get calendar :account)) + (calendar-id (plist-get calendar :calendar-id)) + (file (plist-get calendar :file)) + (fetch-start (float-time))) + (calendar-sync--set-calendar-state name '(:status syncing)) + (calendar-sync--log-silently "calendar-sync: [%s] Syncing (API)..." name) + (condition-case err + (let ((buffer (generate-new-buffer " *calendar-sync-api*"))) + (make-process + :name "calendar-sync-api" + :buffer buffer + :command (calendar-sync--api-command account calendar-id file) + :sentinel + (lambda (process _event) + (when (memq (process-status process) '(exit signal)) + (let* ((buf (process-buffer process)) + (success (and (eq (process-status process) 'exit) + (= (process-exit-status process) 0))) + (output (when (buffer-live-p buf) + (with-current-buffer buf + (string-trim (buffer-string)))))) + (when (buffer-live-p buf) + (kill-buffer buf)) + (if (not success) + (calendar-sync--mark-sync-failed + name (if (or (null output) (string-empty-p output)) + "API helper failed" + output)) + (calendar-sync--set-calendar-state + name + (list :status 'ok + :last-sync (current-time) + :last-error nil)) + (setq calendar-sync--last-timezone-offset + (calendar-sync--current-timezone-offset)) + (calendar-sync--save-state) + (let ((total-elapsed (- (float-time) fetch-start))) + (message "calendar-sync: [%s] Sync complete (%.1fs total) → %s" + name total-elapsed file)))))))) + (error + (calendar-sync--log-silently "calendar-sync: [%s] API helper error: %s" + name (error-message-string err)) + (calendar-sync--mark-sync-failed name (error-message-string err)))))) + +;;; .ics Sync Path + +(defun calendar-sync--calendar-url (calendar) + "Return the .ics feed URL for CALENDAR, or nil if none is configured. +An explicit :url wins. Otherwise :secret-host names an auth-source host +whose stored secret is the URL (kept in auth-source because the .ics URL +is itself a token)." + (or (plist-get calendar :url) + (when-let* ((host (plist-get calendar :secret-host))) + (cj/auth-source-secret-value host)))) + +(defun calendar-sync--sync-calendar-ics (calendar) + "Sync a single CALENDAR from its .ics feed asynchronously. +CALENDAR is a plist with :name, :file, and a feed URL resolved by +`calendar-sync--calendar-url' (an explicit :url, or a :secret-host +looked up in auth-source)." + (let ((name (plist-get calendar :name)) + (url (calendar-sync--calendar-url calendar)) + (file (plist-get calendar :file)) + (fetch-start (float-time))) + (calendar-sync--set-calendar-state name '(:status syncing)) + (calendar-sync--log-silently "calendar-sync: [%s] Syncing..." name) + (calendar-sync--fetch-ics-file + url + (lambda (ics-file) + (let ((fetch-elapsed (- (float-time) fetch-start))) + (if (null ics-file) + (progn + (calendar-sync--log-silently "calendar-sync: [%s] Fetch failed" name) + (calendar-sync--mark-sync-failed name "Fetch failed")) + (when (calendar-sync--debug-p) + (calendar-sync--log-silently "calendar-sync: [%s] Fetched in %.1fs" + name fetch-elapsed)) + (calendar-sync--convert-ics-file-async + ics-file + file + (lambda (success error-message) + (if (not success) + (progn + (calendar-sync--log-silently "calendar-sync: [%s] Conversion failed: %s" + name error-message) + (calendar-sync--mark-sync-failed + name + (if (or (null error-message) + (string-empty-p error-message)) + "Conversion failed" + error-message))) + (calendar-sync--set-calendar-state + name + (list :status 'ok + :last-sync (current-time) + :last-error nil)) + (setq calendar-sync--last-timezone-offset + (calendar-sync--current-timezone-offset)) + (calendar-sync--save-state) + (let ((total-elapsed (- (float-time) fetch-start))) + (message "calendar-sync: [%s] Sync complete (%.1fs total) → %s" + name total-elapsed file))))))))))) + +(provide 'calendar-sync-source) +;;; calendar-sync-source.el ends here diff --git a/modules/calendar-sync.el b/modules/calendar-sync.el index c0e0e935a..297d1fe61 100644 --- a/modules/calendar-sync.el +++ b/modules/calendar-sync.el @@ -8,75 +8,22 @@ ;; Layer: 3 (Domain Workflow). ;; Category: D/S. ;; Load shape: eager only when calendar-sync.local.el configures calendars. -;; Eager reason: daily-driver workflow; calendars are expected synced at the -;; first session. Timers and network fetches are guarded for batch/test loads. -;; Top-level side effects: defines a calendar keymap and conditionally registers -;; it under cj/custom-keymap; timer and network fetches guarded by -;; config/noninteractive checks. -;; Runtime requires: cl-lib, subr-x, system-lib, cj-org-text-lib, keybindings. -;; Direct test load: yes (private config optional; degrades cleanly when absent). +;; Eager reason: daily agenda workflow; timers and network fetches are guarded. +;; Top-level side effects: defines C-; g map; starts sync only when configured. +;; Runtime requires: cl-lib, subr-x, system-lib, cj-org-text-lib, keybindings, +;; calendar-sync-ics, calendar-sync-recurrence, calendar-sync-org, +;; calendar-sync-source. +;; Direct test load: yes. ;; -;; Simple, reliable one-way sync from multiple calendars to Org mode. -;; Downloads .ics files from calendar URLs (Google, Proton, etc.) and -;; converts to Org format. No OAuth, no API complexity, just file conversion. +;; One-way calendar synchronization from configured .ics/API sources into Org +;; files. Feed URLs may be inline or resolved from auth-source via :secret-host. ;; -;; Features: -;; - Multi-calendar support (sync multiple calendars to separate files) -;; - Pure Emacs Lisp .ics parser (no external dependencies) -;; - Recurring event support (RRULE expansion) -;; - Timer-based automatic sync (every 60 minutes, configurable) -;; - Self-contained in .emacs.d (no cron, portable across machines) -;; - Read-only (can't corrupt source calendars) -;; - Works with Chime for event notifications -;; -;; Recurring Events (RRULE): -;; -;; Calendar recurring events are defined once with an RRULE -;; (recurrence rule) rather than as individual event instances. This -;; module expands recurring events into individual org entries. -;; -;; Expansion uses a rolling window approach: -;; - Past: 3 months before today -;; - Future: 12 months after today -;; -;; Every sync regenerates the entire file based on the current date, -;; so the window automatically advances as time passes. Old events -;; naturally fall off after 3 months, and new future events appear -;; as you approach them. -;; -;; Supported RRULE patterns: -;; - FREQ=DAILY: Daily events -;; - FREQ=WEEKLY;BYDAY=MO,WE,FR: Weekly on specific days -;; - FREQ=MONTHLY: Monthly events (same day each month) -;; - FREQ=YEARLY: Yearly events (anniversaries, birthdays) -;; - INTERVAL: Repeat every N periods (e.g., every 2 weeks) -;; - UNTIL: End date for recurrence -;; - COUNT: Maximum occurrences (combined with date range limit) -;; -;; Setup: -;; 1. Configure calendars in your init.el: -;; (setq calendar-sync-calendars -;; '((:name "google" -;; :url "https://calendar.google.com/calendar/ical/.../basic.ics" -;; :file gcal-file) -;; (:name "proton" -;; :url "https://calendar.proton.me/api/calendar/v1/url/.../calendar.ics" -;; :file pcal-file))) -;; -;; 2. Load and start: -;; (require 'calendar-sync) -;; (calendar-sync-start) -;; -;; 3. Add to org-agenda (optional): -;; (dolist (cal calendar-sync-calendars) -;; (add-to-list 'org-agenda-files (plist-get cal :file))) -;; -;; Usage: -;; - M-x calendar-sync-now ; Sync all or select specific calendar -;; - M-x calendar-sync-start ; Start auto-sync -;; - M-x calendar-sync-stop ; Stop auto-sync -;; - M-x calendar-sync-toggle ; Toggle auto-sync -;; - M-x calendar-sync-status ; Show sync status for all calendars +;; This is the public face of the module: it owns configuration, the parse +;; pipeline orchestrator, the sync dispatch, the user commands, the timer, and +;; the C-; g keymap. The parsing, recurrence expansion, Org rendering, and +;; fetch/worker code live in the calendar-sync-ics / -recurrence / -org / +;; -source layers, which this module requires. Every public name is unchanged +;; so existing (require 'calendar-sync) callers and tests keep working. ;;; Code: @@ -85,12 +32,10 @@ (require 'system-lib) ;; provides cj/auth-source-secret-value (leaf; no ai-config dep) (require 'cj-org-text-lib) (require 'keybindings) ;; provides cj/custom-keymap - -(defun calendar-sync--log-silently (format-string &rest args) - "Log FORMAT-STRING with ARGS without requiring the full config." - (if (fboundp 'cj/log-silently) - (apply #'cj/log-silently format-string args) - (apply #'message format-string args))) +(require 'calendar-sync-ics) +(require 'calendar-sync-recurrence) +(require 'calendar-sync-org) +(require 'calendar-sync-source) ;;; Configuration @@ -198,1017 +143,7 @@ without loading the user's init file.") (defvar calendar-sync--timer nil "Timer object for automatic syncing.") -(defvar calendar-sync--calendar-states (make-hash-table :test 'equal) - "Per-calendar sync state. -Hash table mapping calendar name (string) to state plist with: - :last-sync - Time of last successful sync - :status - Symbol: ok, error, or syncing - :last-error - Error message string, or nil") - -(defvar calendar-sync--last-timezone-offset nil - "Timezone offset in seconds from UTC at last sync. -Used to detect timezone changes (e.g., when traveling).") - -(defvar calendar-sync--state-file - (expand-file-name "persist/calendar-sync-state.el" user-emacs-directory) - "File to persist sync state across Emacs sessions.") - -;;; Timezone Detection - -(defun calendar-sync--current-timezone-offset () - "Get current timezone offset in seconds from UTC. -Returns negative for west of UTC, positive for east. -Example: -21600 for CST (UTC-6), -28800 for PST (UTC-8)." - (car (current-time-zone))) - -(defun calendar-sync--format-timezone-offset (offset) - "Format timezone OFFSET (in seconds) as human-readable string. -Example: -21600 → `UTC-6' or `UTC-6:00'." - (if (null offset) - "unknown" - (let* ((hours (/ offset 3600)) - (minutes (abs (mod (/ offset 60) 60))) - (sign (if (>= hours 0) "+" "-")) - (abs-hours (abs hours))) - (if (= minutes 0) - (format "UTC%s%d" sign abs-hours) - (format "UTC%s%d:%02d" sign abs-hours minutes))))) - -(defun calendar-sync--timezone-changed-p () - "Return t if timezone has changed since last sync." - (and calendar-sync--last-timezone-offset - (not (= (calendar-sync--current-timezone-offset) - calendar-sync--last-timezone-offset)))) - -;;; State Persistence - -(defun calendar-sync--save-state () - "Save sync state to disk for persistence across sessions." - (let* ((calendar-states-alist - (let ((result '())) - (maphash (lambda (name state) - (push (cons name state) result)) - calendar-sync--calendar-states) - result)) - (state `((timezone-offset . ,calendar-sync--last-timezone-offset) - (calendar-states . ,calendar-states-alist))) - (dir (file-name-directory calendar-sync--state-file))) - (unless (file-directory-p dir) - (make-directory dir t)) - (let ((tmp (make-temp-file (expand-file-name ".calendar-sync-state-" dir)))) - (with-temp-file tmp - (prin1 state (current-buffer))) - (rename-file tmp calendar-sync--state-file t)))) - -(defun calendar-sync--load-state () - "Load sync state from disk." - (when (file-exists-p calendar-sync--state-file) - (condition-case err - (with-temp-buffer - (insert-file-contents calendar-sync--state-file) - (let ((state (read (current-buffer)))) - (setq calendar-sync--last-timezone-offset - (alist-get 'timezone-offset state)) - ;; Load per-calendar states - (let ((cal-states (alist-get 'calendar-states state))) - (clrhash calendar-sync--calendar-states) - (dolist (entry cal-states) - (puthash (car entry) (cdr entry) calendar-sync--calendar-states))))) - (error - (calendar-sync--log-silently "calendar-sync: Error loading state: %s" (error-message-string err)))))) - -(defun calendar-sync--get-calendar-state (calendar-name) - "Get state plist for CALENDAR-NAME, or nil if not found." - (gethash calendar-name calendar-sync--calendar-states)) - -(defun calendar-sync--set-calendar-state (calendar-name state) - "Set STATE plist for CALENDAR-NAME." - (puthash calendar-name state calendar-sync--calendar-states)) - -;;; Line Ending Normalization - -(defun calendar-sync--normalize-line-endings (content) - "Normalize line endings in CONTENT to Unix format (LF only). -Removes all carriage return characters (\\r) from CONTENT. -The iCalendar format (RFC 5545) uses CRLF line endings, but Emacs -and `org-mode' expect LF only. This function ensures consistent line -endings throughout the parsing pipeline. - -Returns CONTENT with all \\r characters removed." - (if (not (stringp content)) - content - (replace-regexp-in-string "\r" "" content))) - -;;; Text Cleaning (ICS unescape + HTML strip) - -(defun calendar-sync--unescape-ics-text (text) - "Unescape RFC 5545 escape sequences in TEXT. -Converts: \\n→newline, \\,→comma, \\\\→backslash, \\;→semicolon. -Returns nil for nil input." - (when text - ;; Use placeholder for literal backslash to avoid double-unescaping. - ;; replace-regexp-in-string with LITERAL=t avoids backslash interpretation. - (let ((result (replace-regexp-in-string "\\\\\\\\" "\000" text))) - (setq result (replace-regexp-in-string "\\\\n" "\n" result t t)) - (setq result (replace-regexp-in-string "\\\\," "," result t t)) - (setq result (replace-regexp-in-string "\\\\;" ";" result t t)) - (replace-regexp-in-string "\000" "\\" result t t)))) - -(defun calendar-sync--strip-html (text) - "Strip HTML tags from TEXT and decode common HTML entities. -Converts <br>, <br/>, <br /> to newlines. Strips all other tags. -Decodes & < > ". Collapses excessive blank lines. -Returns nil for nil input." - (when text - (let ((result text)) - ;; Convert <br> variants to newline (must come before tag stripping) - (setq result (replace-regexp-in-string "<br[ \t]*/?>[ \t]*" "\n" result)) - ;; Strip all remaining HTML tags - (setq result (replace-regexp-in-string "<[^>]*>" "" result)) - ;; Decode HTML entities - (setq result (replace-regexp-in-string "&" "&" result)) - (setq result (replace-regexp-in-string "<" "<" result)) - (setq result (replace-regexp-in-string ">" ">" result)) - (setq result (replace-regexp-in-string """ "\"" result)) - ;; Collapse 3+ consecutive newlines to 2 - (setq result (replace-regexp-in-string "\n\\{3,\\}" "\n\n" result)) - result))) - -(defun calendar-sync--clean-text (text) - "Clean TEXT by unescaping ICS sequences, stripping HTML, and trimming. -Returns nil for nil input. Returns empty string for whitespace-only input." - (when text - (string-trim (calendar-sync--strip-html (calendar-sync--unescape-ics-text text))))) - -;;; Date Utilities - -(defun calendar-sync--add-months (date months) - "Add MONTHS to DATE. -DATE is (year month day), returns new (year month day)." - (let* ((year (nth 0 date)) - (month (nth 1 date)) - (day (nth 2 date)) - (total-months (+ (* year 12) month -1 months)) - (new-year (/ total-months 12)) - (new-month (1+ (mod total-months 12)))) - (list new-year new-month day))) - -(defun calendar-sync--get-date-range () - "Get date range for event expansion as (start-time end-time). -Returns time values for -3 months and +12 months from today." - (let* ((now (decode-time)) - (today (list (nth 5 now) (nth 4 now) (nth 3 now))) - (start-date (calendar-sync--add-months today (- calendar-sync-past-months))) - (end-date (calendar-sync--add-months today calendar-sync-future-months)) - (start-time (apply #'encode-time 0 0 0 (reverse start-date))) - (end-time (apply #'encode-time 0 0 0 (reverse end-date)))) - (list start-time end-time))) - -(defun calendar-sync--date-in-range-p (date range) - "Check if DATE is within RANGE. -DATE is (year month day hour minute), RANGE is (start-time end-time)." - (let* ((year (nth 0 date)) - (month (nth 1 date)) - (day (nth 2 date)) - (date-time (encode-time 0 0 0 day month year)) - (start-time (nth 0 range)) - (end-time (nth 1 range))) - (and (time-less-p start-time date-time) - (time-less-p date-time end-time)))) - -(defun calendar-sync--weekday-to-number (weekday) - "Convert WEEKDAY string (MO, TU, etc.) to number (1-7). -Monday = 1, Sunday = 7." - (pcase weekday - ("MO" 1) - ("TU" 2) - ("WE" 3) - ("TH" 4) - ("FR" 5) - ("SA" 6) - ("SU" 7) - (_ nil))) - -(defun calendar-sync--date-weekday (date) - "Get weekday number for DATE (year month day). -Monday = 1, Sunday = 7." - (let* ((year (nth 0 date)) - (month (nth 1 date)) - (day (nth 2 date)) - (time (encode-time 0 0 0 day month year)) - (decoded (decode-time time)) - (dow (nth 6 decoded))) ; 0 = Sunday, 1 = Monday, etc. - (if (= dow 0) 7 dow))) ; Convert to 1-7 with Monday=1 - -(defun calendar-sync--add-days (date days) - "Add DAYS to DATE (year month day). -Returns new (year month day). -Uses noon internally to avoid DST boundary issues where adding -86400 seconds to midnight can land on the same calendar date -during fall-back transitions." - (let* ((year (nth 0 date)) - (month (nth 1 date)) - (day (nth 2 date)) - (time (encode-time 0 0 12 day month year)) - (new-time (time-add time (days-to-time days))) - (decoded (decode-time new-time))) - (list (nth 5 decoded) (nth 4 decoded) (nth 3 decoded)))) - -;;; RECURRENCE-ID Exception Handling - -(defun calendar-sync--get-recurrence-id (event-str) - "Extract RECURRENCE-ID value from EVENT-STR. -Returns the datetime value (without TZID parameter), or nil if not found. -Handles both simple values and values with parameters like TZID." - (when (and event-str (stringp event-str)) - (calendar-sync--get-property event-str "RECURRENCE-ID"))) - -(defun calendar-sync--get-recurrence-id-line (event-str) - "Extract full RECURRENCE-ID line from EVENT-STR, including parameters. -Returns the complete line like -`RECURRENCE-ID;TZID=Europe/Tallinn:20260203T170000'. -Returns nil if not found." - (when (and event-str (stringp event-str)) - (calendar-sync--get-property-line event-str "RECURRENCE-ID"))) - -(defun calendar-sync--parse-ics-datetime (value) - "Parse iCal datetime VALUE into (year month day hour minute) list. -Returns nil for invalid input. For date-only values, returns -(year month day nil nil). -Handles formats: 20260203T090000Z, 20260203T090000, 20260203." - (when (and value - (stringp value) - (not (string-empty-p value))) - (cond - ;; DateTime format: 20260203T090000Z or 20260203T090000 - ((string-match "\\`\\([0-9]\\{4\\}\\)\\([0-9]\\{2\\}\\)\\([0-9]\\{2\\}\\)T\\([0-9]\\{2\\}\\)\\([0-9]\\{2\\}\\)\\([0-9]\\{2\\}\\)Z?\\'" value) - (list (string-to-number (match-string 1 value)) - (string-to-number (match-string 2 value)) - (string-to-number (match-string 3 value)) - (string-to-number (match-string 4 value)) - (string-to-number (match-string 5 value)))) - ;; Date-only format: 20260203 - ((string-match "\\`\\([0-9]\\{4\\}\\)\\([0-9]\\{2\\}\\)\\([0-9]\\{2\\}\\)\\'" value) - (list (string-to-number (match-string 1 value)) - (string-to-number (match-string 2 value)) - (string-to-number (match-string 3 value)) - nil nil)) - (t nil)))) - -(defalias 'calendar-sync--parse-recurrence-id #'calendar-sync--parse-ics-datetime - "Parse RECURRENCE-ID value. See `calendar-sync--parse-ics-datetime'.") - -(defun calendar-sync--parse-exception-event (event-str) - "Parse a RECURRENCE-ID override EVENT-STR into an exception plist, or nil. -Returns nil when EVENT-STR carries no RECURRENCE-ID, or its recurrence-id / -start time fail to parse. The plist holds :recurrence-id (localized), -:recurrence-id-raw, :start, :end, :summary, :description, :location." - (let ((recurrence-id (calendar-sync--get-recurrence-id event-str))) - (when recurrence-id - (let* ((recurrence-id-line (calendar-sync--get-recurrence-id-line event-str)) - (recurrence-id-tzid (calendar-sync--extract-tzid recurrence-id-line)) - (recurrence-id-is-utc (string-suffix-p "Z" recurrence-id)) - (recurrence-id-parsed (calendar-sync--parse-recurrence-id recurrence-id)) - ;; Parse the new times from the exception - (dtstart (calendar-sync--get-property event-str "DTSTART")) - (dtend (calendar-sync--get-property event-str "DTEND")) - (dtstart-line (calendar-sync--get-property-line event-str "DTSTART")) - (dtend-line (calendar-sync--get-property-line event-str "DTEND")) - (start-tzid (calendar-sync--extract-tzid dtstart-line)) - (end-tzid (calendar-sync--extract-tzid dtend-line)) - (start-parsed (calendar-sync--parse-timestamp dtstart start-tzid)) - (end-parsed (and dtend (calendar-sync--parse-timestamp dtend end-tzid))) - (summary (calendar-sync--clean-text - (calendar-sync--get-property event-str "SUMMARY"))) - (description (calendar-sync--clean-text - (calendar-sync--get-property event-str "DESCRIPTION"))) - (location (calendar-sync--clean-text - (calendar-sync--get-property event-str "LOCATION")))) - (when (and recurrence-id-parsed start-parsed) - (list :recurrence-id (calendar-sync--localize-parsed-datetime - recurrence-id-parsed recurrence-id-is-utc recurrence-id-tzid) - :recurrence-id-raw recurrence-id - :start start-parsed - :end end-parsed - :summary summary - :description description - :location location)))))) - -(defun calendar-sync--collect-recurrence-exceptions (ics-content) - "Collect all RECURRENCE-ID events from ICS-CONTENT. -Returns hash table mapping UID to list of exception event plists. -Each exception plist contains :recurrence-id (parsed), :start, :end, -:summary, etc." - (let ((exceptions (make-hash-table :test 'equal))) - (when (and ics-content (stringp ics-content)) - (dolist (event-str (calendar-sync--split-events ics-content)) - (let ((uid (calendar-sync--get-property event-str "UID")) - (exception-plist (calendar-sync--parse-exception-event event-str))) - (when (and uid exception-plist) - (puthash uid - (cons exception-plist (gethash uid exceptions)) - exceptions))))) - exceptions)) - -(defun calendar-sync--occurrence-matches-exception-p (occurrence exception) - "Check if OCCURRENCE matches EXCEPTION's recurrence-id. -Compares year, month, day, hour, minute." - (let ((occ-start (plist-get occurrence :start)) - (exc-recid (plist-get exception :recurrence-id))) - (and occ-start exc-recid - (= (nth 0 occ-start) (nth 0 exc-recid)) ; year - (= (nth 1 occ-start) (nth 1 exc-recid)) ; month - (= (nth 2 occ-start) (nth 2 exc-recid)) ; day - ;; Hour/minute check (handle nil for all-day events) - (or (and (null (nth 3 occ-start)) (null (nth 3 exc-recid))) - (and (nth 3 occ-start) (nth 3 exc-recid) - (= (nth 3 occ-start) (nth 3 exc-recid)) - (= (or (nth 4 occ-start) 0) (or (nth 4 exc-recid) 0))))))) - -(defun calendar-sync--apply-single-exception (occurrence exception) - "Apply EXCEPTION to OCCURRENCE, returning modified occurrence." - (let ((result (copy-sequence occurrence))) - ;; Update time from exception - (plist-put result :start (plist-get exception :start)) - (when (plist-get exception :end) - (plist-put result :end (plist-get exception :end))) - ;; Update summary if exception has one - (when (plist-get exception :summary) - (plist-put result :summary (plist-get exception :summary))) - ;; Update other fields - (when (plist-get exception :description) - (plist-put result :description (plist-get exception :description))) - (when (plist-get exception :location) - (plist-put result :location (plist-get exception :location))) - ;; Pass through new fields if exception overrides them - (when (plist-get exception :attendees) - (plist-put result :attendees (plist-get exception :attendees)) - ;; Re-derive the user's status from the overridden attendees so a - ;; singly-declined occurrence drops its inherited series "accepted" - ;; (otherwise `calendar-sync--filter-declined' can't drop it). Leave the - ;; inherited status when the override doesn't name the user. - (let ((status (calendar-sync--find-user-status - (plist-get exception :attendees) calendar-sync-user-emails))) - (when status - (plist-put result :status status)))) - (when (plist-get exception :organizer) - (plist-put result :organizer (plist-get exception :organizer))) - (when (plist-get exception :url) - (plist-put result :url (plist-get exception :url))) - result)) - -(defun calendar-sync--apply-recurrence-exceptions (occurrences exceptions) - "Apply EXCEPTIONS to OCCURRENCES list. -OCCURRENCES is list of event plists from RRULE expansion. -EXCEPTIONS is hash table from `calendar-sync--collect-recurrence-exceptions'. -Returns new list with matching occurrences replaced by exception times." - (if (or (null occurrences) (null exceptions)) - occurrences - (mapcar - (lambda (occurrence) - (let* ((uid (plist-get occurrence :uid)) - (uid-exceptions (and uid (gethash uid exceptions)))) - (if (null uid-exceptions) - occurrence - ;; Check if any exception matches this occurrence - (let ((matching-exception - (cl-find-if (lambda (exc) - (calendar-sync--occurrence-matches-exception-p occurrence exc)) - uid-exceptions))) - (if matching-exception - (calendar-sync--apply-single-exception occurrence matching-exception) - occurrence))))) - occurrences))) - -;;; EXDATE (Excluded Date) Handling - -(defun calendar-sync--get-exdates (event-str) - "Extract all EXDATE values from EVENT-STR. -Returns list of datetime strings (without TZID parameters), or nil if -none found. -Handles both simple values and values with parameters like TZID." - (when (and event-str (stringp event-str) (not (string-empty-p event-str))) - (let ((exdates '()) - (pos 0)) - ;; Find all EXDATE lines - (while (string-match "^EXDATE[^:\n]*:\\([^\n]+\\)" event-str pos) - (push (match-string 1 event-str) exdates) - (setq pos (match-end 0))) - (nreverse exdates)))) - -(defun calendar-sync--get-exdate-line (event-str exdate-value) - "Find the full EXDATE line containing EXDATE-VALUE from EVENT-STR. -Returns the complete line like -`EXDATE;TZID=America/New_York:20260210T130000'. -Returns nil if not found." - (when (and event-str (stringp event-str) exdate-value) - (let ((pattern (format "^\\(EXDATE[^:]*:%s\\)" (regexp-quote exdate-value)))) - (when (string-match pattern event-str) - (match-string 1 event-str))))) - -(defalias 'calendar-sync--parse-exdate #'calendar-sync--parse-ics-datetime - "Parse EXDATE value. See `calendar-sync--parse-ics-datetime'.") - -(defun calendar-sync--collect-exdates (event-str) - "Collect all excluded dates from EVENT-STR, handling timezone conversion. -Returns list of parsed datetime lists (year month day hour minute). -Converts TZID-qualified and UTC times to local time." - (if (or (null event-str) - (not (stringp event-str)) - (string-empty-p event-str)) - '() - (let ((exdate-values (calendar-sync--get-exdates event-str)) - (result '())) - (dolist (exdate-value exdate-values) - (let* ((exdate-line (calendar-sync--get-exdate-line event-str exdate-value)) - (exdate-tzid (and exdate-line (calendar-sync--extract-tzid exdate-line))) - (exdate-is-utc (and exdate-value (string-suffix-p "Z" exdate-value))) - (exdate-parsed (calendar-sync--parse-exdate exdate-value))) - (when exdate-parsed - (push (calendar-sync--localize-parsed-datetime - exdate-parsed exdate-is-utc exdate-tzid) - result)))) - (nreverse result)))) - -(defun calendar-sync--exdate-matches-p (occurrence-start exdate) - "Check if OCCURRENCE-START matches EXDATE. -OCCURRENCE-START is (year month day hour minute). -EXDATE is (year month day hour minute) or (year month day nil nil) for -date-only. -Date-only EXDATE matches any time on that day." - (and occurrence-start exdate - (= (nth 0 occurrence-start) (nth 0 exdate)) ; year - (= (nth 1 occurrence-start) (nth 1 exdate)) ; month - (= (nth 2 occurrence-start) (nth 2 exdate)) ; day - ;; If EXDATE has nil hour/minute (date-only), match any time - (or (null (nth 3 exdate)) - (and (nth 3 occurrence-start) - (= (nth 3 occurrence-start) (nth 3 exdate)) - (= (or (nth 4 occurrence-start) 0) (or (nth 4 exdate) 0)))))) - -(defun calendar-sync--filter-exdates (occurrences exdates) - "Filter OCCURRENCES list to remove entries matching EXDATES. -OCCURRENCES is list of event plists with :start key. -EXDATES is list of parsed datetime lists from `calendar-sync--collect-exdates'. -Returns filtered list with excluded dates removed." - (if (or (null occurrences) (null exdates)) - (or occurrences '()) - (cl-remove-if - (lambda (occurrence) - (let ((occ-start (plist-get occurrence :start))) - (cl-some (lambda (exdate) - (calendar-sync--exdate-matches-p occ-start exdate)) - exdates))) - occurrences))) - -;;; .ics Parsing - -(defun calendar-sync--split-events (ics-content) - "Split ICS-CONTENT into individual VEVENT blocks. -Returns list of strings, each containing one VEVENT block." - (let ((events '())) - (with-temp-buffer - (insert ics-content) - (goto-char (point-min)) - (while (search-forward "BEGIN:VEVENT" nil t) - (let ((start (match-beginning 0))) - (when (search-forward "END:VEVENT" nil t) - (push (buffer-substring-no-properties start (point)) events))))) - (nreverse events))) - -(defun calendar-sync--unfold-continuation (text value start) - "Unfold RFC 5545 continuation lines from TEXT starting at START. -VALUE is the initial content to append to. Continuation lines begin -with a space or tab after a newline. Returns (unfolded-value . new-pos)." - (while (and (< start (length text)) - (string-match "\n[ \t]\\([^\n]*\\)" text start) - (= (match-beginning 0) start)) - (setq value (concat value (match-string 1 text))) - (setq start (match-end 0))) - (cons value start)) - -(defun calendar-sync--get-property (event property) - "Extract PROPERTY value from EVENT string. -Handles property parameters (e.g., DTSTART;TZID=America/Chicago:value). -Handles multi-line values (lines starting with space). -Returns nil if property not found." - (when (string-match (format "^%s[^:\n]*:\\(.*\\)$" (regexp-quote property)) event) - (car (calendar-sync--unfold-continuation - event (match-string 1 event) (match-end 0))))) - -(defun calendar-sync--get-property-line (event property) - "Extract full PROPERTY line from EVENT string, including parameters. -Returns the complete line like -`DTSTART;TZID=Europe/Lisbon:20260202T190000'. -Returns nil if property not found." - (when (string-match (format "^\\(%s[^\n]*\\)$" (regexp-quote property)) event) - (match-string 1 event))) - -(defun calendar-sync--get-all-property-lines (event property) - "Extract ALL lines matching PROPERTY from EVENT string. -Unlike `calendar-sync--get-property-line' which returns the first match, -this returns a list of all matching lines. Handles continuation lines -\(lines starting with space or tab). -Returns nil if EVENT or PROPERTY is nil, or no matches found." - (when (and event property (stringp event) (not (string-empty-p event))) - (let ((lines '()) - (pattern (format "^%s[^\n]*" (regexp-quote property))) - (pos 0)) - (while (string-match pattern event pos) - (let* ((result (calendar-sync--unfold-continuation - event (match-string 0 event) (match-end 0))) - (line (car result)) - (end (cdr result))) - (push line lines) - (setq pos (if (< end (length event)) (1+ end) end)))) - (nreverse lines)))) - -(defun calendar-sync--extract-cn (line) - "Extract and dequote CN parameter from iCal LINE. -Returns the CN value string, or nil if not found." - (when (string-match ";CN=\\([^;:]+\\)" line) - (let ((cn (match-string 1 line))) - (if (and (string-prefix-p "\"" cn) (string-suffix-p "\"" cn)) - (substring cn 1 -1) - cn)))) - -(defun calendar-sync--extract-email (line) - "Extract email address from mailto: value in iCal LINE. -Returns email string, or nil if not found." - (when (string-match "mailto:\\([^>\n ]+\\)" line) - (match-string 1 line))) - -(defun calendar-sync--parse-attendee-line (line) - "Parse single ATTENDEE LINE into plist. -Returns plist (:cn NAME :email EMAIL :partstat STATUS :role ROLE). -Returns nil for nil, empty, or malformed input." - (when (and line (stringp line) (not (string-empty-p line)) - (string-match-p "^ATTENDEE" line)) - (let ((cn (calendar-sync--extract-cn line)) - (email (calendar-sync--extract-email line)) - (partstat nil) - (role nil)) - (when (string-match ";PARTSTAT=\\([^;:]+\\)" line) - (setq partstat (match-string 1 line))) - (when (string-match ";ROLE=\\([^;:]+\\)" line) - (setq role (match-string 1 line))) - (when email - (list :cn cn :email email :partstat partstat :role role))))) - -(defun calendar-sync--find-user-status (attendees user-emails) - "Find user's PARTSTAT from ATTENDEES list using USER-EMAILS. -ATTENDEES is list of plists from `calendar-sync--parse-attendee-line'. -USER-EMAILS is list of email strings to match against. -Returns lowercase status string (\"accepted\", \"declined\", etc.) or nil." - (when (and attendees user-emails) - (let ((user-emails-lower (mapcar #'downcase user-emails)) - (found nil)) - (cl-dolist (attendee attendees) - (let ((attendee-email (downcase (or (plist-get attendee :email) "")))) - (when (member attendee-email user-emails-lower) - (let ((partstat (plist-get attendee :partstat))) - (when partstat - (setq found (downcase partstat)) - (cl-return found)))))) - found))) - -(defun calendar-sync--filter-declined (events) - "Return EVENTS with declined entries removed when the toggle is on. -EVENTS is a list of plists produced by `calendar-sync--parse-event'. -Each plist's :status is the lowercase PARTSTAT for the user (set by -`calendar-sync--find-user-status'), or nil for events without an -attendee block. Drops only events whose :status is exactly the string -\"declined\" so that nil / accepted / tentative / needs-action all -survive. When `calendar-sync-skip-declined' is nil, returns EVENTS -unchanged." - (if (and calendar-sync-skip-declined events) - (cl-remove-if (lambda (event) - (equal (plist-get event :status) "declined")) - events) - events)) - -(defun calendar-sync--parse-organizer (event-str) - "Parse ORGANIZER property from EVENT-STR into plist. -Returns plist (:cn NAME :email EMAIL), or nil if no ORGANIZER found." - (when (and event-str (stringp event-str)) - (let ((line (calendar-sync--get-property-line event-str "ORGANIZER"))) - (when line - (let ((email (calendar-sync--extract-email line))) - (when email - (list :cn (calendar-sync--extract-cn line) :email email))))))) - -(defun calendar-sync--extract-meeting-url (event-str) - "Extract meeting URL from EVENT-STR. -Prefers X-GOOGLE-CONFERENCE over URL property. -Returns URL string or nil." - (when (and event-str (stringp event-str)) - (or (calendar-sync--get-property event-str "X-GOOGLE-CONFERENCE") - (calendar-sync--get-property event-str "URL")))) - -(defun calendar-sync--extract-tzid (property-line) - "Extract TZID parameter value from PROPERTY-LINE. -PROPERTY-LINE is like `DTSTART;TZID=Europe/Lisbon:20260202T190000'. -Returns timezone string like `Europe/Lisbon', or nil if no TZID. -Returns nil for malformed lines (missing colon separator)." - (when (and property-line - (stringp property-line) - ;; Must have colon (property:value format) - (string-match-p ":" property-line) - (string-match ";TZID=\\([^;:]+\\)" property-line)) - (match-string 1 property-line))) - -(defun calendar-sync--convert-utc-to-local (year month day hour minute second) - "Convert UTC datetime to local time. -Returns list (year month day hour minute) in local timezone." - (let* ((utc-time (encode-time second minute hour day month year 0)) - (local-time (decode-time utc-time))) - (list (nth 5 local-time) ; year - (nth 4 local-time) ; month - (nth 3 local-time) ; day - (nth 2 local-time) ; hour - (nth 1 local-time)))) ; minute - -(defun calendar-sync--convert-tz-to-local (year month day hour minute source-tz) - "Convert datetime from SOURCE-TZ timezone to local time. -SOURCE-TZ is a timezone name like `Europe/Lisbon' or `Asia/Yerevan'. -Returns list (year month day hour minute) in local timezone, or nil on error. - -Uses Emacs built-in timezone support (encode-time/decode-time with ZONE -argument) for fast, subprocess-free conversion. Uses the same system -TZ database as the `date' command." - (when (and source-tz (not (string-empty-p source-tz))) - (condition-case err - (let* ((abs-time (encode-time 0 minute hour day month year source-tz)) - (local (decode-time abs-time))) - (list (nth 5 local) ; year - (nth 4 local) ; month - (nth 3 local) ; day - (nth 2 local) ; hour - (nth 1 local))) ; minute - (error - (calendar-sync--log-silently "calendar-sync: Error converting timezone %s: %s" - source-tz (error-message-string err)) - nil)))) - -(defun calendar-sync--localize-parsed-datetime (parsed is-utc tzid) - "Convert PARSED datetime to local time using timezone info. -PARSED is (year month day hour minute) or (year month day nil nil). -IS-UTC non-nil means the value had a Z suffix. - -TZID is a timezone string like \"Europe/Lisbon\", or nil. -Returns PARSED converted to local time, or PARSED unchanged if no -conversion needed." - (cond - (is-utc - (calendar-sync--convert-utc-to-local - (nth 0 parsed) (nth 1 parsed) (nth 2 parsed) - (or (nth 3 parsed) 0) (or (nth 4 parsed) 0) 0)) - (tzid - (or (calendar-sync--convert-tz-to-local - (nth 0 parsed) (nth 1 parsed) (nth 2 parsed) - (or (nth 3 parsed) 0) (or (nth 4 parsed) 0) - tzid) - parsed)) - (t parsed))) - -(defun calendar-sync--parse-timestamp (timestamp-str &optional tzid) - "Parse iCal timestamp string TIMESTAMP-STR. -Returns (year month day hour minute) or (year month day) for all-day events. -Converts UTC times (ending in Z) to local time. -If TZID is provided (e.g., `Europe/Lisbon'), converts from that timezone -to local. -Returns nil if parsing fails." - (cond - ;; DateTime format: 20251116T140000Z or 20251116T140000 - ((string-match "\\([0-9]\\{4\\}\\)\\([0-9]\\{2\\}\\)\\([0-9]\\{2\\}\\)T\\([0-9]\\{2\\}\\)\\([0-9]\\{2\\}\\)\\([0-9]\\{2\\}\\)\\(Z\\)?" timestamp-str) - (let* ((year (string-to-number (match-string 1 timestamp-str))) - (month (string-to-number (match-string 2 timestamp-str))) - (day (string-to-number (match-string 3 timestamp-str))) - (hour (string-to-number (match-string 4 timestamp-str))) - (minute (string-to-number (match-string 5 timestamp-str))) - (second (string-to-number (match-string 6 timestamp-str))) - (is-utc (match-string 7 timestamp-str))) - (cond - ;; UTC timestamp (Z suffix) - convert from UTC - (is-utc - (calendar-sync--convert-utc-to-local year month day hour minute second)) - ;; TZID provided - convert from that timezone - (tzid - (or (calendar-sync--convert-tz-to-local year month day hour minute tzid) - ;; Fallback to raw time if conversion fails - (list year month day hour minute))) - ;; No timezone info - assume local time - (t - (list year month day hour minute))))) - ;; Date format: 20251116 - ((string-match "\\([0-9]\\{4\\}\\)\\([0-9]\\{2\\}\\)\\([0-9]\\{2\\}\\)" timestamp-str) - (list (string-to-number (match-string 1 timestamp-str)) - (string-to-number (match-string 2 timestamp-str)) - (string-to-number (match-string 3 timestamp-str)))) - (t nil))) - -(defun calendar-sync--format-timestamp (start end) - "Format START and END timestamps as org timestamp. -START and END are lists from `calendar-sync--parse-timestamp'. -Returns string like '<2025-11-16 Sun 14:00-15:00>' or '<2025-11-16 Sun>'." - (let* ((year (nth 0 start)) - (month (nth 1 start)) - (day (nth 2 start)) - (start-hour (nth 3 start)) - (start-min (nth 4 start)) - (end-hour (and end (nth 3 end))) - (end-min (and end (nth 4 end))) - (date-str (format-time-string - "<%Y-%m-%d %a" - (encode-time 0 0 0 day month year))) - (time-str (when (and start-hour end-hour) - (format " %02d:%02d-%02d:%02d" - start-hour start-min end-hour end-min)))) - (concat date-str time-str ">"))) - -;;; RRULE Parsing and Expansion - -;;; Helper Functions - -(defun calendar-sync--date-to-time (date) - "Convert DATE to time value for comparison. -DATE should be a list starting with (year month day ...). -Only the first three elements are used; extra elements (hour, minute) are -ignored." - (let ((day (nth 2 date)) - (month (nth 1 date)) - (year (nth 0 date))) - (encode-time 0 0 0 day month year))) - -(defun calendar-sync--before-date-p (date1 date2) - "Return t if DATE1 is before DATE2. -Both dates should be lists like (year month day)." - (time-less-p (calendar-sync--date-to-time date1) - (calendar-sync--date-to-time date2))) - -(defun calendar-sync--create-occurrence (base-event occurrence-date) - "Create an occurrence from BASE-EVENT with OCCURRENCE-DATE. -OCCURRENCE-DATE should be a list (year month day hour minute second)." - (let* ((occurrence (copy-sequence base-event)) - (end (plist-get base-event :end))) - (plist-put occurrence :start occurrence-date) - (when end - ;; Use the date from occurrence-date but keep the time from the original end - (let ((date-only (list (nth 0 occurrence-date) - (nth 1 occurrence-date) - (nth 2 occurrence-date)))) - (plist-put occurrence :end (append date-only (nthcdr 3 end))))) - occurrence)) - -(defun calendar-sync--parse-rrule (rrule-str) - "Parse RRULE string into plist. -Returns plist with :freq :interval :byday :until :count." - (let ((parts (split-string rrule-str ";")) - (result '())) - (dolist (part parts) - (when (string-match "\\([^=]+\\)=\\(.+\\)" part) - (let ((key (match-string 1 part)) - (value (match-string 2 part))) - (pcase key - ("FREQ" (setq result (plist-put result :freq (intern (downcase value))))) - ("INTERVAL" (setq result (plist-put result :interval (string-to-number value)))) - ("BYDAY" (setq result (plist-put result :byday (split-string value ",")))) - ("UNTIL" (setq result (plist-put result :until (calendar-sync--parse-timestamp value)))) - ("COUNT" (setq result (plist-put result :count (string-to-number value)))))))) - ;; Set defaults - (unless (plist-get result :interval) - (setq result (plist-put result :interval 1))) - result)) - -(defun calendar-sync--expand-simple-recurrence (base-event rrule range advance-fn) - "Expand a simple (non-weekly) recurring event using ADVANCE-FN to step dates. -BASE-EVENT is the event plist, RRULE is parsed rrule, RANGE is date range. -ADVANCE-FN takes (current-date interval) and returns the next date." - (let* ((start (plist-get base-event :start)) - (interval (plist-get rrule :interval)) - (until (plist-get rrule :until)) - (count (plist-get rrule :count)) - (occurrences '()) - (current-date (list (nth 0 start) (nth 1 start) (nth 2 start))) - (num-generated 0) - (range-end-time (cadr range))) - (while (and (or count until (time-less-p (calendar-sync--date-to-time current-date) range-end-time)) - (or (not until) (calendar-sync--before-date-p current-date until)) - (or (not count) (< num-generated count))) - (let ((occurrence-datetime (append current-date (nthcdr 3 start)))) - (setq num-generated (1+ num-generated)) - (when (calendar-sync--date-in-range-p occurrence-datetime range) - (push (calendar-sync--create-occurrence base-event occurrence-datetime) - occurrences))) - (setq current-date (funcall advance-fn current-date interval))) - (nreverse occurrences))) - -(defun calendar-sync--expand-daily (base-event rrule range) - "Expand daily recurring event. -BASE-EVENT is the event plist, RRULE is parsed rrule, RANGE is date range." - (calendar-sync--expand-simple-recurrence - base-event rrule range #'calendar-sync--add-days)) - -(defun calendar-sync--expand-weekly (base-event rrule range) - "Expand weekly recurring event. -BASE-EVENT is the event plist, RRULE is parsed rrule, RANGE is date range." - (let* ((start (plist-get base-event :start)) - (interval (plist-get rrule :interval)) - (byday (plist-get rrule :byday)) - (until (plist-get rrule :until)) - (count (plist-get rrule :count)) - (occurrences '()) - (current-date (list (nth 0 start) (nth 1 start) (nth 2 start))) - (num-generated 0) - (range-end-time (cadr range)) - (max-iterations 1000) ;; Safety: prevent infinite loops - (iterations 0) - (weekdays (if byday - (mapcar #'calendar-sync--weekday-to-number byday) - (list (calendar-sync--date-weekday current-date))))) - ;; Validate interval - (when (<= interval 0) - (error "Invalid RRULE interval: %s (must be > 0)" interval)) - ;; Start from the first week - ;; For infinite recurrence (no COUNT/UNTIL), stop at range-end for performance - ;; For COUNT, generate all occurrences from start regardless of range - (while (and (< iterations max-iterations) - (or count until (time-less-p (calendar-sync--date-to-time current-date) range-end-time)) - (or (not count) (< num-generated count)) - (or (not until) (calendar-sync--before-date-p current-date until))) - (setq iterations (1+ iterations)) - ;; Generate occurrences for each weekday in this week - (dolist (weekday weekdays) - (let* ((current-weekday (calendar-sync--date-weekday current-date)) - (days-ahead (mod (- weekday current-weekday) 7)) - (occurrence-date (calendar-sync--add-days current-date days-ahead)) - (occurrence-datetime (append occurrence-date (nthcdr 3 start)))) - ;; Check UNTIL date first - (when (or (not until) (calendar-sync--before-date-p occurrence-date until)) - ;; Check COUNT - increment BEFORE range check so COUNT is absolute from start - (when (or (not count) (< num-generated count)) - (setq num-generated (1+ num-generated)) - ;; Only add to output if within date range - (when (calendar-sync--date-in-range-p occurrence-datetime range) - (push (calendar-sync--create-occurrence base-event occurrence-datetime) - occurrences)))))) - ;; Move to next interval week - (setq current-date (calendar-sync--add-days current-date (* 7 interval)))) - (when (>= iterations max-iterations) - (calendar-sync--log-silently "calendar-sync: WARNING: Hit max iterations (%d) expanding weekly event" max-iterations)) - (nreverse occurrences))) - -(defun calendar-sync--expand-monthly (base-event rrule range) - "Expand monthly recurring event. -BASE-EVENT is the event plist, RRULE is parsed rrule, RANGE is date range." - (calendar-sync--expand-simple-recurrence - base-event rrule range #'calendar-sync--add-months)) - -(defun calendar-sync--expand-yearly (base-event rrule range) - "Expand yearly recurring event. -BASE-EVENT is the event plist, RRULE is parsed rrule, RANGE is date range." - (calendar-sync--expand-simple-recurrence - base-event rrule range - (lambda (date interval) (calendar-sync--add-months date (* 12 interval))))) - -(defun calendar-sync--expand-recurring-event (event-str range) - "Expand recurring event EVENT-STR into individual occurrences within RANGE. -Returns list of event plists, or nil if not a recurring event. -Filters out dates excluded via EXDATE properties." - (let ((rrule (calendar-sync--get-property event-str "RRULE"))) - (when rrule - (let* ((base-event (calendar-sync--parse-event event-str)) - (parsed-rrule (calendar-sync--parse-rrule rrule)) - (freq (plist-get parsed-rrule :freq)) - (exdates (calendar-sync--collect-exdates event-str))) - (when base-event - (let ((occurrences - (pcase freq - ('daily (calendar-sync--expand-daily base-event parsed-rrule range)) - ('weekly (calendar-sync--expand-weekly base-event parsed-rrule range)) - ('monthly (calendar-sync--expand-monthly base-event parsed-rrule range)) - ('yearly (calendar-sync--expand-yearly base-event parsed-rrule range)) - (_ (calendar-sync--log-silently "calendar-sync: Unsupported RRULE frequency: %s" freq) - nil)))) - ;; Filter out EXDATE occurrences - (if exdates - (calendar-sync--filter-exdates occurrences exdates) - occurrences))))))) - -(defun calendar-sync--parse-event (event-str) - "Parse single VEVENT string EVENT-STR into plist. -Returns plist with :uid :summary :description :location :start :end -:attendees :organizer :url :status. -Returns nil if event lacks required fields (DTSTART, SUMMARY). -Skips events with RECURRENCE-ID (individual instances of recurring events -are handled separately via exception collection). -Handles TZID-qualified timestamps by converting to local time. -Cleans text fields (description, location, summary) via -`calendar-sync--clean-text'." - ;; Skip individual instances of recurring events (they're collected as exceptions) - (unless (calendar-sync--get-property event-str "RECURRENCE-ID") - (let* ((uid (calendar-sync--get-property event-str "UID")) - (summary (calendar-sync--clean-text - (calendar-sync--get-property event-str "SUMMARY"))) - (description (calendar-sync--clean-text - (calendar-sync--get-property event-str "DESCRIPTION"))) - (location (calendar-sync--clean-text - (calendar-sync--get-property event-str "LOCATION"))) - ;; Get raw property values - (dtstart (calendar-sync--get-property event-str "DTSTART")) - (dtend (calendar-sync--get-property event-str "DTEND")) - ;; Extract TZID from property lines (if present) - (dtstart-line (calendar-sync--get-property-line event-str "DTSTART")) - (dtend-line (calendar-sync--get-property-line event-str "DTEND")) - (start-tzid (calendar-sync--extract-tzid dtstart-line)) - (end-tzid (calendar-sync--extract-tzid dtend-line)) - ;; Extract attendees - (attendee-lines (calendar-sync--get-all-property-lines event-str "ATTENDEE")) - (attendees (delq nil (mapcar #'calendar-sync--parse-attendee-line attendee-lines))) - ;; Extract organizer and URL - (organizer (calendar-sync--parse-organizer event-str)) - (url (calendar-sync--extract-meeting-url event-str)) - ;; Determine user status from attendees - (status (calendar-sync--find-user-status attendees calendar-sync-user-emails))) - (when (and summary dtstart) - (let ((start-parsed (calendar-sync--parse-timestamp dtstart start-tzid)) - (end-parsed (and dtend (calendar-sync--parse-timestamp dtend end-tzid)))) - (when start-parsed - (list :uid uid - :summary summary - :description description - :location location - :start start-parsed - :end end-parsed - :attendees attendees - :organizer organizer - :url url - :status status))))))) - -(defun calendar-sync--event-to-org (event) - "Convert parsed EVENT plist to org entry string. -Produces property drawer with LOCATION, ORGANIZER, STATUS, URL when present. -Description appears as body text after the drawer." - (let* ((summary (cj/org-sanitize-heading - (or (plist-get event :summary) "(No Title)"))) - (description (plist-get event :description)) - (location (plist-get event :location)) - (start (plist-get event :start)) - (end (plist-get event :end)) - (organizer (plist-get event :organizer)) - (status (plist-get event :status)) - (url (plist-get event :url)) - (timestamp (calendar-sync--format-timestamp start end)) - ;; Build property drawer entries - (props '())) - ;; Collect non-nil properties - (when (and location (not (string-empty-p location))) - (push (format ":LOCATION: %s" - (cj/org-sanitize-property-value location)) - props)) - (when organizer - (let ((org-name (or (plist-get organizer :cn) - (plist-get organizer :email)))) - (when org-name - (push (format ":ORGANIZER: %s" - (cj/org-sanitize-property-value org-name)) - props)))) - (when (and status (not (string-empty-p status))) - (push (format ":STATUS: %s" - (cj/org-sanitize-property-value status)) - props)) - (when (and url (not (string-empty-p url))) - (push (format ":URL: %s" - (cj/org-sanitize-property-value url)) - props)) - (setq props (nreverse props)) - ;; Build output - (let ((parts (list timestamp (format "* %s" summary)))) - ;; Add property drawer if any properties exist - (when props - (push ":PROPERTIES:" parts) - (dolist (prop props) - (push prop parts)) - (push ":END:" parts)) - ;; Add description as body text (sanitized to prevent org heading conflicts) - (when (and description (not (string-empty-p description))) - (push (cj/org-sanitize-body-text description) parts)) - (string-join (nreverse parts) "\n")))) - -(defun calendar-sync--event-start-time (event) - "Extract comparable start time from EVENT plist. -Returns time value suitable for comparison, or 0 if no start time." - (let ((start (plist-get event :start))) - (if start - (apply #'encode-time - 0 ; second - (or (nth 4 start) 0) ; minute - (or (nth 3 start) 0) ; hour - (nth 2 start) ; day - (nth 1 start) ; month - (nth 0 start) ; year - nil) - 0))) +;;; Parsing orchestration (defun calendar-sync--parse-ics (ics-content) "Parse ICS-CONTENT and return org-formatted string. @@ -1267,277 +202,7 @@ RECURRENCE-ID exceptions are applied to override specific occurrences." (calendar-sync--log-silently "calendar-sync: Parse error: %s" (error-message-string err)) nil))) -;;; Sync functions - -(defun calendar-sync--fetch-ics (url callback) - "Fetch .ics file from URL asynchronously using curl. -Calls CALLBACK with the .ics content as string (normalized to Unix line endings) -or nil on error. CALLBACK signature: (lambda (content) ...). - -The fetch happens asynchronously and doesn't block Emacs. The callback is -invoked when the fetch completes, either successfully or with an error." - (condition-case err - (let ((buffer (generate-new-buffer " *calendar-sync-curl*"))) - (make-process - :name "calendar-sync-curl" - :buffer buffer - :command (list "curl" "-s" "-L" "--fail" - "--connect-timeout" "10" - "--max-time" (number-to-string calendar-sync-fetch-timeout) - url) - :sentinel - (lambda (process event) - (when (memq (process-status process) '(exit signal)) - (let ((buf (process-buffer process))) - (when (buffer-live-p buf) - (let ((content - (with-current-buffer buf - (if (and (eq (process-status process) 'exit) - (= (process-exit-status process) 0)) - (calendar-sync--normalize-line-endings (buffer-string)) - (calendar-sync--log-silently "calendar-sync: Fetch error: curl failed: %s" (string-trim event)) - nil)))) - (kill-buffer buf) - (funcall callback content)))))))) - (error - (calendar-sync--log-silently "calendar-sync: Fetch error: %s" (error-message-string err)) - (funcall callback nil)))) - -(defun calendar-sync--fetch-ics-file (url callback) - "Fetch .ics from URL to a temp file asynchronously. -Calls CALLBACK with the temp file path on success, or nil on error. The caller -owns deleting the temp file after a successful callback." - (condition-case err - (let ((buffer (generate-new-buffer " *calendar-sync-curl*")) - (temp-file (make-temp-file "calendar-sync-" nil ".ics"))) - (make-process - :name "calendar-sync-curl" - :buffer buffer - :command (list "curl" "-s" "-L" "--fail" - "--connect-timeout" "10" - "--max-time" (number-to-string calendar-sync-fetch-timeout) - "-o" temp-file - url) - :sentinel - (lambda (process event) - (when (memq (process-status process) '(exit signal)) - (let ((buf (process-buffer process)) - (success (and (eq (process-status process) 'exit) - (= (process-exit-status process) 0)))) - (when (buffer-live-p buf) - (unless success - (calendar-sync--log-silently "calendar-sync: Fetch error: curl failed: %s" - (string-trim event))) - (kill-buffer buf)) - (if success - (funcall callback temp-file) - (when (file-exists-p temp-file) - (delete-file temp-file)) - (funcall callback nil))))))) - (error - (calendar-sync--log-silently "calendar-sync: Fetch error: %s" (error-message-string err)) - (funcall callback nil)))) - -(defun calendar-sync--write-file (content file) - "Write CONTENT to FILE atomically. -Creates parent directories if needed, then writes a temp file in the same -directory and renames it into place, so org-agenda or chime reading mid-write -never sees a half-written calendar." - (let ((dir (file-name-directory file))) - (unless (file-directory-p dir) - (make-directory dir t)) - (let ((tmp (make-temp-file (expand-file-name ".calendar-sync-" dir)))) - (with-temp-file tmp - (insert content)) - (rename-file tmp file t)))) - -(defun calendar-sync--emacs-binary () - "Return the Emacs executable to use for calendar conversion workers." - (let ((candidate (expand-file-name invocation-name invocation-directory))) - (if (file-executable-p candidate) - candidate - invocation-name))) - -(defun calendar-sync--batch-convert-file (ics-file output-file past-months future-months user-emails) - "Convert ICS-FILE to Org format and write OUTPUT-FILE. -PAST-MONTHS, FUTURE-MONTHS, and USER-EMAILS mirror the interactive session's -calendar conversion settings. This is intended for noninteractive worker -processes, not direct interactive use." - (setq calendar-sync-past-months past-months - calendar-sync-future-months future-months - calendar-sync-user-emails user-emails) - (let* ((ics-content - (with-temp-buffer - (insert-file-contents ics-file) - (calendar-sync--normalize-line-endings (buffer-string)))) - (org-content (calendar-sync--parse-ics ics-content))) - (unless org-content - (error "calendar-sync: parse failed")) - (calendar-sync--write-file org-content output-file))) - -(defun calendar-sync--worker-command (ics-file output-file) - "Build the batch Emacs command that converts ICS-FILE to OUTPUT-FILE." - (let ((module-dir (file-name-directory calendar-sync--module-file)) - (private-config-file - (make-temp-name (expand-file-name "calendar-sync-worker-config-" - temporary-file-directory))) - (state-file - (make-temp-name (expand-file-name "calendar-sync-worker-state-" - temporary-file-directory)))) - (list (calendar-sync--emacs-binary) - "--batch" - "--no-site-file" - "--no-site-lisp" - "--eval" (format "(setq load-prefer-newer t calendar-sync-auto-start nil calendar-sync-private-config-file %S calendar-sync--state-file %S)" - private-config-file state-file) - "-L" module-dir - "-l" calendar-sync--module-file - "--eval" (format "(calendar-sync--batch-convert-file %S %S %S %S '%S)" - ics-file - output-file - calendar-sync-past-months - calendar-sync-future-months - calendar-sync-user-emails)))) - -(defun calendar-sync--convert-ics-file-async (ics-file output-file callback) - "Convert ICS-FILE to OUTPUT-FILE in a batch Emacs worker. -Calls CALLBACK as (CALLBACK SUCCESS ERROR-MESSAGE). Deletes ICS-FILE after the -worker exits." - (condition-case err - (let ((buffer (generate-new-buffer " *calendar-sync-worker*"))) - (make-process - :name "calendar-sync-worker" - :buffer buffer - :command (calendar-sync--worker-command ics-file output-file) - :sentinel - (lambda (process _event) - (when (memq (process-status process) '(exit signal)) - (let* ((buf (process-buffer process)) - (success (and (eq (process-status process) 'exit) - (= (process-exit-status process) 0))) - (error-message - (when (buffer-live-p buf) - (with-current-buffer buf - (string-trim (buffer-string)))))) - (when (file-exists-p ics-file) - (delete-file ics-file)) - (when (buffer-live-p buf) - (kill-buffer buf)) - (funcall callback success error-message)))))) - (error - (when (file-exists-p ics-file) - (delete-file ics-file)) - (funcall callback nil (error-message-string err))))) - -(defun calendar-sync--mark-sync-failed (name reason) - "Record failed sync state for calendar NAME with REASON." - (calendar-sync--set-calendar-state - name - (list :status 'error - :last-sync (plist-get (calendar-sync--get-calendar-state name) :last-sync) - :last-error reason)) - (calendar-sync--save-state) - (message "calendar-sync: [%s] Sync failed (see *Messages*)" name)) - -;;; Debug Logging - -(defun calendar-sync--load-private-config () - "Load private calendar-sync configuration when available." - (when (file-readable-p calendar-sync-private-config-file) - (condition-case err - (load calendar-sync-private-config-file nil t) - (error - (message "calendar-sync: Failed to load private config %s: %s" - (abbreviate-file-name calendar-sync-private-config-file) - (error-message-string err)))))) - -(defun calendar-sync--debug-p () - "Return non-nil if calendar-sync debug logging is enabled. -Checks `cj/debug-modules' for symbol `calendar-sync' or t (all)." - (and (boundp 'cj/debug-modules) - (or (eq cj/debug-modules t) - (memq 'calendar-sync cj/debug-modules)))) - -;;; Google Calendar API Fetch Path - -(defun calendar-sync--api-script () - "Return the absolute path to the Google Calendar API helper script. -Resolved relative to this module so batch workers and tests don't depend -on `user-emacs-directory'." - (let ((module-dir (file-name-directory calendar-sync--module-file))) - (expand-file-name "calendar_sync_api.py" - (expand-file-name "scripts" - (file-name-parent-directory module-dir))))) - -(defun calendar-sync--api-command (account calendar-id output-file) - "Build the command list that runs the API helper. -ACCOUNT and CALENDAR-ID select the OAuth account and calendar; OUTPUT-FILE -is where the helper writes rendered org content. The past/future window -mirrors the .ics path's `calendar-sync-past-months' / -`calendar-sync-future-months'. When `calendar-sync-skip-declined' is nil, -passes --keep-declined so the API path honors the same toggle." - (append - (list calendar-sync-python-command - (calendar-sync--api-script) - "--account" account - "--calendar-id" calendar-id - "--output" output-file - "--past-months" (number-to-string calendar-sync-past-months) - "--future-months" (number-to-string calendar-sync-future-months)) - (unless calendar-sync-skip-declined - (list "--keep-declined")))) - -(defun calendar-sync--sync-calendar-api (calendar) - "Sync a single Google CALENDAR via the API helper script. -CALENDAR is a plist with :name, :account, :calendar-id, and :file keys. -The helper fetches, filters, and renders org in one pass and writes :file -directly, so it runs in a single external process off the interactive thread." - (let* ((name (plist-get calendar :name)) - (account (plist-get calendar :account)) - (calendar-id (plist-get calendar :calendar-id)) - (file (plist-get calendar :file)) - (fetch-start (float-time))) - (calendar-sync--set-calendar-state name '(:status syncing)) - (calendar-sync--log-silently "calendar-sync: [%s] Syncing (API)..." name) - (condition-case err - (let ((buffer (generate-new-buffer " *calendar-sync-api*"))) - (make-process - :name "calendar-sync-api" - :buffer buffer - :command (calendar-sync--api-command account calendar-id file) - :sentinel - (lambda (process _event) - (when (memq (process-status process) '(exit signal)) - (let* ((buf (process-buffer process)) - (success (and (eq (process-status process) 'exit) - (= (process-exit-status process) 0))) - (output (when (buffer-live-p buf) - (with-current-buffer buf - (string-trim (buffer-string)))))) - (when (buffer-live-p buf) - (kill-buffer buf)) - (if (not success) - (calendar-sync--mark-sync-failed - name (if (or (null output) (string-empty-p output)) - "API helper failed" - output)) - (calendar-sync--set-calendar-state - name - (list :status 'ok - :last-sync (current-time) - :last-error nil)) - (setq calendar-sync--last-timezone-offset - (calendar-sync--current-timezone-offset)) - (calendar-sync--save-state) - (let ((total-elapsed (- (float-time) fetch-start))) - (message "calendar-sync: [%s] Sync complete (%.1fs total) → %s" - name total-elapsed file)))))))) - (error - (calendar-sync--log-silently "calendar-sync: [%s] API helper error: %s" - name (error-message-string err)) - (calendar-sync--mark-sync-failed name (error-message-string err)))))) - -;;; Single Calendar Sync +;;; Sync dispatch (defun calendar-sync--sync-calendar (calendar) "Sync a single CALENDAR asynchronously. @@ -1551,63 +216,6 @@ calendar files do not block the interactive Emacs thread." (calendar-sync--sync-calendar-api calendar) (calendar-sync--sync-calendar-ics calendar))) -(defun calendar-sync--calendar-url (calendar) - "Return the .ics feed URL for CALENDAR, or nil if none is configured. -An explicit :url wins. Otherwise :secret-host names an auth-source host -whose stored secret is the URL (kept in auth-source because the .ics URL -is itself a token)." - (or (plist-get calendar :url) - (when-let* ((host (plist-get calendar :secret-host))) - (cj/auth-source-secret-value host)))) - -(defun calendar-sync--sync-calendar-ics (calendar) - "Sync a single CALENDAR from its .ics feed asynchronously. -CALENDAR is a plist with :name, :file, and a feed URL resolved by -`calendar-sync--calendar-url' (an explicit :url, or a :secret-host -looked up in auth-source)." - (let ((name (plist-get calendar :name)) - (url (calendar-sync--calendar-url calendar)) - (file (plist-get calendar :file)) - (fetch-start (float-time))) - (calendar-sync--set-calendar-state name '(:status syncing)) - (calendar-sync--log-silently "calendar-sync: [%s] Syncing..." name) - (calendar-sync--fetch-ics-file - url - (lambda (ics-file) - (let ((fetch-elapsed (- (float-time) fetch-start))) - (if (null ics-file) - (progn - (calendar-sync--log-silently "calendar-sync: [%s] Fetch failed" name) - (calendar-sync--mark-sync-failed name "Fetch failed")) - (when (calendar-sync--debug-p) - (calendar-sync--log-silently "calendar-sync: [%s] Fetched in %.1fs" - name fetch-elapsed)) - (calendar-sync--convert-ics-file-async - ics-file - file - (lambda (success error-message) - (if (not success) - (progn - (calendar-sync--log-silently "calendar-sync: [%s] Conversion failed: %s" - name error-message) - (calendar-sync--mark-sync-failed - name - (if (or (null error-message) - (string-empty-p error-message)) - "Conversion failed" - error-message))) - (calendar-sync--set-calendar-state - name - (list :status 'ok - :last-sync (current-time) - :last-error nil)) - (setq calendar-sync--last-timezone-offset - (calendar-sync--current-timezone-offset)) - (calendar-sync--save-state) - (let ((total-elapsed (- (float-time) fetch-start))) - (message "calendar-sync: [%s] Sync complete (%.1fs total) → %s" - name total-elapsed file))))))))))) - (defun calendar-sync--require-calendars () "Return non-nil if calendars are configured, else warn and return nil." (or calendar-sync-calendars @@ -1631,6 +239,8 @@ Each calendar syncs in parallel." (cl-find-if (lambda (cal) (string= (plist-get cal :name) name)) calendar-sync-calendars)) +;;; Commands + ;;;###autoload (defun calendar-sync-now (&optional calendar-name) "Sync calendar(s) now asynchronously. @@ -1771,12 +381,29 @@ Syncs all calendars immediately, then every `calendar-sync-interval-minutes'." ;; User can manually sync or it will happen on next timer tick if auto-sync is enabled )) -;; Start auto-sync if enabled and calendars are configured -;; Syncs immediately then every calendar-sync-interval-minutes (default: 60 minutes) +;; Defer auto-sync until calendar data is first needed. +;; +;; The :secret-host feed URLs live in authinfo.gpg, and BOTH the immediate sync +;; and every periodic timer tick resolve them. Calling `calendar-sync-start' at +;; load (immediate sync + recurring timer) therefore decrypts authinfo.gpg right +;; after startup, prompting for the GPG passphrase on a cold gpg-agent (e.g. +;; after a reboot). Defer the whole start to the first org-agenda use, so the +;; unlock happens when the user actually asks for calendar data. A manual +;; `calendar-sync-start' / `calendar-sync-now' still works on demand. +(defun calendar-sync--auto-start-on-first-agenda () + "Start auto-sync on the first org-agenda use, then remove this hook. +One-shot: deferring `calendar-sync-start' until the agenda is first built keeps a +cold gpg-agent from being prompted for the authinfo passphrase at startup. +Removes itself before starting so a `calendar-sync-start' error can't re-fire it." + (remove-hook 'org-agenda-mode-hook #'calendar-sync--auto-start-on-first-agenda) + (calendar-sync-start)) + +;; Arm the deferred start when auto-sync is enabled and calendars are configured. (when (and calendar-sync-auto-start calendar-sync-calendars (not noninteractive)) - (calendar-sync-start)) + (add-hook 'org-agenda-mode-hook #'calendar-sync--auto-start-on-first-agenda)) + (provide 'calendar-sync) ;;; calendar-sync.el ends here diff --git a/modules/calibredb-epub-config.el b/modules/calibredb-epub-config.el index 1e6437d26..b03d83ed0 100644 --- a/modules/calibredb-epub-config.el +++ b/modules/calibredb-epub-config.el @@ -1,4 +1,4 @@ -;;; calibredb-epub-config --- Functionality for Ebook Management and Display -*- lexical-binding: t; coding: utf-8; -*- +;;; calibredb-epub-config.el --- Functionality for Ebook Management and Display -*- lexical-binding: t; coding: utf-8; -*- ;; author Craig Jennings <c@cjennings.net> ;;; Commentary: @@ -6,46 +6,17 @@ ;; Layer: 4 (Optional). ;; Category: O/D/P. ;; Load shape: eager. -;; Eager reason: none; optional ebook workflow, a command-loaded deferral -;; candidate for Phase 4. -;; Top-level side effects: one add-hook, one advice-add, package config. -;; Runtime requires: user-constants, subr-x. +;; Eager reason: none; ebook commands can load by command. +;; Top-level side effects: one hook, one advice, package config. +;; Runtime requires: user-constants, subr-x, transient. ;; Direct test load: yes. ;; -;; This module provides a comprehensive ebook management and reading experience -;; within Emacs, integrating CalibreDB for library management and Nov for EPUB -;; reading. +;; CalibreDB and Nov integration for browsing the Calibre library and reading +;; EPUBs inside Emacs. The module adds a curated CalibreDB transient, filter +;; helpers, Nov typography, image centering, and reader-to-library navigation. ;; -;; FEATURES: -;; - CalibreDB integration for managing your Calibre ebook library -;; - Nov mode for reading EPUB files with customized typography and layout -;; - Seamless navigation between Nov reading buffers and CalibreDB entries -;; - Image centering in EPUB documents without modifying buffer text -;; - Quick filtering and searching within your ebook library -;; -;; KEY BINDINGS: -;; - M-B: Open CalibreDB library browser -;; - In CalibreDB search mode: -;; - l: Filter by tag -;; - L: Clear all filters -;; - In Nov mode: -;; - z: Open current EPUB in external viewer (zathura) -;; - C-c C-b: Jump to CalibreDB entry for current book -;; - m: Set bookmark -;; - b: List bookmarks -;; -;; WORKFLOW: -;; 1. Press M-B to browse your Calibre library -;; 2. Use filters (l for tags, L to clear) to narrow results -;; 3. Open an EPUB to read it in Nov with optimized typography -;; 4. While reading, use C-c C-b to jump back to the book's metadata -;; 5. Use z to open in external reader when needed -;; -;; CONFIGURATION NOTES: -;; - Prefers EPUB format when available, falls back to PDF -;; - Centers images in EPUB documents using display properties -;; - Applies custom typography with larger fonts for comfortable reading -;; - Uses visual-fill-column for centered text with appropriate margins +;; EPUB is preferred when available; external opening remains available for +;; formats or workflows better handled outside Emacs. ;;; Code: @@ -60,8 +31,19 @@ (declare-function nov-render-document "nov" ()) (defvar nov-text-width) ; from nov.el; set buffer-local here +(require 'nov-reading) ;; reading-view theme layer: palettes + typography + size + ;; calibredb commands the curated menu drives (all autoloaded by calibredb) (declare-function calibredb-switch-library "calibredb" ()) +(declare-function calibredb-search-keyword-filter "calibredb-search") + +;; calibredb's filter-scope flags (set in `cj/--calibredb-open-to-favorites'); +;; declared special so the assignments compile clean when calibredb is absent. +(defvar calibredb-tag-filter-p) +(defvar calibredb-favorite-filter-p) +(defvar calibredb-author-filter-p) +(defvar calibredb-date-filter-p) +(defvar calibredb-format-filter-p) (declare-function calibredb-filter-by-book-format "calibredb" ()) (declare-function calibredb-filter-by-author-sort "calibredb" ()) (declare-function calibredb-search-clear-filter "calibredb" ()) @@ -116,6 +98,26 @@ which re-applies `calibredb-search-filter' instead." (setq calibredb-sort-by field) (calibredb-search-refresh-or-resume)) +(defun cj/--calibredb-open-to-favorites (&rest _) + "Filter the calibredb search to books tagged `calibredb-favorite-keyword'. +Advice (:after) on `calibredb' so every launch lands on the favorite-keyword +books (Craig's \"in-progress\" reading list); clear with L / x to see the +whole library. Scopes to the tag field (sets `calibredb-tag-filter-p', +clears the other filter-scope flags), because a bare keyword filter matches +the keyword in any field -- title, author, or the description -- and would +surface books that merely mention it. No-op unless a non-empty string +keyword is set." + (when (and (boundp 'calibredb-favorite-keyword) + (stringp calibredb-favorite-keyword) + (not (string-empty-p calibredb-favorite-keyword)) + (fboundp 'calibredb-search-keyword-filter)) + (setq calibredb-tag-filter-p t + calibredb-favorite-filter-p nil + calibredb-author-filter-p nil + calibredb-date-filter-p nil + calibredb-format-filter-p nil) + (calibredb-search-keyword-filter calibredb-favorite-keyword))) + (use-package calibredb :commands calibredb :bind @@ -184,7 +186,10 @@ which re-applies `calibredb-search-filter' instead." (setq calibredb-order "asc") (setq calibredb-id-width 7) (setq calibredb-favorite-icon "🔖") - (setq calibredb-favorite-keyword "in-progress")) + (setq calibredb-favorite-keyword "in-progress") + ;; Open every calibredb launch (dashboard, M-x, elsewhere) filtered to the + ;; in-progress favorites; L / x clears to the whole library. + (advice-add 'calibredb :after #'cj/--calibredb-open-to-favorites)) ;; ------------------------------ Nov Epub Reader ------------------------------ @@ -207,7 +212,6 @@ Adjust it live with `cj/nov-widen-text' and `cj/nov-narrow-text'.") (if (and buffer-file-name (string-match-p "\\.epub\\'" buffer-file-name)) (progn - ;; Load nov if not already loaded (unless (featurep 'nov) (require 'nov nil t)) ;; Call nov-mode if available, otherwise fallback to default behavior @@ -312,12 +316,8 @@ A positive DELTA narrows the text column; a negative DELTA widens it." (defun cj/nov-apply-preferences () "Apply preferences after nov-mode has launched." (interactive) - ;; Use Merriweather for comfortable reading with appropriate scaling. - ;; (Reading fg color stripped; falls back to the theme default until a - ;; themeable reading face exists -- see todo.org.) - (face-remap-add-relative 'variable-pitch :family "Merriweather" :height 1.0) - (face-remap-add-relative 'default :family "Merriweather" :height 180) - (face-remap-add-relative 'fixed-pitch :height 180) + ;; Reading typography + color palette live in the nov-reading theme layer. + (cj/nov-reading-setup) ;; Enable visual-line-mode for proper text wrapping (visual-line-mode 1) ;; Set fill-column as a fallback @@ -404,6 +404,12 @@ Try to use the Calibre book id from the parent folder name (for example, (calibredb-search-keyword-filter "") (message "CalibreDB: no metadata; showing all")))))) +(require 'system-lib) +;; nov renders epub via shr, which paints with manual `face' properties. Left in +;; `global-font-lock-mode' font-lock overwrites them and the book loses its +;; colors, the same issue as elfeed-show and mu4e-view. Exclude nov-mode. +(cj/exclude-from-global-font-lock 'nov-mode) + (use-package nov :mode ("\\.epub\\'" . nov-mode) @@ -420,26 +426,32 @@ Try to use the Calibre book id from the parent folder name (for example, ("<" . nov-history-back) (">" . nov-history-forward) ("," . backward-paragraph) - ;; +/= widen the text column, -/_ narrow it (50%..100% of the window) - ("+" . cj/nov-widen-text) - ("=" . cj/nov-widen-text) - ("-" . cj/nov-narrow-text) - ("_" . cj/nov-narrow-text) + ;; +/- adjust the page font size, = resets it to the default height + ("+" . cj/nov-reading-text-bigger) + ("-" . cj/nov-reading-text-smaller) + ("=" . cj/nov-reading-text-reset) + ;; { } adjust the text-column width (50%..100% of the window) + ("}" . cj/nov-widen-text) + ("{" . cj/nov-narrow-text) ;; open current EPUB with zathura (same key in pdf-view) ("z" . cj/nov-open-external) ("t" . nov-goto-toc) + ;; c cycles reading palettes (sepia/dark/light/none); C picks one by name + ("c" . cj/nov-cycle-reading-palette) + ("C" . cj/nov-set-reading-palette) ("C-c C-b" . cj/nov-jump-to-calibredb))) ;; ------------------------- Nov bookmark naming ------------------------------- ;; In a nov buffer "m" is bound to `bookmark-set' (above). nov's -;; `nov-bookmark-make-record' names the record after `(buffer-name)' -- the EPUB -;; filename, extension and all. Rebuild it as "Author, Title" parsed from the -;; filename: under Calibre's "<Title> - <Author>.epub" naming the filename is -;; more complete than the EPUB's embedded metadata (which carries truncated -;; titles and author-sort "Last, First" forms). - -(defun cj/--nov-clean-title (s) - "Clean a title or author S parsed from an EPUB filename, or nil when blank. +;; Both nov (EPUB) and pdf-view (PDF) name a new bookmark after the buffer -- +;; the file's name, extension and all. Rebuild it as "Author, Title" parsed +;; from the filename: under Calibre's "<Title> - <Author>.<ext>" naming the +;; filename is more complete than the file's embedded metadata (which carries +;; truncated titles and author-sort "Last, First" forms). One :filter-return +;; advice serves both record functions; the parser is extension-agnostic. + +(defun cj/--reading-clean-title (s) + "Clean a title or author S parsed from a book filename, or nil when blank. Restores a colon where Calibre sanitized \":\" to \"_\" (\"Frege_ A Guide\" -> \"Frege: A Guide\"), turns any leftover underscore into a space, and collapses runs of whitespace." @@ -449,34 +461,39 @@ collapses runs of whitespace." (out (string-trim (replace-regexp-in-string "[ \t]+" " " spaced)))) (and (not (string-empty-p out)) out)))) -(defun cj/--nov-bookmark-name-from-file (path) - "Return \"Author, Title\" derived from an EPUB PATH's filename, or nil. +(defun cj/--reading-bookmark-name-from-file (path) + "Return \"Author, Title\" derived from a book PATH's filename, or nil. Splits the filename (sans extension) on its last \" - \" into title and author per Calibre's \"<Title> - <Author>\" convention, restoring colons and reordering to \"Author, Title\". Falls back to the cleaned whole name when -there is no \" - \" separator." +there is no \" - \" separator. Extension-agnostic, so it serves EPUB and PDF." (when (and (stringp path) (not (string-empty-p path))) (let ((base (file-name-sans-extension (file-name-nondirectory path)))) (if (string-match "\\`\\(.+\\) - \\(.+\\)\\'" base) - (let ((title (cj/--nov-clean-title (match-string 1 base))) - (author (cj/--nov-clean-title (match-string 2 base)))) + (let ((title (cj/--reading-clean-title (match-string 1 base))) + (author (cj/--reading-clean-title (match-string 2 base)))) (cond ((and author title) (format "%s, %s" author title)) (title title) (author author) (t nil))) - (cj/--nov-clean-title base))))) - -(defun cj/--nov-bookmark-rename-record (record) - "Replace RECORD's bookmark name with \"Author, Title\" from its EPUB filename. -Advice (:filter-return) on `nov-bookmark-make-record'. RECORD is -\(NAME . ALIST) carrying a `filename'; left unchanged when no name derives." - (let ((name (cj/--nov-bookmark-name-from-file + (cj/--reading-clean-title base))))) + +(defun cj/--reading-bookmark-rename-record (record) + "Replace RECORD's bookmark name with \"Author, Title\" from its filename. +Advice (:filter-return) on `nov-bookmark-make-record' and +`pdf-view-bookmark-make-record'. RECORD is (NAME . ALIST) carrying a +`filename'; left unchanged when no name derives." + (let ((name (cj/--reading-bookmark-name-from-file (alist-get 'filename (cdr record))))) (if name (cons name (cdr record)) record))) (with-eval-after-load 'nov (advice-add 'nov-bookmark-make-record :filter-return - #'cj/--nov-bookmark-rename-record)) + #'cj/--reading-bookmark-rename-record)) + +(with-eval-after-load 'pdf-view + (advice-add 'pdf-view-bookmark-make-record :filter-return + #'cj/--reading-bookmark-rename-record)) (defun cj/--nov-image-padding-cols (col-width img-px font-width-px) "Return left-padding columns to center an IMG-PX-wide image in COL-WIDTH cols. diff --git a/modules/chrono-tools.el b/modules/chrono-tools.el index 744781268..57309178d 100644 --- a/modules/chrono-tools.el +++ b/modules/chrono-tools.el @@ -9,7 +9,7 @@ ;; Eager reason: none; calendar/timer commands, a command-loaded deferral ;; candidate. ;; Top-level side effects: package configuration via use-package. -;; Runtime requires: user-constants. +;; Runtime requires: user-constants, system-lib. ;; Direct test load: yes. ;; ;; This module centralizes configuration for Emacs time-related tools: @@ -21,6 +21,7 @@ ;;; Code: (require 'user-constants) +(require 'system-lib) ;; provides cj/completion-table-annotated, cj/completion-file-annotator ;; Declared by the lazily-loaded `tmr' package; quiet the byte-compiler ;; without forcing the package to load. @@ -107,7 +108,12 @@ Present all audio files in the sounds directory and set the chosen file as (if current-file (format " (current: %s)" current-file) "")) - sound-files nil t nil nil current-file))) + (cj/completion-table-annotated + 'cj-sound-file + (cj/completion-file-annotator + (lambda (c) (expand-file-name c sounds-dir))) + sound-files) + nil t nil nil current-file))) (if (or (null selected-file) (string-empty-p selected-file)) (message "No file selected") (message "%s" (cj/tmr--apply-sound-file selected-file))))))))) diff --git a/modules/config-utilities.el b/modules/config-utilities.el index f448327c1..72427ef9b 100644 --- a/modules/config-utilities.el +++ b/modules/config-utilities.el @@ -1,4 +1,4 @@ -;;; config-utilities --- Config Hacking Utilities -*- lexical-binding: t; coding: utf-8; -*- +;;; config-utilities.el --- Config Hacking Utilities -*- lexical-binding: t; coding: utf-8; -*- ;; author Craig Jennings <c@cjennings.net> ;;; Commentary: @@ -114,11 +114,14 @@ Signals `user-error' if METHOD-SYMBOL is nil or not fboundp." (with-timer title (funcall method-symbol))) +(require 'system-lib) + (defun cj/benchmark-this-method () "Prompt for a title and method name, then time the execution of the method." (interactive) (let* ((title (read-string "Enter the title for the timing: ")) - (method-name (completing-read "Enter the method name to time: " obarray + (method-name (completing-read "Enter the method name to time: " + (cj/completion-table 'function obarray) #'fboundp t)) (method-symbol (intern-soft method-name))) (condition-case err diff --git a/modules/custom-buffer-file.el b/modules/custom-buffer-file.el index 84faf01d8..38ae0bae1 100644 --- a/modules/custom-buffer-file.el +++ b/modules/custom-buffer-file.el @@ -370,6 +370,262 @@ Sets up diff-mode for navigation." (diff-mode) (goto-char (point-min))))) +(defun cj/--diff-buffer-renderer (ws-only difft-available) + "Choose the diff renderer symbol from WS-ONLY and DIFFT-AVAILABLE. +`whitespace' for a whitespace-only diff (a plain unified diff with trailing +whitespace highlighted, because difftastic treats it as no change and renders it +blank); otherwise `difftastic' when available, else `regular'." + (cond (ws-only 'whitespace) + (difft-available 'difftastic) + (t 'regular))) + +(defun cj/--diff-whitespace-only-p (file-a file-b) + "Return non-nil if FILE-A and FILE-B differ ONLY in whitespace. +Route-1 detection via diff(1): true when a plain `diff' reports a difference but +`diff -w' (ignore all whitespace) reports none. Identical files differ in +nothing, so they are not whitespace-only." + (and (not (zerop (call-process "diff" nil nil nil "-q" file-a file-b))) + (zerop (call-process "diff" nil nil nil "-q" "-w" file-a file-b)))) + +(defun cj/--buffer-differs-prompt-string (name ws-only-p) + "Build the buffer-differs prompt question for buffer NAME. +When WS-ONLY-P is non-nil, fold a terse \"(whitespace only)\" parenthetical into +the question so the reader knows the difference is whitespace before choosing." + (format "%s changed on disk%s" + name (if ws-only-p " (whitespace only)" ""))) + +(defun cj/--buffer-differs-choices () + "Return the terse `read-multiple-choice' menu for the disk-changed save prompt. +Inline names are single words so the menu fits at a glance; the full meaning is +in each description (the ? help). s overwrites the file with the buffer; r +discards the buffer's edits and rereads from disk." + '((?s "save" "overwrite the file with this buffer") + (?d "diff" "show what changed, then ask again") + (?w "clean" "clean whitespace and save") + (?r "revert" "discard edits and reread from disk") + (?c "cancel" "leave the buffer as is"))) + +(defun cj/--buffer-changed-on-disk-p (buffer) + "Return non-nil if BUFFER is modified AND its file changed on disk since visited. +This is the disk-changed conflict: there are unsaved edits to lose AND the file +underneath has moved, so a plain save would silently overwrite the disk version." + (when (buffer-live-p buffer) + (with-current-buffer buffer + (and (buffer-modified-p) + buffer-file-name + (file-exists-p buffer-file-name) + (not (verify-visited-file-modtime buffer)))))) + +(defun cj/--buffer-differs-action (key) + "Map a disk-changed-prompt KEY to an action symbol, or nil when unmapped. +`save' overwrites the file, `clean-save' cleans whitespace then saves, `revert' +rereads from disk, `cancel' does nothing, and `diff' peeks (the caller re-prompts)." + (pcase key + (?s 'save) + (?w 'clean-save) + (?r 'revert) + (?d 'diff) + (?c 'cancel))) + +(defun cj/--buffer-differs-dispatch (buffer action) + "Carry out ACTION for BUFFER after a disk-changed prompt. +`save' overwrites the file with the buffer; `clean-save' strips trailing +whitespace first; `revert' discards the buffer's edits and rereads the disk; +`cancel' leaves the buffer untouched. Save updates the recorded modtime first so +the stock `save-buffer' does not re-ask its own \"changed on disk\" question." + (with-current-buffer buffer + (pcase action + ('save (set-visited-file-modtime) (save-buffer)) + ('clean-save (delete-trailing-whitespace) (set-visited-file-modtime) (save-buffer)) + ('revert (revert-buffer t t)) + ('cancel (message "Save cancelled; buffer left as is")) + (_ nil)))) + +(defun cj/--read-choice-with-diff (prompt choices show-diff-fn) + "Read a `read-multiple-choice' key for PROMPT and CHOICES; d toggles a diff. +SHOW-DIFF-FN displays the buffer/file diff and returns its buffer. The d key +shows the diff, or hides it when it is already shown (a toggle). Any other key +-- a terminating choice -- closes a still-open diff window before returning that +key, so the diff never lingers after the decision is made." + (let ((key nil) (diff-buf nil)) + (while (not key) + (let ((k (car (read-multiple-choice prompt choices)))) + (if (eq k ?d) + (let ((win (and (buffer-live-p diff-buf) (get-buffer-window diff-buf)))) + (if win + (progn (quit-window nil win) (setq diff-buf nil)) + (setq diff-buf (funcall show-diff-fn)))) + (setq key k)))) + (let ((win (and (buffer-live-p diff-buf) (get-buffer-window diff-buf)))) + (when win (quit-window nil win))) + key)) + +(defun cj/--buffer-differs-read-key (buffer ws-only) + "Read a disk-changed-prompt key for BUFFER via `read-multiple-choice'. +WS-ONLY non-nil folds a terse \"(whitespace only)\" note into the prompt. d +toggles the buffer/file diff; a terminating choice closes a still-open diff." + (cj/--read-choice-with-diff + (cj/--buffer-differs-prompt-string (buffer-name buffer) ws-only) + (cj/--buffer-differs-choices) + (lambda () (with-current-buffer buffer (cj/diff-buffer-with-file))))) + +(defun cj/save-buffer (&optional arg) + "Save the current buffer; show a legible menu when the file changed on disk. +A normal save falls straight through to `save-buffer' (ARG, the prefix argument, +is passed along so \\[universal-argument] \\[save-buffer] still marks for backup). +When the buffer has unsaved edits AND the file changed on disk since it was +visited, offer a terse labeled menu -- save / diff / clean / revert / cancel -- +instead of the stock yes/no \"Save anyway?\" prompt. Bound to \\`C-x C-s'." + (interactive "P") + (if (not (cj/--buffer-changed-on-disk-p (current-buffer))) + (save-buffer arg) + (let* ((buf (current-buffer)) + (ws-only (cj/--buffer-file-whitespace-only-p buf)) + (key (cj/--buffer-differs-read-key buf ws-only))) + (cj/--buffer-differs-dispatch buf (cj/--buffer-differs-action key))))) + +(defun cj/--save-some-buffers-action (key) + "Map a save-loop KEY to (THIS-ACTION . LOOP-EFFECT), or nil when unmapped. +THIS-ACTION is `save', `clean-save', `skip', or `diff'. LOOP-EFFECT is +`continue' (keep prompting), `save-rest' (save this and all remaining without +asking), `stop' (act on this, skip the rest), or `reprompt' (peek, then ask the +same buffer again)." + (pcase key + (?y '(save . continue)) + (?n '(skip . continue)) + (?w '(clean-save . continue)) + (?! '(save . save-rest)) + (?. '(save . stop)) + (?q '(skip . stop)) + (?d '(diff . reprompt)))) + +(defun cj/--save-some-buffers-choices () + "Return the terse `read-multiple-choice' choices for the save loop. +Single-word inline names keep the menu to the minimum space; the full meaning is +in each description (the ? help)." + '((?y "save" "save this buffer") + (?n "skip" "do not save this buffer") + (?w "clean" "clean whitespace and save this buffer") + (?d "diff" "show what changed, then ask again") + (?! "all" "save this and all remaining buffers") + (?. "only" "save this buffer, then skip the rest") + (?q "none" "stop; save no more buffers"))) + +(defun cj/--buffer-file-whitespace-only-p (buffer) + "Return non-nil if BUFFER's text differs from its visited file ONLY in whitespace. +Writes the buffer to a temp file and reuses `cj/--diff-whitespace-only-p'. Nil +when BUFFER visits no file or the file is gone." + (when (buffer-live-p buffer) + (with-current-buffer buffer + (let ((file (buffer-file-name))) + (when (and file (file-exists-p file)) + (let ((temp (make-temp-file "cbf-ws-buf-" nil + (or (file-name-extension file t) ""))) + (content (buffer-string))) + (unwind-protect + (progn (with-temp-file temp (insert content)) + (cj/--diff-whitespace-only-p file temp)) + (when (file-exists-p temp) (delete-file temp))))))))) + +(defun cj/--save-some-buffers-plan (buffers key-fn) + "Resolve each buffer in BUFFERS to a per-buffer action using KEY-FN. +KEY-FN is called with a buffer and returns a `read-multiple-choice' key; the diff +re-prompt is the caller's concern, so KEY-FN never returns ?d. Returns a list of +\(BUFFER . ACTION) where ACTION is `save', `clean-save', or `skip', honoring +`save-rest' (! saves this and all remaining) and `stop' (./q act on this, then +skip the rest). KEY-FN is not consulted once a buffer triggers save-rest or stop." + (let ((plan nil) (mode 'ask)) + (dolist (buf buffers (nreverse plan)) + (pcase mode + ('save-all (push (cons buf 'save) plan)) + ('done (push (cons buf 'skip) plan)) + ('ask + (pcase (cj/--save-some-buffers-action (funcall key-fn buf)) + (`(,act . save-rest) (push (cons buf act) plan) (setq mode 'save-all)) + (`(,act . stop) (push (cons buf act) plan) (setq mode 'done)) + (`(,act . ,_) (push (cons buf act) plan)) + (_ (push (cons buf 'skip) plan)))))))) + +(declare-function files--buffers-needing-to-be-saved "files" (pred)) + +(defun cj/--save-some-buffers-read-key (buffer ws-only) + "Read a save-loop key for BUFFER via `read-multiple-choice'. +WS-ONLY non-nil folds a terse \"(whitespace only)\" note into the prompt. d +toggles the buffer/file diff; a terminating choice closes a still-open diff." + (cj/--read-choice-with-diff + (format "Save %s%s" + (if (buffer-file-name buffer) + (file-name-nondirectory (buffer-file-name buffer)) + (buffer-name buffer)) + (if ws-only " (whitespace only)" "")) + (cj/--save-some-buffers-choices) + (lambda () (with-current-buffer buffer (cj/diff-buffer-with-file))))) + +(defun cj/--save-some-buffers-execute (plan) + "Carry out PLAN, a list of (BUFFER . ACTION); return the number saved. +ACTION `clean-save' deletes trailing whitespace before saving; `save' saves as-is; +`skip' leaves the buffer alone." + (let ((n 0)) + (dolist (entry plan n) + (let ((buffer (car entry))) + (when (buffer-live-p buffer) + (with-current-buffer buffer + (pcase (cdr entry) + ('clean-save (delete-trailing-whitespace) (save-buffer) (setq n (1+ n))) + ('save (save-buffer) (setq n (1+ n))) + (_ nil)))))))) + +(defun cj/save-some-buffers (&optional arg pred) + "Save modified buffers with a legible, labeled prompt per buffer. +A `read-multiple-choice' replacement for `save-some-buffers': the options are +shown on screen rather than recalled as keys, with an added clean-whitespace-and- +save action and a per-buffer \"(whitespace only)\" note. ARG and PRED match +`save-some-buffers' -- ARG non-nil saves all without asking; PRED selects which +buffers are considered. Installed over `save-some-buffers' by advice, so \\[save-some-buffers] +and the save-on-exit prompt both use it." + (interactive "P") + (unless pred + (setq pred + (if (and (symbolp save-some-buffers-default-predicate) + (get save-some-buffers-default-predicate + 'save-some-buffers-function)) + (funcall save-some-buffers-default-predicate) + save-some-buffers-default-predicate))) + (let (queried autosaved-buffers files-done inhibit-message) + (save-window-excursion + ;; Save buffers flagged for unconditional save first (mirrors the original). + (dolist (buffer (buffer-list)) + (with-current-buffer buffer + (when (and buffer-save-without-query (buffer-modified-p)) + (push (buffer-name) autosaved-buffers) + (save-buffer)))) + (let* ((candidates (files--buffers-needing-to-be-saved pred)) + (plan (if arg + (mapcar (lambda (b) (cons b 'save)) candidates) + (when candidates (setq queried t)) + (cj/--save-some-buffers-plan + candidates + (lambda (b) + (cj/--save-some-buffers-read-key + b (cj/--buffer-file-whitespace-only-p b))))))) + (setq files-done (cj/--save-some-buffers-execute plan))) + ;; Let other things (abbrevs, etc.) save at this point. + (dolist (func save-some-buffers-functions) + (setq inhibit-message (or (funcall func nil arg) inhibit-message))) + (or queried (> files-done 0) inhibit-message + (cond + ((null autosaved-buffers) + (when (called-interactively-p 'any) + (message "(No files need saving)"))) + ((= (length autosaved-buffers) 1) + (message "(Saved %s)" (car autosaved-buffers))) + (t (message "(Saved %d files: %s)" (length autosaved-buffers) + (mapconcat #'identity autosaved-buffers ", ")))))) + files-done)) + +(advice-add 'save-some-buffers :override #'cj/save-some-buffers) +(keymap-global-set "C-x C-s" #'cj/save-buffer) + (defun cj/diff-buffer-with-file () "Compare the current modified buffer with the saved version. Uses difftastic if available for syntax-aware diffing, otherwise @@ -389,17 +645,27 @@ Signals an error if the buffer is not visiting a file." (insert buffer-content)) ;; Check if there are any differences first (if (zerop (call-process "diff" nil nil nil "-q" file temp-file)) - (message "No differences between buffer and file") - ;; Run diff/difftastic and display in buffer - (let* ((using-difftastic (cj/executable-exists-p "difft")) - (buffer-name (if using-difftastic + (progn (message "No differences between buffer and file") nil) + ;; Pick a renderer: difftastic for content diffs, but a plain unified + ;; diff with trailing whitespace highlighted for whitespace-only ones + ;; (difftastic treats trailing whitespace as no change and hides it). + (let* ((renderer (cj/--diff-buffer-renderer + (cj/--diff-whitespace-only-p file temp-file) + (cj/executable-exists-p "difft"))) + (buffer-name (if (eq renderer 'difftastic) "*Diff (difftastic)*" "*Diff (unified)*")) (diff-buffer (get-buffer-create buffer-name))) - (if using-difftastic + (if (eq renderer 'difftastic) (cj/--diff-with-difftastic file temp-file diff-buffer) - (cj/--diff-with-regular-diff file temp-file diff-buffer)) - (display-buffer diff-buffer)))) + (cj/--diff-with-regular-diff file temp-file diff-buffer) + (when (eq renderer 'whitespace) + (with-current-buffer diff-buffer + (setq-local show-trailing-whitespace t)))) + (display-buffer diff-buffer) + ;; Return the diff buffer so callers (the save prompts) can toggle + ;; and auto-close its window. + diff-buffer))) ;; Clean up temp file (when (file-exists-p temp-file) (delete-file temp-file))))) @@ -546,8 +812,8 @@ Signals an error if: "C-; b m" "move file" "C-; b r" "rename file" "C-; b p" "copy buffer source" - "C-; b d" "delete file" - "C-; b D" "diff buffer with file" + "C-; b d" "diff buffer with file" + "C-; b D" "delete file" "C-; b c" "buffer copy menu" "C-; b c w" "copy whole buffer" "C-; b c b" "copy to bottom" @@ -574,5 +840,14 @@ Signals an error if: "C-; b <down>" "resize divider down")) +;; --- previous-buffer toggle (formerly in custom-misc.el) --- +(defun cj/switch-to-previous-buffer () + "Switch to previously open buffer. +Repeated invocations toggle between the two most recently open buffers." + (interactive) + (switch-to-buffer (other-buffer (current-buffer) 1))) + +(cj/register-command "SPC" #'cj/switch-to-previous-buffer "prev buffer") + (provide 'custom-buffer-file) ;;; custom-buffer-file.el ends here. diff --git a/modules/custom-comments.el b/modules/custom-comments.el index 231a03860..a2604a558 100644 --- a/modules/custom-comments.el +++ b/modules/custom-comments.el @@ -5,62 +5,17 @@ ;; Layer: 2 (Core UX). ;; Category: L/C. ;; Load shape: eager. -;; Eager reason: registers its C-; C comment submap at load. Currently eager by -;; init order; a deferral candidate for Phase 3/4 (command/autoload + -;; registration API). -;; Top-level side effects: defines cj/comment-map, registers it under C-; C. +;; Eager reason: registers C-; C comment helpers. +;; Top-level side effects: defines and registers cj/comment-map. ;; Runtime requires: keybindings. -;; Direct test load: yes (requires keybindings explicitly). +;; Direct test load: yes. ;; -;; This module provides custom comment formatting and manipulation utilities for code editing. -;; -;; Functions include: -;; - deleting all comments in a buffer, -;; - reformatting commented text into single-line paragraphs, -;; - creating centered comment headers with customizable separator characters, -;; - creating comment boxes around text -;; - inserting hyphen-style centered comments. -;; -;; These utilities help create consistent, well-formatted code comments and section headers. -;; Bound to keymap prefix: C-; C -;; -;; Comment Style Patterns: -;; -;; inline-border: -;; ========== inline-border ========== -;; -;; simple-divider: -;; ==================================== -;; simple-divider -;; ==================================== -;; -;; padded-divider: -;; ==================================== -;; padded-divider -;; ==================================== -;; -;; box: -;; ************************************ -;; * box * -;; ************************************ -;; -;; heavy-box: -;; ************************************ -;; * * -;; * heavy-box * -;; * * -;; ************************************ -;; -;; unicode-box: -;; ┌──────────────────────────────────┐ -;; │ unicode-box │ -;; └──────────────────────────────────┘ -;; -;; block-banner: -;; /************************************ -;; * block-banner -;; ************************************/ +;; Comment editing helpers: delete comments, reflow commented regions, and insert +;; consistent section headers or boxes using the current mode's comment syntax. ;; +;; Public commands live under C-; C. Decoration helpers validate single printable +;; characters before generating comment borders. + ;;; Code: (require 'keybindings) ;; provides cj/custom-keymap diff --git a/modules/custom-counts.el b/modules/custom-counts.el new file mode 100644 index 000000000..792732a40 --- /dev/null +++ b/modules/custom-counts.el @@ -0,0 +1,63 @@ +;;; custom-counts.el --- Word and character counts -*- coding: utf-8; lexical-binding: t; -*- + +;;; Commentary: +;; +;; Layer: 2 (Core UX). +;; Category: L. +;; Load shape: eager. +;; Eager reason: registers its C-; # w and C-; # c command bindings at load. +;; Top-level side effects: binds the count commands under C-; # w and C-; # c. +;; Runtime requires: keybindings. +;; Direct test load: yes (requires keybindings explicitly). +;; +;; Count words or characters in the active region, or the whole buffer when no +;; region is active, and report the total in the minibuffer. Split out of the +;; former custom-misc.el grab-bag. + +;;; Code: + +(require 'keybindings) ;; provides cj/register-command + +(defun cj/--count-words (start end) + "Internal implementation: Count words between START and END. +START and END define the region to count. +Returns the word count as an integer." + (when (> start end) + (error "Invalid region: start (%d) is greater than end (%d)" start end)) + (count-words start end)) + +(defun cj/count-words-buffer-or-region () + "Count the number of words in the buffer or region. +Display the result in the minibuffer." + (interactive) + (let* ((use-region (use-region-p)) + (begin (if use-region (region-beginning) (point-min))) + (end (if use-region (region-end) (point-max))) + (area-type (if use-region "the region" "the buffer")) + (word-count (cj/--count-words begin end))) + (message "There are %d words in %s." word-count area-type))) + +(defun cj/--count-characters (start end) + "Internal implementation: Count characters between START and END. +START and END define the region to count. +Returns the character count as an integer." + (when (> start end) + (error "Invalid region: start (%d) is greater than end (%d)" start end)) + (- end start)) + +(defun cj/count-characters-buffer-or-region () + "Count the number of characters in the buffer or region. +Display the result in the minibuffer." + (interactive) + (let* ((use-region (use-region-p)) + (begin (if use-region (region-beginning) (point-min))) + (end (if use-region (region-end) (point-max))) + (area-type (if use-region "the region" "the buffer")) + (char-count (cj/--count-characters begin end))) + (message "There are %d characters in %s." char-count area-type))) + +(cj/register-command "# w" #'cj/count-words-buffer-or-region "count words") +(cj/register-command "# c" #'cj/count-characters-buffer-or-region "count characters") + +(provide 'custom-counts) +;;; custom-counts.el ends here diff --git a/modules/custom-datetime.el b/modules/custom-datetime.el index 6bca494d8..0528688c2 100644 --- a/modules/custom-datetime.el +++ b/modules/custom-datetime.el @@ -1,4 +1,4 @@ -;;; custom-datetime.el --- -*- coding: utf-8; lexical-binding: t; -*- +;;; custom-datetime.el --- Insert formatted date and time strings -*- coding: utf-8; lexical-binding: t; -*- ;;; Commentary: ;; @@ -12,32 +12,8 @@ ;; Runtime requires: keybindings. ;; Direct test load: yes (requires keybindings explicitly). ;; -;; Utilities for inserting date/time stamps in multiple formats. -;; -;; Interactive commands: -;; - cj/insert-readable-date-time -;; - cj/insert-sortable-date-time -;; - cj/insert-sortable-time -;; - cj/insert-readable-time -;; - cj/insert-sortable-date -;; - cj/insert-readable-date -;; -;; Each command is generated by `cj/--define-datetime-inserter' from a -;; corresponding format variable: -;; readable-date-time-format, sortable-date-time-format, -;; sortable-time-format, readable-time-format, -;; sortable-date-format, readable-date-format. -;; Customize these (see `format-time-string') to change output. -;; Some defaults include a trailing space for convenient typing. -;; -;; Key bindings: -;; A prefix map `cj/datetime-map' is installed on "d" under `cj/custom-keymap': -;; r → readable date+time -;; s → sortable date+time -;; t → sortable time -;; T → readable time -;; d → sortable date -;; D → readable date +;; Date/time insertion commands under C-; d. Each command is generated from a +;; customizable format variable and inserts format-time-string output at point. ;; ;;; Code: diff --git a/modules/custom-format.el b/modules/custom-format.el new file mode 100644 index 000000000..47cd7d88d --- /dev/null +++ b/modules/custom-format.el @@ -0,0 +1,46 @@ +;;; custom-format.el --- Region and buffer reformatting -*- coding: utf-8; lexical-binding: t; -*- + +;;; Commentary: +;; +;; Layer: 2 (Core UX). +;; Category: L. +;; Load shape: eager. +;; Eager reason: registers its C-; f command binding at load. +;; Top-level side effects: binds cj/format-region-or-buffer under C-; f. +;; Runtime requires: keybindings. +;; Direct test load: yes (requires keybindings explicitly). +;; +;; Reformat the active region, or the whole buffer when no region is active: +;; untabify, reindent, and delete trailing whitespace. Split out of the +;; former custom-misc.el grab-bag. + +;;; Code: + +(require 'keybindings) ;; provides cj/register-command + +(defun cj/--format-region (start end) + "Internal implementation: Reformat text between START and END. +START and END define the region to operate on. +Replaces tabs with spaces, reindents, and deletes trailing whitespace." + (when (> start end) + (error "Invalid region: start (%d) is greater than end (%d)" start end)) + (save-excursion + (save-restriction + (narrow-to-region start end) + (untabify (point-min) (point-max)) + (indent-region (point-min) (point-max)) + (delete-trailing-whitespace (point-min) (point-max))))) + +(defun cj/format-region-or-buffer () + "Reformat the region or the entire buffer. +Replaces tabs with spaces, deletes trailing whitespace, and reindents." + (interactive) + (let ((start-pos (if (use-region-p) (region-beginning) (point-min))) + (end-pos (if (use-region-p) (region-end) (point-max)))) + (cj/--format-region start-pos end-pos) + (message "Formatted %s" (if (use-region-p) "region" "buffer")))) + +(cj/register-command "f" #'cj/format-region-or-buffer "format buffer") + +(provide 'custom-format) +;;; custom-format.el ends here diff --git a/modules/custom-line-paragraph.el b/modules/custom-line-paragraph.el index 2cbcecc16..d29d4125b 100644 --- a/modules/custom-line-paragraph.el +++ b/modules/custom-line-paragraph.el @@ -1,4 +1,4 @@ -;;; custom-line-paragraph.el --- -*- coding: utf-8; lexical-binding: t; -*- +;;; custom-line-paragraph.el --- Line and paragraph editing commands -*- coding: utf-8; lexical-binding: t; -*- ;; Author: Craig Jennings <c@cjennings.net> ;; ;;; Commentary: @@ -14,16 +14,9 @@ ;; Runtime requires: keybindings (expand-region on demand via declare-function). ;; Direct test load: yes (requires keybindings explicitly). ;; -;; This module provides the following line and paragraph manipulation utilities: -;; -;; - joining lines in a region or the current line with the previous one -;; - joining separate lines into a single paragraph -;; - duplicating lines or regions (optional commenting) -;; - removing duplicate lines -;; - removing lines containing specific text -;; - underlining text with a custom character -;; -;; Bound to keymap prefix C-; l +;; Line and paragraph transforms under C-; l: join, duplicate, delete matching +;; lines, remove duplicates, and underline text. Commands operate on the active +;; region when present and otherwise on the current line or paragraph. ;; ;;; Code: @@ -173,5 +166,36 @@ If the line is empty or contains only whitespace, abort with a message." "C-; l r" "remove matching" "C-; l u" "underscore line")) +;; --- delimiter jump (formerly in custom-misc.el) --- +(defun cj/jump-to-matching-paren () + "Jump to the matching delimiter if point is on (or just after) one. +If not on a delimiter, show a message. Respects the current syntax table." + (interactive) + (let* ((ca (char-after)) + (cb (char-before)) + ;; Check if on opening paren + (open-p (and ca (eq (char-syntax ca) ?\())) + ;; Check if on or just after closing paren + (close-p (or (and ca (eq (char-syntax ca) ?\))) + (and cb (eq (char-syntax cb) ?\)))))) + (cond + ;; Jump forward from opening + (open-p + (condition-case err + (forward-sexp) + (scan-error + (message "No matching delimiter: %s" (error-message-string err))))) + ;; Jump backward from closing + (close-p + (condition-case err + (backward-sexp) + (scan-error + (message "No matching delimiter: %s" (error-message-string err))))) + ;; Not on delimiter + (t + (message "Point is not on a delimiter."))))) + +(cj/register-command ")" #'cj/jump-to-matching-paren "jump to paren") + (provide 'custom-line-paragraph) ;;; custom-line-paragraph.el ends here. diff --git a/modules/custom-misc.el b/modules/custom-misc.el deleted file mode 100644 index 7e5e4f8d6..000000000 --- a/modules/custom-misc.el +++ /dev/null @@ -1,196 +0,0 @@ -;;; custom-misc.el --- Miscellaneous utility functions -*- coding: utf-8; lexical-binding: t; -*- - -;;; Commentary: -;; -;; Layer: 2 (Core UX). -;; Category: L/C. -;; Load shape: eager. -;; Eager reason: registers its C-; command bindings and an align-regexp advice -;; at load. Currently eager by init order; a deferral candidate for Phase 3/4. -;; Top-level side effects: advises align-regexp; binds several commands directly -;; under C-; (")", "f", "A", "SPC", "|", and others). -;; Runtime requires: keybindings. -;; Direct test load: yes (requires keybindings explicitly). -;; -;; This module provides various utility functions for text manipulation, -;; formatting, and navigation. Features include: -;; - Jump between matching delimiters -;; - Format regions/buffers (untabify, reindent, remove trailing whitespace) -;; - Word counting with region awareness -;; - Fraction glyph conversion (¼ ↔ 1/4) -;; - Force align-regexp to use spaces instead of tabs -;; -;; All functions are bound to the cj/custom-keymap for easy access. -;; -;;; Code: - -(require 'keybindings) ;; provides cj/custom-keymap - -(defun cj/jump-to-matching-paren () - "Jump to the matching delimiter if point is on (or just after) one. -If not on a delimiter, show a message. Respects the current syntax table." - (interactive) - (let* ((ca (char-after)) - (cb (char-before)) - ;; Check if on opening paren - (open-p (and ca (eq (char-syntax ca) ?\())) - ;; Check if on or just after closing paren - (close-p (or (and ca (eq (char-syntax ca) ?\))) - (and cb (eq (char-syntax cb) ?\)))))) - (cond - ;; Jump forward from opening - (open-p - (condition-case err - (forward-sexp) - (scan-error - (message "No matching delimiter: %s" (error-message-string err))))) - ;; Jump backward from closing - (close-p - (condition-case err - (backward-sexp) - (scan-error - (message "No matching delimiter: %s" (error-message-string err))))) - ;; Not on delimiter - (t - (message "Point is not on a delimiter."))))) - - -(defun cj/--format-region (start end) - "Internal implementation: Reformat text between START and END. -START and END define the region to operate on. -Replaces tabs with spaces, reindents, and deletes trailing whitespace." - (when (> start end) - (error "Invalid region: start (%d) is greater than end (%d)" start end)) - (save-excursion - (save-restriction - (narrow-to-region start end) - (untabify (point-min) (point-max)) - (indent-region (point-min) (point-max)) - (delete-trailing-whitespace (point-min) (point-max))))) - -(defun cj/format-region-or-buffer () - "Reformat the region or the entire buffer. -Replaces tabs with spaces, deletes trailing whitespace, and reindents." - (interactive) - (let ((start-pos (if (use-region-p) (region-beginning) (point-min))) - (end-pos (if (use-region-p) (region-end) (point-max)))) - (cj/--format-region start-pos end-pos) - (message "Formatted %s" (if (use-region-p) "region" "buffer")))) - -(defun cj/switch-to-previous-buffer () - "Switch to previously open buffer. -Repeated invocations toggle between the two most recently open buffers." - (interactive) - (switch-to-buffer (other-buffer (current-buffer) 1))) - -(defun cj/--count-words (start end) - "Internal implementation: Count words between START and END. -START and END define the region to count. -Returns the word count as an integer." - (when (> start end) - (error "Invalid region: start (%d) is greater than end (%d)" start end)) - (count-words start end)) - -(defun cj/count-words-buffer-or-region () - "Count the number of words in the buffer or region. -Display the result in the minibuffer." - (interactive) - (let* ((use-region (use-region-p)) - (begin (if use-region (region-beginning) (point-min))) - (end (if use-region (region-end) (point-max))) - (area-type (if use-region "the region" "the buffer")) - (word-count (cj/--count-words begin end))) - (message "There are %d words in %s." word-count area-type))) - -(defun cj/--count-characters (start end) - "Internal implementation: Count characters between START and END. -START and END define the region to count. -Returns the character count as an integer." - (when (> start end) - (error "Invalid region: start (%d) is greater than end (%d)" start end)) - (- end start)) - -(defun cj/count-characters-buffer-or-region () - "Count the number of characters in the buffer or region. -Display the result in the minibuffer." - (interactive) - (let* ((use-region (use-region-p)) - (begin (if use-region (region-beginning) (point-min))) - (end (if use-region (region-end) (point-max))) - (area-type (if use-region "the region" "the buffer")) - (char-count (cj/--count-characters begin end))) - (message "There are %d characters in %s." char-count area-type))) - - -(defun cj/--replace-fraction-glyphs (start end to-glyphs) - "Internal implementation: Replace fraction glyphs or text between START and END. -START and END define the region to operate on. -TO-GLYPHS when non-nil converts text (1/4) to glyphs (¼), -otherwise converts glyphs to text." - (when (> start end) - (error "Invalid region: start (%d) is greater than end (%d)" start end)) - (let ((replacements (if to-glyphs - '(("1/4" . "¼") - ("1/2" . "½") - ("3/4" . "¾") - ("1/3" . "⅓") - ("2/3" . "⅔")) - '(("¼" . "1/4") - ("½" . "1/2") - ("¾" . "3/4") - ("⅓" . "1/3") - ("⅔" . "2/3")))) - (count 0) - (end-marker (copy-marker end))) - (save-excursion - (dolist (r replacements) - (goto-char start) - (while (search-forward (car r) end-marker t) - (replace-match (cdr r)) - (setq count (1+ count))))) - count)) - -(defun cj/replace-fraction-glyphs (start end) - "Replace common fraction glyphs between START and END. -Operate on the buffer or region designated by START and END. -Replace the text representations with glyphs when called with a -\\[universal-argument] prefix." - (interactive (if (use-region-p) - (list (region-beginning) (region-end)) - (list (point-min) (point-max)))) - (let ((count (cj/--replace-fraction-glyphs start end current-prefix-arg))) - (message "Replaced %d fraction%s" count (if (= count 1) "" "s")))) - -(defun cj/align-regexp-with-spaces (orig-fun &rest args) - "Call ORIG-FUN with ARGS while temporarily disabling tabs for alignment. -This advice ensures =align-regexp' uses spaces by binding =indent-tabs-mode' -to nil." - (let ((indent-tabs-mode nil)) - (apply orig-fun args))) - -;; avoid double advice stacking in case the file is reloaded -(advice-remove 'align-regexp #'cj/align-regexp-with-spaces) -(advice-add 'align-regexp :around #'cj/align-regexp-with-spaces) - -(cj/register-command ")" #'cj/jump-to-matching-paren) -(cj/register-command "f" #'cj/format-region-or-buffer) -(cj/register-command "# w" #'cj/count-words-buffer-or-region) -(cj/register-command "# c" #'cj/count-characters-buffer-or-region) -(cj/register-command "/" #'cj/replace-fraction-glyphs) -(cj/register-command "A" #'align-regexp) -(cj/register-command "SPC" #'cj/switch-to-previous-buffer) -(cj/register-command "|" #'display-fill-column-indicator-mode) - -(with-eval-after-load 'which-key - (which-key-add-key-based-replacements - "C-; )" "jump to paren" - "C-; f" "format buffer" - "C-; # w" "count words" - "C-; # c" "count characters" - "C-; /" "fraction glyphs" - "C-; A" "align regexp" - "C-; SPC" "prev buffer" - "C-; |" "fill column")) - -(provide 'custom-misc) -;;; custom-misc.el ends here diff --git a/modules/custom-ordering.el b/modules/custom-ordering.el index 0a499a35a..4dc5bff84 100644 --- a/modules/custom-ordering.el +++ b/modules/custom-ordering.el @@ -1,4 +1,4 @@ -;;; custom-ordering.el --- -*- coding: utf-8; lexical-binding: t; -*- +;;; custom-ordering.el --- Region sorting and list-format transforms -*- coding: utf-8; lexical-binding: t; -*- ;;; Commentary: ;; @@ -13,22 +13,10 @@ ;; declare-function). ;; Direct test load: yes (requires keybindings explicitly). ;; -;; Text transformation and sorting utilities for reformatting data structures. +;; Region transforms under C-; o for sorting, reversing, numbering, quote +;; toggling, and converting between line lists and comma-separated arrays. +;; Helpers preserve trailing newlines where line-oriented callers expect them. ;; -;; Array/list formatting: -;; - arrayify/listify - convert lines to comma-separated format (with/without quotes, brackets) -;; - unarrayify - convert arrays back to separate lines -;; -;; Line manipulation: -;; - toggle-quotes - swap double ↔ single quotes -;; - reverse-lines - reverse line order -;; - number-lines - add line numbers with custom format (supports zero-padding) -;; - alphabetize-region - sort words alphabetically -;; - comma-separated-text-to-lines - split CSV text into lines -;; -;; Convenience functions: listify, arrayify-json, arrayify-python -;; Bound to keymap prefix C-; o - ;;; Code: (require 'cl-lib) diff --git a/modules/custom-text-enclose.el b/modules/custom-text-enclose.el index 5b1b00a71..4d72347d1 100644 --- a/modules/custom-text-enclose.el +++ b/modules/custom-text-enclose.el @@ -1,4 +1,4 @@ -;;; custom-text-enclose.el --- -*- coding: utf-8; lexical-binding: t; -*- +;;; custom-text-enclose.el --- Wrap, unwrap, and prefix text ranges -*- coding: utf-8; lexical-binding: t; -*- ;;; Commentary: ;; @@ -12,23 +12,10 @@ ;; Runtime requires: keybindings (change-inner on demand via declare-function). ;; Direct test load: yes (requires keybindings explicitly). ;; -;; Text enclosure utilities for wrapping and line manipulation. +;; Text enclosure commands under C-; s. Commands wrap or unwrap the active +;; region/word at point, and add prefixes, suffixes, indentation, or dedentation +;; across selected lines. ;; -;; Wrapping functions: -;; - surround-word-or-region - wrap text with same delimiter on both sides -;; - wrap-word-or-region - wrap with different opening/closing delimiters -;; - unwrap-word-or-region - remove surrounding delimiters -;; -;; Line manipulation: -;; - append-to-lines - add suffix to each line -;; - prepend-to-lines - add prefix to each line -;; - indent-lines - add leading whitespace (spaces or tabs) -;; - dedent-lines - remove leading whitespace -;; -;; Most functions work on region or entire buffer when no region is active. -;; -;; Bound to keymap prefix C-; s - ;;; Code: (require 'keybindings) ;; provides cj/custom-keymap diff --git a/modules/custom-text-transform.el b/modules/custom-text-transform.el new file mode 100644 index 000000000..537f8df21 --- /dev/null +++ b/modules/custom-text-transform.el @@ -0,0 +1,63 @@ +;;; custom-text-transform.el --- Text glyph transforms -*- coding: utf-8; lexical-binding: t; -*- + +;;; Commentary: +;; +;; Layer: 2 (Core UX). +;; Category: L. +;; Load shape: eager. +;; Eager reason: registers its C-; / command binding at load. +;; Top-level side effects: binds cj/replace-fraction-glyphs under C-; /. +;; Runtime requires: keybindings. +;; Direct test load: yes (requires keybindings explicitly). +;; +;; Convert between text fractions (1/4) and their Unicode glyphs (1/4 becomes +;; the vulgar-fraction character), over the region or whole buffer. Split out +;; of the former custom-misc.el grab-bag. + +;;; Code: + +(require 'keybindings) ;; provides cj/register-command + +(defun cj/--replace-fraction-glyphs (start end to-glyphs) + "Internal implementation: Replace fraction glyphs or text between START and END. +START and END define the region to operate on. +TO-GLYPHS when non-nil converts text (1/4) to glyphs (¼), +otherwise converts glyphs to text." + (when (> start end) + (error "Invalid region: start (%d) is greater than end (%d)" start end)) + (let ((replacements (if to-glyphs + '(("1/4" . "¼") + ("1/2" . "½") + ("3/4" . "¾") + ("1/3" . "⅓") + ("2/3" . "⅔")) + '(("¼" . "1/4") + ("½" . "1/2") + ("¾" . "3/4") + ("⅓" . "1/3") + ("⅔" . "2/3")))) + (count 0) + (end-marker (copy-marker end))) + (save-excursion + (dolist (r replacements) + (goto-char start) + (while (search-forward (car r) end-marker t) + (replace-match (cdr r)) + (setq count (1+ count))))) + count)) + +(defun cj/replace-fraction-glyphs (start end) + "Replace common fraction glyphs between START and END. +Operate on the buffer or region designated by START and END. +Replace the text representations with glyphs when called with a +\\[universal-argument] prefix." + (interactive (if (use-region-p) + (list (region-beginning) (region-end)) + (list (point-min) (point-max)))) + (let ((count (cj/--replace-fraction-glyphs start end current-prefix-arg))) + (message "Replaced %d fraction%s" count (if (= count 1) "" "s")))) + +(cj/register-command "/" #'cj/replace-fraction-glyphs "fraction glyphs") + +(provide 'custom-text-transform) +;;; custom-text-transform.el ends here diff --git a/modules/custom-whitespace.el b/modules/custom-whitespace.el index 0d4d1cc06..52cc4e54d 100644 --- a/modules/custom-whitespace.el +++ b/modules/custom-whitespace.el @@ -1,4 +1,4 @@ -;;; custom-whitespace.el --- -*- coding: utf-8; lexical-binding: t; -*- +;;; custom-whitespace.el --- Whitespace cleanup commands -*- coding: utf-8; lexical-binding: t; -*- ;;; Commentary: ;; @@ -12,19 +12,10 @@ ;; Runtime requires: keybindings. ;; Direct test load: yes (requires keybindings explicitly). ;; -;; This module provides whitespace manipulation operations for cleaning and transforming whitespace in text. - -;; Functions include: - -;; - removing leading and trailing whitespace -;; - collapsing multiple spaces to single spaces -;; - deleting blank lines -;; - converting whitespace to hyphens. - -;; All operations work on the current line, active region, or entire buffer depending on context. - -;; Bound to keymap prefix C-; w - +;; Whitespace cleanup under C-; w: trim line edges, collapse runs of spaces, +;; delete blank lines, enforce a single blank line, and hyphenate whitespace. +;; Commands choose region, buffer, or current line based on prefix/mark state. +;; ;;; Code: (require 'keybindings) ;; provides cj/custom-keymap @@ -237,5 +228,21 @@ Operate on the active region designated by START and END." "C-; w t" "untabify" "C-; w T" "tabify")) +;; --- align-regexp space enforcement + alignment/fill bindings --- +;; (formerly in custom-misc.el) +(defun cj/align-regexp-with-spaces (orig-fun &rest args) + "Call ORIG-FUN with ARGS while temporarily disabling tabs for alignment. +This advice ensures =align-regexp' uses spaces by binding =indent-tabs-mode' +to nil." + (let ((indent-tabs-mode nil)) + (apply orig-fun args))) + +;; avoid double advice stacking in case the file is reloaded +(advice-remove 'align-regexp #'cj/align-regexp-with-spaces) +(advice-add 'align-regexp :around #'cj/align-regexp-with-spaces) + +(cj/register-command "A" #'align-regexp "align regexp") +(cj/register-command "|" #'display-fill-column-indicator-mode "fill column") + (provide 'custom-whitespace) ;;; custom-whitespace.el ends here. diff --git a/modules/dashboard-config.el b/modules/dashboard-config.el index 96aaaf6a1..53f19b72b 100644 --- a/modules/dashboard-config.el +++ b/modules/dashboard-config.el @@ -21,7 +21,7 @@ (eval-when-compile (require 'undead-buffers)) (declare-function cj/make-buffer-undead "undead-buffers" (string)) (autoload 'cj/make-buffer-undead "undead-buffers" nil t) -(declare-function ghostel "ghostel" (&optional arg)) +(declare-function cj/term-toggle "eat-config") ;; ------------------------------ Declarations ------------------------------- ;; These functions and variables belong to lazily-loaded packages or to other @@ -54,6 +54,7 @@ (declare-function nerd-icons-mdicon "nerd-icons") (declare-function nerd-icons-codicon "nerd-icons") (declare-function nerd-icons-octicon "nerd-icons") +(declare-function nerd-icons-wicon "nerd-icons") ;; user-constants.el provides the home-directory constant. (defvar user-home-dir) @@ -137,8 +138,9 @@ Adjust this if the title doesn't appear centered under the banner image.") (list (list "c" #'nerd-icons-faicon "nf-fa-code" "Code" "Switch Project" (lambda () (projectile-switch-project))) (list "d" #'nerd-icons-faicon "nf-fa-folder_o" "Files" "Dirvish File Manager" (lambda () (dirvish user-home-dir))) - (list "t" #'nerd-icons-devicon "nf-dev-terminal" "Terminal" "Launch Terminal" (lambda () (ghostel))) + (list "t" #'nerd-icons-devicon "nf-dev-terminal" "Terminal" "Launch Terminal" (lambda () (cj/term-toggle))) (list "a" #'nerd-icons-mdicon "nf-md-calendar" "Agenda" "Main Org Agenda" (lambda () (cj/main-agenda-display))) + (list "w" #'nerd-icons-wicon "nf-weather-day_sunny_overcast" "Weather" "Wttrin Weather Forecast" (lambda () (call-interactively #'wttrin))) (list "r" #'nerd-icons-faicon "nf-fa-rss_square" "Feeds" "Elfeed Feed Reader" (lambda () (cj/elfeed-open))) (list "b" #'nerd-icons-codicon "nf-cod-library" "Books" "Calibre Ebook Reader" (lambda () (calibredb))) (list "f" #'nerd-icons-mdicon "nf-md-school" "Flashcards" "Org-Drill" (lambda () (cj/drill-start))) @@ -152,9 +154,10 @@ Adjust this if the title doesn't appear centered under the banner image.") "Dashboard launcher table: (KEY ICON-FN ICON-NAME LABEL TOOLTIP ACTION). Drives both `dashboard-navigator-buttons' and the dashboard-mode-map keys.") -(defconst cj/dashboard--row-sizes '(4 4 3 3) +(defconst cj/dashboard--row-sizes '(5 4 3 3) "Navigator row lengths. Must sum to the number of `cj/dashboard--launchers'. -The last row groups Slack, Linear, and Signal together.") +The top row carries Weather alongside the core tools; the last row groups +Slack, Linear, and Signal together.") (defun cj/dashboard--navigator-button (l) "Build a `dashboard-navigator-buttons' entry from launcher L." @@ -272,7 +275,7 @@ system-defaults) are preserved rather than overwritten." (setq initial-buffer-choice (lambda () (get-buffer "*dashboard*")))) ;; don't display dashboard if opening a file (setq dashboard-display-icons-p t) ;; display icons on both GUI and terminal (setq dashboard-icon-type 'nerd-icons) ;; use `nerd-icons' package - (setq dashboard-set-file-icons t) ;; per-filetype icons on the list items (nerd-icons colors them by type) + (setq dashboard-set-file-icons nil) ;; no per-item icons on the list entries: URL bookmarks have no filename, so they'd render iconless next to file items -- dropping them all keeps the lists uniform (setq dashboard-set-heading-icons t) ;; nerd-icons on the section titles (Projects/Bookmarks/Recent) (setq dashboard-center-content t) ;; horizontally center dashboard content (setq dashboard-bookmarks-show-path nil) ;; don't show paths in bookmarks diff --git a/modules/dev-fkeys.el b/modules/dev-fkeys.el index 9fdfa5b3f..80b43600b 100644 --- a/modules/dev-fkeys.el +++ b/modules/dev-fkeys.el @@ -5,48 +5,17 @@ ;; Layer: 2 (Core UX). ;; Category: C. ;; Load shape: eager. -;; Eager reason: the F4/F6 developer command entry points. -;; Top-level side effects: six global F-key bindings; conditionally registers a -;; C-; P binding. +;; Eager reason: binds the F4/F6 developer command entry points. +;; Top-level side effects: global F-key bindings and optional C-; P binding. ;; Runtime requires: cl-lib, system-lib, keybindings. -;; Direct test load: yes (requires keybindings explicitly). +;; Direct test load: yes. ;; -;; Project-aware F-key block for developer workflows: +;; Project-aware F-key dispatchers. F4 chooses compile/run/clean commands by +;; project markers; C-F4 and M-F4 are fast paths. F6 runs all project tests or +;; the current file's tests using language-specific command builders. ;; -;; F4 completing-read of compile/run candidates filtered by project type -;; C-F4 fast path: compile only (no-op on interpreted projects) -;; M-F4 fast path: clean + rebuild (no-op on interpreted projects) -;; S-F4 recompile (built-in) -;; F6 completing-read of test candidates: All tests / Current file's tests -;; C-F6 fast path: current file's tests -;; -;; F4 project-type detection runs against the projectile root and falls back -;; to \\='unknown when no marker matches. Interpreted markers are checked -;; before compiled markers, so a Python or Node project that also has a -;; Makefile for tasks classifies as interpreted. -;; -;; F6 \"All tests\" delegates to `projectile-test-project'. F6 \"Current -;; file's tests\" detects the language by extension, derives the runner -;; command (elisp via the project Makefile, Python via pytest, Go via the -;; package), and pipes through `compile' from the projectile root. -;; TypeScript / JavaScript are detected but punted for v1 — the function -;; signals a user-error rather than guessing a runner. -;; -;; M-F6 is reserved for Phase 2b (\"Run a test...\" menu entry with -;; per-language test-name discovery). Phase 2b also adds buffer-local -;; last-test memory and tree-sitter-based discovery for Python / Go / -;; TypeScript. The tree-sitter discovery uses a capture-then-filter pattern -;; (queries without `:match' / `:equal' / `:pred' predicates, with the -;; pattern filter applied in Elisp) to sidestep Emacs bug #79687 — Emacs -;; 30.2 emits unsuffixed `#match' predicates that libtree-sitter 0.26 -;; rejects. The fix lives on Emacs master (commit b0143530) and is -;; targeted at Emacs 31; it has not been backported to the emacs-30 -;; branch as of 2026-05-03. See Mike Olson's writeup at -;; https://mwolson.org/blog/emacs/2026-04-20-fixing-typescript-ts-mode-in-emacs-30-2/ -;; for the same workaround applied to font-lock. -;; -;; F7 (coverage) is wired in coverage-core.el. F5 is reserved for the debug -;; ticket and intentionally left unbound here. +;; Interpreted markers win over compiled markers so task Makefiles do not turn +;; Python/Node projects into compile-first projects. ;;; Code: diff --git a/modules/dirvish-config.el b/modules/dirvish-config.el index 81d352dbd..713a5e69b 100644 --- a/modules/dirvish-config.el +++ b/modules/dirvish-config.el @@ -17,8 +17,8 @@ ;; ediff, playlist creation, path copying, and external file manager integration. ;; ;; Key Bindings: -;; - d: Delete marked files (dired-do-delete) -;; - D: Duplicate file at point (adds "-copy" before extension) +;; - d: Diff/ediff selected files (cj/dired-ediff-files) +;; - D: Delete (dired-do-delete; mark with m for batches) ;; - g: Quick access menu (jump to predefined directories) ;; - G: Search with deadgrep in current directory ;; - f: Open system file manager in current directory @@ -194,7 +194,9 @@ Filters for audio files, prompts for the playlist name, and saves the resulting (:map dired-mode-map ([remap dired-summary] . which-key-show-major-mode) ("E" . wdired-change-to-wdired-mode) ;; edit names and properties in buffer - ("e" . cj/dired-ediff-files)) ;; ediff files + ("e" . cj/dired-ediff-files) ;; ediff files + ("d" . cj/dired-ediff-files) ;; d = diff, matching C-; b / ibuffer (was dired-flag-file-deletion) + ("D" . dired-do-delete)) ;; D = delete (d no longer flags; mark with m, then D) :custom (dired-use-ls-dired nil) ;; non GNU FreeBSD doesn't support a "--dired" switch :config @@ -205,6 +207,13 @@ Filters for audio files, prompts for the playlist name, and saves the resulting (setq dired-recursive-copies (quote always)) ;; "always" means no asking (setq dired-recursive-deletes (quote top))) ;; "top" means ask once +;; which-key labels for the d=diff / D=delete pair (shown in the major-mode +;; popup via `which-key-show-major-mode'). +(with-eval-after-load 'which-key + (which-key-add-major-mode-key-based-replacements 'dired-mode + "d" "diff (ediff files)" + "D" "delete file")) + ;; note: disabled as it prevents marking and moving files to another directory ;; (setq dired-kill-when-opening-new-dired-buffer t) ;; don't litter by leaving buffers when navigating directories @@ -438,7 +447,7 @@ Uses feh on X11, the `set-wallpaper' script on Wayland." ;; at home. `q' in that frame runs `cj/dirvish-popup-quit', which quits Dirvish ;; and deletes the popup frame so a stray launch never orphans it; `q' in any ;; other frame quits Dirvish normally. The launcher script calls this command -;; instead of plain `dirvish'. This mirrors the Super+Shift+N quick-capture +;; instead of plain `dirvish'. This mirrors the Super+N quick-capture ;; popup (see `cj/quick-capture' in org-capture-config.el). (defun cj/--dirvish-popup-frame () diff --git a/modules/dwim-shell-config.el b/modules/dwim-shell-config.el index 014194c7b..e8790a489 100644 --- a/modules/dwim-shell-config.el +++ b/modules/dwim-shell-config.el @@ -1,99 +1,23 @@ -;; dwim-shell-config.el --- Dired Shell Commands -*- coding: utf-8; lexical-binding: t; -*- +;;; dwim-shell-config.el --- Dired shell command menu -*- coding: utf-8; lexical-binding: t; -*- ;; ;;; Commentary: ;; ;; Layer: 3 (Domain Workflow). ;; Category: D/P. ;; Load shape: eager. -;; Eager reason: none; Dired/Dirvish shell commands, a command-loaded deferral -;; candidate. +;; Eager reason: none; Dired/Dirvish shell commands can load by command. ;; Top-level side effects: package configuration via use-package. -;; Runtime requires: cl-lib. +;; Runtime requires: cl-lib, system-lib. ;; Direct test load: yes. ;; -;; This module provides a collection of DWIM (Do What I Mean) shell commands -;; for common file operations in Dired and other buffers. It leverages the -;; `dwim-shell-command' package to execute shell commands on marked files -;; with smart templating and progress tracking. -;; -;; Features: -;; - Audio/Video conversion (mp3, opus, webp, HEVC) -;; - Image manipulation (resize, flip, format conversion) -;; - PDF operations (merge, split, password protection, OCR) -;; - Archive management (zip/unzip) -;; - Document conversion (epub to org, docx to pdf, pdf to txt) -;; - Git operations (clone from clipboard) -;; - External file opening with context awareness -;; -;; Workflow: -;; 1. *Mark files in Dired/Dirvish* -;; - Use =m= to mark individual files -;; - Use =* .= to mark by extension -;; - Use =% m= to mark by regexp -;; - Or operate on the file under cursor if nothing is marked -;; -;; 2. *Execute a DWIM command* -;; - Call the command via =M-x dwim-shell-commands-[command-name]= -;; - Or bind frequently used commands to keys -;; -;; 3. *Command execution* -;; - The command runs asynchronously in the background -;; - A =*Async Shell Command*= buffer shows progress -;; - Files are processed with smart templating (replacing =<<f>>=, =<<fne>>=, etc.) -;; -;; 4. *Results* -;; - New files appear in the Dired/Dirvish buffer -;; - Buffer auto-refreshes when command completes -;; - Errors appear in the async buffer if something fails -;; -;; Requirements: -;; The commands rely on various external utilities that need to be installed: -;; - ffmpeg: Audio/video conversion -;; - imagemagick (convert): Image manipulation -;; - qpdf: PDF operations (requires version 8.x+ for secure password handling) -;; - tesseract: OCR functionality -;; - pandoc: Document conversion -;; - atool: Archive extraction -;; - rsvg-convert: SVG to PNG conversion -;; - pdftotext: PDF text extraction -;; - git: Version control operations -;; - gpgconf: GPG agent management -;; - 7z (p7zip): Secure password-protected archives -;; -;; On Arch Linux, install the requirements with: -;; #+begin_src bash -;; sudo pacman -S --needed ffmpeg imagemagick qpdf tesseract tesseract-data-eng pandoc atool librsvg poppler git gnupg p7zip zip unzip mkvtoolnix-cli mpv ruby -;; #+end_src -;; -;; On MacOS, install the requirements with: -;; #+begin_src bash -;; brew install ffmpeg imagemagick qpdf tesseract pandoc atool librsvg poppler gnupg p7zip mkvtoolnix mpv -;; #+end_src -;; -;; Usage: -;; Commands operate on marked files in Dired or the current file in other modes. -;; The package automatically replaces standard shell commands with DWIM versions -;; for a more intuitive experience. -;; -;; Security: -;; Password-protected operations (PDF encryption, archive encryption) use secure -;; methods to avoid exposing passwords in process lists or command history: -;; - PDF operations: Use temporary files with restrictive permissions (mode 600) -;; - Archive operations: Use 7z instead of zip for better password handling -;; - Temporary password files are automatically cleaned up after use -;; - Note: Switched from zip to 7z for encryption due to zip's insecure -P flag -;; -;; Template Variables: -;; - <<f>>: Full path to file -;; - <<fne>>: File name without extension -;; - <<e>>: File extension -;; - <<b>>: Base name (file name with extension, no directory) -;; - <<d>>: Directory path -;; - <<n>>: Sequential number (for batch renaming) -;; - <<td>>: Temporary directory -;; - <<cb>>: Clipboard contents -;; - <<*>>: All marked files +;; Configures dwim-shell-command actions for marked Dired/Dirvish files: +;; media conversion, archive/PDF/document operations, external opening, and a +;; curated transient menu. Commands use dwim-shell templates for marked files or +;; the current buffer file. ;; +;; Password-bearing operations avoid command-line secrets by writing temporary +;; password files with restrictive permissions and deleting them from the process +;; sentinel after the spawned command exits. ;;; Code: diff --git a/modules/eat-config.el b/modules/eat-config.el new file mode 100644 index 000000000..1de24dc4f --- /dev/null +++ b/modules/eat-config.el @@ -0,0 +1,531 @@ +;;; eat-config.el --- EAT terminal emulator and the F12 eshell toggle -*- lexical-binding: t; coding: utf-8; -*- + +;;; Commentary: +;; +;; EAT (Emulate A Terminal, pure elisp) is the terminal emulator. Because EAT +;; renders entirely in elisp, its whole palette is real Emacs faces, so it themes +;; from the theme. This module owns the eat package configuration, the keymap +;; wiring that lets F12 and C-; reach Emacs from inside a terminal, and the F12 +;; dock-and-remember toggle. +;; +;; F12 opens eshell, which runs through EAT (eat-eshell-mode, set up in +;; eshell-config.el): the shell is eshell -- elisp functions as commands, TRAMP +;; transparency -- and EAT renders its visual commands. eshell-config.el holds +;; the shell itself; this module holds the emulator and the toggle. +;; +;; The toggle reuses the geometry-preservation pattern from cj-window-toggle-lib: +;; capture direction + body size at toggle-off, replay them via a custom display +;; action using frame-edge directions and body-relative sizes, so the docked +;; terminal returns at the same size and the result is divider-independent. + +;;; Code: + +(require 'keybindings) +(require 'system-lib) +(require 'cj-window-geometry-lib) +(require 'cj-window-toggle-lib) + +(declare-function eat "eat" (&optional program arg)) +(declare-function eshell "eshell" (&optional arg)) +(declare-function cj/dashboard-only "dashboard-config") +(defvar eat-mode-map) +(defvar eat-semi-char-mode-map) +(defvar eshell-buffer-name) +(defvar cj/custom-keymap) + +;; EAT paints its palette with manual `face' text properties (the ANSI colors). +;; Left in `global-font-lock-mode', the terminal buffer also gets syntactic +;; fontification -- a "..." in program output becomes `font-lock-string-face', +;; overriding the foreground EAT painted (e.g. green-on-green inside a diff) -- +;; so exclude eat-mode, the same reason dashboard and mu4e are excluded. A +;; mode-hook can't do this: `global-font-lock-mode' runs after the mode hook. +(cj/exclude-from-global-font-lock 'eat-mode) + +(defun cj/turn-off-chrome-for-term () + "Turn off line numbers and hl-line in a terminal buffer." + (hl-line-mode -1) + (display-line-numbers-mode -1)) + +(defun cj/--eat-tame-scroll () + "Reduce the viewport bounce from full-frame inline redraws (Claude Code). +Such programs move the terminal cursor up to redraw their whole block and back +to the bottom on every tick; EAT follows the cursor with point, so the window +chases it. Line-scroll minimally instead of recentering, drop the scroll +margin, and disable auto vscroll, so the window follows with the smallest +movement. It cannot fully remove the bounce -- the inline redraw is the root -- +but it makes each jump gentler." + (setq-local scroll-conservatively 101) + (setq-local scroll-margin 0) + (setq-local auto-window-vscroll nil)) + +(defcustom cj/eat-reset-sgr-at-newline t + "When non-nil, EAT resets SGR (color) at each newline. +Claude Code and similar inline TUIs sometimes truncate a colored span without +emitting a reset; the unterminated color then bleeds onto every following line +in the buffer. Injecting a reset before each newline contains it to its own +line. Safe for the common case where programs re-open their color per line; a +program that carries a single color across newlines without re-opening it would +lose that color past the first line, so set this to nil if you hit that." + :type 'boolean + :group 'eat) + +(declare-function eat-term-process-output "eat") + +(defun cj/--eat-reset-sgr-at-newline (args) + "`:filter-args' advice for `eat-term-process-output'. +When `cj/eat-reset-sgr-at-newline' is non-nil, inject an SGR reset before each +newline in the pty OUTPUT so an unterminated color cannot bleed past its line. +ARGS is (TERMINAL OUTPUT)." + (if cj/eat-reset-sgr-at-newline + (list (car args) + (replace-regexp-in-string "\n" "\e[0m\n" (cadr args) t t)) + args)) + +(advice-add 'eat-term-process-output :filter-args #'cj/--eat-reset-sgr-at-newline) + +;; ------------------------------- eat package --------------------------------- + +(use-package eat + :ensure t + :commands (eat) + :hook ((eat-mode . cj/turn-off-chrome-for-term) + (eat-mode . cj/--eat-tame-scroll)) + :custom + ;; Close the EAT buffer when its shell exits. + (eat-kill-buffer-on-exit t) + ;; Shell-integration UX. These are EAT defaults, set explicitly to document + ;; intent and survive default changes. They only light up once the shell + ;; sources EAT's integration script -- see the EAT block in the zsh rc. + (eat-enable-directory-tracking t) ; Emacs follows the terminal's cwd + (eat-enable-shell-prompt-annotation t) ; the success/running/failure prompt glyphs + (eat-enable-shell-command-history t) ; terminal history into EAT line-mode isearch + ;; Interaction. + (eat-enable-mouse t) ; mouse clicks + selection in TUIs (default) + (eat-enable-kill-from-terminal t) ; terminal selection -> Emacs kill-ring (default) + (eat-enable-yank-to-terminal t) ; Emacs kill-ring -> the terminal (off by default) + ;; Fidelity. + (eat-enable-alternative-display t) ; alt-screen so TUIs restore scrollback on exit (default) + (eat-term-scrollback-size (* 10 1024 1024)) ; ~10MB of scrollback, matching the old ghostel + ;; Truecolor is already on: eat-term-name auto-selects the compiled eat-truecolor terminfo. + ;; Niceties. + (eat-sixel-render-formats '(xpm svg half-block background none)) ; inline images (on by default) + (eat-query-before-killing-running-terminal 'auto) ; confirm before killing a terminal with a live process + :config + ;; F1, F12, and C-; must reach Emacs from inside EAT. In semi-char mode + ;; (EAT's default) EAT forwards unbound keys to the terminal -- a letter runs + ;; `eat-self-input' -- so bind these explicitly or they never reach Emacs: + ;; F1 runs the kill-all sweep back to the dashboard (`cj/dashboard-only', + ;; which buries agent buffers rather than killing them), F12 toggles the + ;; terminal window, C-; opens the global prefix map. Unlike ghostel, EAT + ;; needs no exception-list or keymap rebuild -- the bind alone suffices. + (keymap-set eat-semi-char-mode-map "<f1>" #'cj/dashboard-only) + (keymap-set eat-semi-char-mode-map "<f12>" #'cj/term-toggle) + (keymap-set eat-semi-char-mode-map "C-;" cj/custom-keymap) + (keymap-set eat-mode-map "<f1>" #'cj/dashboard-only) + (keymap-set eat-mode-map "<f12>" #'cj/term-toggle) + (keymap-set eat-mode-map "C-;" cj/custom-keymap)) + +;; ----------------------- F12 toggle (custom) ----------------------- +;; +;; Mirrors the geometry-preservation pattern shared with ai-term.el: capture +;; direction + body size at toggle-off, replay them via a custom display action +;; using frame-edge directions and body-relative sizes so the result is +;; divider-independent and layout-stable. Manages the EAT terminal only; +;; ai-term.el's agent buffers are separate (M-SPC). + +(defcustom cj/term-toggle-window-height 0.7 + "Default fraction of frame height for the F12 terminal window. +Used as the size fallback when F12 docks the terminal as a bottom split." + :type 'number + :group 'term) + +(defcustom cj/term-toggle-window-width 0.5 + "Default fraction of frame width for the F12 terminal window. +Used as the size fallback when F12 docks the terminal as a right-side +column (see `cj/--term-toggle-default-direction')." + :type 'number + :group 'term) + +(defun cj/--term-toggle-default-direction () + "Return the default dock direction for the F12 terminal: `right' or `below'. +Docks as a right-side column only when a side-by-side split would leave +both panes at least `cj/window-dock-min-columns' wide (the terminal's +share is `cj/term-toggle-window-width'); otherwise stacks below. See +`cj/preferred-dock-direction'." + (cj/preferred-dock-direction (frame-width) cj/term-toggle-window-width)) + +(defun cj/--term-toggle-default-size (direction) + "Return the default size fraction paired with DIRECTION for the F12 terminal. +`cj/term-toggle-window-width' for `right', `cj/term-toggle-window-height' +otherwise." + (if (eq direction 'right) + cj/term-toggle-window-width + cj/term-toggle-window-height)) + +(defvar cj/--term-toggle-last-direction nil + "Last user-chosen direction for the F12 terminal display. +Symbol: right, left, or below. `above' is never stored. nil means use the +default `below' for F12's traditional bottom split.") + +(defvar cj/--term-toggle-last-size nil + "Last user-chosen size for the F12 terminal display. +Positive integer: body-cols (right/left) or total-lines (below/above) -- see +`cj/window-replay-size' for why the vertical axis uses total, not body. +nil means fall back to `cj/term-toggle-window-height' as a fraction.") + +(defun cj/--term-toggle-buffer-p (buffer) + "Return non-nil when BUFFER is an eshell terminal F12 should manage. + +F12 opens eshell, which runs through EAT via eat-eshell-mode. ai-term's +agent buffers are managed separately via M-SPC, not F12." + (and (bufferp buffer) + (buffer-live-p buffer) + (with-current-buffer buffer + (derived-mode-p 'eshell-mode)))) + +(defun cj/--term-toggle-buffers () + "Return live F12-managed terminal buffers in `buffer-list' (MRU) order." + (seq-filter #'cj/--term-toggle-buffer-p (buffer-list))) + +(defun cj/--term-toggle-displayed-window (&optional frame) + "Return a window in FRAME currently displaying an F12 terminal buffer, or nil. +FRAME defaults to the selected frame. Minibuffer is excluded." + (seq-find (lambda (w) + (cj/--term-toggle-buffer-p (window-buffer w))) + (window-list (or frame (selected-frame)) 'never))) + +(defun cj/--term-toggle-capture-state (window) + "Capture WINDOW's direction + body size into module-level state. +The default direction (used when WINDOW fills its frame) is the +column-rule choice from `cj/--term-toggle-default-direction'." + (cj/window-toggle-capture-state + window (cj/--term-toggle-default-direction) + 'cj/--term-toggle-last-direction + 'cj/--term-toggle-last-size + '(right below left))) + +(defun cj/--term-toggle-display-saved (buffer alist) + "Display-buffer action: split per saved direction and body size. +Delegates to `cj/window-toggle-display-saved' against the F12 state vars, +falling back to the column-rule default direction +\(`cj/--term-toggle-default-direction') and its paired size." + (let ((dir (cj/--term-toggle-default-direction))) + (cj/window-toggle-display-saved + buffer alist + 'cj/--term-toggle-last-direction dir + 'cj/--term-toggle-last-size (cj/--term-toggle-default-size dir)))) + +(defun cj/--term-toggle-display-rule-list () + "Return the `display-buffer-alist' entry list installed by F12. +Routes any terminal buffer satisfying `cj/--term-toggle-buffer-p' through +reuse-window then the saved-geometry action. Excludes agent buffers." + '(((lambda (buffer-or-name _) + (cj/--term-toggle-buffer-p (get-buffer buffer-or-name))) + (display-buffer-reuse-window + cj/--term-toggle-display-saved) + (inhibit-same-window . t)))) + +(dolist (entry (cj/--term-toggle-display-rule-list)) + (add-to-list 'display-buffer-alist entry)) + +(defun cj/--term-toggle-dispatch () + "Compute the F12 (`cj/term-toggle') action without performing it. + +Returns one of: +- (toggle-off . WINDOW) -- terminal displayed in WINDOW; hide it. +- (show-recent . BUFFER) -- terminal alive but not shown; redisplay. +- (create-new) -- no terminal buffer alive; create one." + (let ((win (cj/--term-toggle-displayed-window))) + (cond + (win (cons 'toggle-off win)) + (t + (let ((buffers (cj/--term-toggle-buffers))) + (cond + (buffers (cons 'show-recent (car buffers))) + (t '(create-new)))))))) + +(defun cj/term-toggle () + "Toggle the F12 eshell terminal (the primary `*eshell*', run through EAT). + +- If it is displayed in this frame, capture its geometry and delete its window + (toggle off). Falls back to burying when it is the only window in the frame. +- Otherwise, if it is alive, display it via the saved-geometry action. +- Otherwise, open eshell, displaying it through the same saved-geometry action. + +eshell runs through EAT via eat-eshell-mode, so visual commands render in a real +terminal. ai-term's agent buffers are managed separately via M-SPC." + (interactive) + (pcase (cj/--term-toggle-dispatch) + (`(toggle-off . ,win) + (cj/--term-toggle-capture-state win) + (if (one-window-p) + (bury-buffer (window-buffer win)) + (delete-window win)) + nil) + (`(show-recent . ,buf) + (display-buffer buf) + (let ((w (get-buffer-window buf))) + (when w (select-window w))) + buf) + (`(create-new) + ;; Open the primary eshell without stealing the layout, then display it + ;; through the saved-geometry dock rule (same path as show-recent). + (save-window-excursion (eshell)) + (let ((buf (get-buffer (or (bound-and-true-p eshell-buffer-name) "*eshell*")))) + (when buf + (display-buffer buf) + (let ((w (get-buffer-window buf))) + (when w (select-window w)))) + buf)))) + +(keymap-global-set "<f12>" #'cj/term-toggle) + +;; ------------------- terminal copy mode + tmux history ----------------------- +;; Carried over from the ghostel era for the EAT agent terminals (ai-term). +;; Agents run EAT over tmux, so copy-mode is tmux's own copy-mode -- the same UX +;; ghostel-over-tmux had. C-<up> enters it and scrolls up in one stroke; C-; x c +;; enters it via the menu, and C-; x h grabs the whole pane history into a buffer. + +(declare-function cj/register-prefix-map "keybindings") +(declare-function eat-emacs-mode "eat") +(defvar eat--semi-char-mode) +(defvar eat--char-mode) +(defvar eat--line-mode) + +(defun cj/--term-send-string (string) + "Send STRING to the current terminal buffer's process (the pty)." + (let ((proc (get-buffer-process (current-buffer)))) + (when (process-live-p proc) + (process-send-string proc string)))) + +(defun cj/term-send-escape () + "Send ESC to the terminal. +In tmux copy-mode this cancels it (tmux binds Escape to cancel); in a TUI like +vim it forwards ESC normally. EAT's semi-char mode leaves the bare escape key +unbound and treats `ESC' only as the Meta prefix, so without this the key never +reaches the pty -- which is why C-<up>'s tmux copy-mode could not be exited with +Escape." + (interactive) + (cj/--term-send-string "\e")) + +(defun cj/term-backward-kill-word () + "Delete the previous word in the terminal program's input line. +Sends M-DEL (ESC DEL) to the pty, which readline and most line editors map to +backward-kill-word -- the same word-boundary delete C-<backspace> does in normal +Emacs buffers (it stops at punctuation). EAT's default forwards C-<backspace> as +a bare key the program ignores, so the word never gets deleted; sending the +escape sequence the program actually understands is what makes the key work." + (interactive) + (cj/--term-send-string "\e\d")) + +(defun cj/term--tmux-output (&rest args) + "Run tmux with ARGS and return its stdout. +Signal `user-error' when tmux exits with a non-zero status." + (with-temp-buffer + (let ((exit-code (apply #'process-file "tmux" nil t nil args))) + (unless (zerop exit-code) + (user-error "tmux failed: %s" (string-trim (buffer-string)))) + (buffer-string)))) + +(defun cj/term--tmux-pane-id-for-tty (tty) + "Return the tmux pane id for client TTY." + (let* ((output (cj/term--tmux-output + "list-clients" "-F" "#{client_tty}\t#{pane_id}")) + (lines (split-string output "\n" t)) + (match (seq-find + (lambda (line) + (let ((fields (split-string line "\t"))) + (equal (car fields) tty))) + lines))) + (unless match + (user-error "No tmux client found for terminal tty %s" tty)) + (cadr (split-string match "\t")))) + +(defun cj/term--tmux-capture-pane (pane-id) + "Return full joined tmux history for PANE-ID." + (cj/term--tmux-output + "capture-pane" "-p" "-J" "-S" "-" "-E" "-" "-t" pane-id)) + +(defun cj/term--current-tmux-pane-id () + "Return the tmux pane id for the current EAT terminal buffer." + (unless (derived-mode-p 'eat-mode) + (user-error "Current buffer is not an EAT terminal")) + (let* ((proc (get-buffer-process (current-buffer))) + (tty (and proc (process-tty-name proc)))) + (unless (and tty (not (string-empty-p tty))) + (user-error "Could not determine terminal tty")) + (cj/term--tmux-pane-id-for-tty tty))) + +(defvar-local cj/term-tmux-history--origin-buffer nil + "Buffer active before opening the tmux history buffer.") +(defvar-local cj/term-tmux-history--origin-window nil + "Window active before opening the tmux history buffer.") +(defvar-local cj/term-tmux-history--origin-point nil + "Point in the origin buffer before opening the tmux history buffer.") + +(defun cj/term-tmux-history-quit () + "Quit tmux history and return to its origin buffer." + (interactive) + (let ((history-buffer (current-buffer)) + (origin-buffer cj/term-tmux-history--origin-buffer) + (origin-window cj/term-tmux-history--origin-window) + (origin-point cj/term-tmux-history--origin-point)) + (when (buffer-live-p origin-buffer) + (if (window-live-p origin-window) + (progn + (set-window-buffer origin-window origin-buffer) + (select-window origin-window)) + (pop-to-buffer origin-buffer)) + (with-current-buffer origin-buffer + (when (integer-or-marker-p origin-point) + (goto-char origin-point)))) + (when (buffer-live-p history-buffer) + (kill-buffer history-buffer)))) + +(defvar-keymap cj/term-tmux-history-mode-map + :doc "Keymap for `cj/term-tmux-history-mode'. +M-w copies the active region without leaving the buffer; C-g, <escape>, or q +returns to the terminal without copying. RET is left unbound." + "M-w" #'kill-ring-save + "C-g" #'cj/term-tmux-history-quit + "<escape>" #'cj/term-tmux-history-quit + "q" #'cj/term-tmux-history-quit) + +(define-derived-mode cj/term-tmux-history-mode special-mode "Tmux History" + "Mode for copying captured tmux pane history with normal Emacs keys." + (setq-local truncate-lines t) + (goto-address-mode 1)) + +(defun cj/term-tmux-history () + "Open full tmux pane history in a temporary Emacs buffer. + +The history buffer uses normal Emacs navigation and selection. `M-w' copies +the active region and stays open, so several pieces can be copied in a row; +`q', `<escape>', or `C-g' returns point to the terminal buffer that launched +it. The history view replaces the origin terminal buffer in the same window." + (interactive) + (let* ((origin-buffer (current-buffer)) + (origin-window (selected-window)) + (origin-point (point)) + (pane-id (cj/term--current-tmux-pane-id)) + (history (cj/term--tmux-capture-pane pane-id)) + (buffer (get-buffer-create + (format "*terminal tmux history: %s*" (buffer-name origin-buffer))))) + (with-current-buffer buffer + (let ((inhibit-read-only t)) + (erase-buffer) + (insert history)) + (cj/term-tmux-history-mode) + (setq-local cj/term-tmux-history--origin-buffer origin-buffer) + (setq-local cj/term-tmux-history--origin-window origin-window) + (setq-local cj/term-tmux-history--origin-point origin-point) + (goto-char (point-max))) + (switch-to-buffer buffer))) + +(defun cj/term--in-tmux-p () + "Return non-nil when the current EAT buffer has a tmux client attached. +Lookup errors (not eat-mode, no tty, no client, tmux absent) are treated as +nil so callers can use this as a cheap boolean predicate." + (and (derived-mode-p 'eat-mode) + (condition-case _ + (and (cj/term--current-tmux-pane-id) t) + (error nil)))) + +(defun cj/--term-in-emacs-mode-p () + "Return non-nil when the current EAT buffer is in emacs (navigation) mode. +EAT has no dedicated emacs-mode flag; emacs mode is the absence of the +semi-char, char, and line input modes." + (and (derived-mode-p 'eat-mode) + (not (or (bound-and-true-p eat--semi-char-mode) + (bound-and-true-p eat--char-mode) + (bound-and-true-p eat--line-mode))))) + +(defun cj/term-copy-mode-dwim () + "Enter copy-mode using the engine appropriate to this terminal. + +When tmux is attached (an agent terminal), write tmux's prefix sequence (C-b [) +into the pty so the user lands in tmux's copy-mode with the full pane history, +then C-a to land the cursor at column 0 so scrolling up runs up the left edge. +Without tmux, falls through to EAT's emacs mode (a navigable view of the +scrollback) and moves point to the start of the line." + (interactive) + (if (cj/term--in-tmux-p) + (cj/--term-send-string "\C-b[\C-a") + (eat-emacs-mode) + (beginning-of-line))) + +(defun cj/term--tmux-pane-in-copy-mode-p (pane-id) + "Return non-nil when tmux PANE-ID is currently displaying a mode. +tmux's `pane_in_mode' is 1 while a pane is in any mode; copy-mode is the only +mode this config enters. tmux failures are treated as nil." + (condition-case nil + (equal "1" (string-trim + (cj/term--tmux-output + "display-message" "-p" "-t" pane-id "#{pane_in_mode}"))) + (error nil))) + +(defun cj/term-copy-mode-up () + "Enter copy-mode if needed, then scroll up one line. +A single C-<up> lands in the terminal's copy-mode already moving up. Pressed +again while already in copy-mode it just moves up another line, so it never +re-enters and resets the cursor. In tmux, writes the up-arrow escape into the +pty; without tmux, moves point up in EAT's emacs-mode buffer." + (interactive) + (let ((pane (ignore-errors (cj/term--current-tmux-pane-id)))) + (cond + (pane + (unless (cj/term--tmux-pane-in-copy-mode-p pane) + (cj/term-copy-mode-dwim)) + (cj/--term-send-string "\e[A")) + (t + (unless (cj/--term-in-emacs-mode-p) + (cj/term-copy-mode-dwim)) + (forward-line -1))))) + +;; The C-; x terminal prefix (copy-mode, tmux history, the F12 toggle). C-<up> +;; enters copy-mode + scrolls in one stroke; bound in EAT's semi-char map so it +;; reaches Emacs from inside an agent terminal. +(defvar-keymap cj/term-map + :doc "Personal terminal command map.") +(cj/register-prefix-map "x" cj/term-map) +(keymap-set cj/term-map "c" #'cj/term-copy-mode-dwim) +(keymap-set cj/term-map "h" #'cj/term-tmux-history) +(keymap-set cj/term-map "t" #'cj/term-toggle) + +(defvar eat-mode-map) +(declare-function eat-semi-char-mode "eat") +(declare-function eat-self-input "eat") + +(defun cj/eat-text-scale-reset () + "Reset the text scale to its default in the current buffer." + (interactive) + (text-scale-set 0)) + +(with-eval-after-load 'eat + (keymap-set eat-semi-char-mode-map "C-<up>" #'cj/term-copy-mode-up) + ;; Zoom-out and reset reach Emacs, not the pty. EAT binds C-- to + ;; eat-self-input (forwarded to the terminal), so without this the font can + ;; only grow: C-= / C-+ pass through and zoom in, but C-- never reaches + ;; text-scale-decrease. Low cost -- the Claude TUI and tmux don't use Ctrl+-, + ;; and C-0 shadows digit-argument inside eat buffers only. + (keymap-set eat-semi-char-mode-map "C--" #'text-scale-decrease) + (keymap-set eat-semi-char-mode-map "C-0" #'cj/eat-text-scale-reset) + ;; Escape forwards ESC to the pty, so it cancels tmux copy-mode (tmux binds + ;; Escape to cancel) and works in TUIs; in EAT's own emacs/char mode it returns + ;; to semi-char. One key gets out of either copy view. + (keymap-set eat-semi-char-mode-map "<escape>" #'cj/term-send-escape) + (keymap-set eat-mode-map "<escape>" #'eat-semi-char-mode) + ;; Ctrl+Backspace deletes the previous word, matching its behavior in normal + ;; buffers. Terminals send no standard code for it, so EAT's default forwards + ;; a bare key the program drops; send M-DEL instead (readline backward-kill-word). + (keymap-set eat-semi-char-mode-map "C-<backspace>" #'cj/term-backward-kill-word) + ;; Word-motion arrows edit the terminal program's input (claude, readline), so + ;; forward them to the pty. EAT's default leaves them in the non-bound-keys + ;; list, which moved Emacs point instead and desynced it from the real cursor + ;; (point jumped back on the next keystroke). Window arrows (S-, C-M-) keep + ;; reaching Emacs for windmove / buffer-move. + (dolist (key '("C-<left>" "C-<right>" "M-<left>" "M-<right>")) + (keymap-set eat-semi-char-mode-map key #'eat-self-input))) + +(provide 'eat-config) +;;; eat-config.el ends here diff --git a/modules/elfeed-config.el b/modules/elfeed-config.el index 7b4d7d745..dbc7e4a4b 100644 --- a/modules/elfeed-config.el +++ b/modules/elfeed-config.el @@ -1,4 +1,4 @@ -;;; elfeed-config --- Settings and Enhancements to the Elfeed RSS Feed Reader -*- lexical-binding: t; coding: utf-8; -*- +;;; elfeed-config.el --- Settings and Enhancements to the Elfeed RSS Feed Reader -*- lexical-binding: t; coding: utf-8; -*- ;; author Craig Jennings <c@cjennings.net> ;; ;;; Commentary: @@ -41,6 +41,13 @@ (declare-function eww-browse-url "eww") (declare-function eww-readable "eww") +;; elfeed paints its search and entry buffers with manual `face' text properties +;; (the date, title, feed, and tag faces the theme styles). Left in +;; `global-font-lock-mode', font-lock overwrites those with syntactic string +;; fontification, so the buffer loses the theme colors. Exclude both modes, the +;; same reason dashboard and mu4e are excluded. +(cj/exclude-from-global-font-lock 'elfeed-search-mode 'elfeed-show-mode) + ;; ------------------------------- Elfeed Config ------------------------------- (use-package elfeed @@ -65,11 +72,26 @@ ;; Pivot with Kara Swisher and Scott Galloway ("https://www.youtube.com/feeds/videos.xml?channel_id=UCBHGZpDF2fsqPIPi0pNyuTg" yt pivot) + ;; Platypus Economics with Justin Wolfers + ("https://www.youtube.com/feeds/videos.xml?channel_id=UCB5eaPWEwR6wR2MxRx64s0g" yt platypus) + + ;; Conversations with Tyler (Tyler Cowen) + ("https://www.youtube.com/feeds/videos.xml?channel_id=UC_AnpBvnhXTcipgGEHLWoOg" yt cwt) + + ;; Plain English with Derek Thompson + ("https://www.youtube.com/feeds/videos.xml?channel_id=UCoOUW7SiXzLbc_O3nSDOBYA" yt plain-english) + + ;; Odd Lots (Bloomberg) -- Joe Weisenthal & Tracy Alloway + ("https://www.youtube.com/feeds/videos.xml?playlist_id=PLe4PRejZgr0MuA6M0zkZyy-99-qc87wKV" yt oddlots) + + ;; All-In Podcast + ("https://www.youtube.com/feeds/videos.xml?channel_id=UCESLZhusAkFfsNsApnjF_Cg" yt allin) + ;; The Prof G Pod ("https://www.youtube.com/feeds/videos.xml?playlist_id=PLtQ-jBytlXCasRuBG86m22rOQfrEPcctq" yt profg) ;; On with Kara Swisher - ("https://www.youtube.com/feeds/videos.xml?playlist_id=PLKof9YSAshgxI6odrEJFKsJbxamwoQBju" yt) + ("https://www.youtube.com/feeds/videos.xml?playlist_id=PLKof9YSAshgxI6odrEJFKsJbxamwoQBju" yt on) ;; Raging Moderates ("https://www.youtube.com/feeds/videos.xml?channel_id=UCcvDWzvxz6Kn1iPQHMl2teA" yt raging-moderates) @@ -81,7 +103,7 @@ ("https://www.youtube.com/feeds/videos.xml?playlist_id=PL45Mc1cDgnsB-u1iLPBYNF1fk-y1cVzTJ" yt trae) ;; Tropical Tidbits - ("https://www.youtube.com/feeds/videos.xml?channel_id=UCrFIk7g_riIm2G2Vi90pxDA" yt) + ("https://www.youtube.com/feeds/videos.xml?channel_id=UCrFIk7g_riIm2G2Vi90pxDA" yt tropical) ;; If You're Listening | ABC News In-depth ("https://www.youtube.com/feeds/videos.xml?playlist_id=PLDTPrMoGHssAfgMMS3L5LpLNFMNp1U_Nq" yt listening) diff --git a/modules/erc-config.el b/modules/erc-config.el index 3e98a66a3..57d4eb567 100644 --- a/modules/erc-config.el +++ b/modules/erc-config.el @@ -1,4 +1,4 @@ -;;; erc-config --- Preferences for Emacs Relay Chat (IRC Client) -*- lexical-binding: t; coding: utf-8; -*- +;;; erc-config.el --- Preferences for Emacs Relay Chat (IRC Client) -*- lexical-binding: t; coding: utf-8; -*- ;; author Craig Jennings <c@cjennings.net> ;; ;;; Commentary: @@ -140,6 +140,8 @@ Change this value to use a different nickname.") server-buffers)) +(require 'system-lib) + (defun cj/erc-switch-to-buffer-with-completion () "Switch to an ERC buffer using completion. If no ERC buffers exist, prompt to connect to a server. @@ -148,7 +150,7 @@ Buffer names are shown with server context for clarity." (let* ((erc-buffers (erc-buffer-list)) (buffer-names (mapcar #'buffer-name erc-buffers))) (if buffer-names - (let ((selected (completing-read "Switch to ERC buffer: " buffer-names nil t))) + (let ((selected (completing-read "Switch to ERC buffer: " (cj/completion-table 'buffer buffer-names) nil t))) (switch-to-buffer selected)) (message "No ERC buffers found.") (when (y-or-n-p "Connect to an IRC server? ") diff --git a/modules/eshell-config.el b/modules/eshell-config.el index c2ec6d152..7379795d2 100644 --- a/modules/eshell-config.el +++ b/modules/eshell-config.el @@ -51,6 +51,9 @@ (declare-function eshell-send-input "esh-mode") (declare-function eshell/pwd "em-dirs") (declare-function eshell/alias "em-alias") +(declare-function eshell/cd "em-dirs") +(declare-function eshell-stringify "esh-util") +(declare-function eat-eshell-mode "eat") (defgroup cj/eshell nil "Personal Eshell configuration." @@ -83,6 +86,59 @@ pairs where COMMAND is the `cd' string `eshell/alias' should run." (dolist (pair (cj/--eshell-ssh-alias-commands hosts)) (eshell/alias (car pair) (cdr pair)))) +;; ---------------------------- prompt segments -------------------------------- + +(defun cj/--eshell-git-branch () + "Return the current git branch for `default-directory', or nil. +Reads .git/HEAD directly so it adds no subprocess per prompt, and skips remote +directories so a TRAMP prompt stays fast." + (unless (file-remote-p default-directory) + (when-let* ((root (locate-dominating-file default-directory ".git")) + (head (expand-file-name ".git/HEAD" root))) + (when (file-readable-p head) + (with-temp-buffer + (insert-file-contents head) + (when (looking-at "ref: refs/heads/\\(.*\\)") + (string-trim (match-string 1)))))))) + +(defun cj/--eshell-prompt-status-segment () + "Return the eshell prompt's exit-status segment, or an empty string. +Shows the last command's exit code in brackets when it was non-zero, mirroring +the zsh prompt's failure indicator." + (let ((status (bound-and-true-p eshell-last-command-status))) + (if (or (null status) (zerop status)) + "" + (format " [%d]" status)))) + +;; ------------------------------- zoxide -------------------------------------- +;; Share the same frecency database as the zsh shell by calling the zoxide +;; binary: `z' jumps to a remembered directory, and every eshell directory +;; change feeds `zoxide add' so eshell visits accrue in the same database. + +(defun eshell/z (&rest args) + "Jump to a directory via zoxide, sharing the zsh zoxide database. +With no ARGS, cd home. Otherwise query zoxide for the best match and cd there." + (if (null args) + (eshell/cd) + (let ((dir (string-trim + (shell-command-to-string + (concat "zoxide query -- " + (mapconcat #'shell-quote-argument + (mapcar #'eshell-stringify args) " ")))))) + (if (and (not (string-empty-p dir)) (file-directory-p dir)) + (eshell/cd dir) + (error "zoxide: no match for %s" + (string-join (mapcar #'eshell-stringify args) " ")))))) + +(defun cj/--eshell-zoxide-add () + "Record `default-directory' in the zoxide database (skips remote dirs)." + (when (and (not (file-remote-p default-directory)) + (executable-find "zoxide")) + (call-process "zoxide" nil 0 nil "add" "--" + (expand-file-name default-directory)))) + +(add-hook 'eshell-directory-change-hook #'cj/--eshell-zoxide-add) + (use-package eshell :ensure nil ;; built-in :commands (eshell) @@ -108,6 +164,9 @@ pairs where COMMAND is the `cd' string `eshell/alias' should run." (propertize (system-name) 'face 'default) ":" (propertize (abbreviate-file-name (eshell/pwd)) 'face 'default) + (let ((branch (cj/--eshell-git-branch))) + (if branch (propertize (concat " (" branch ")") 'face 'default) "")) + (propertize (cj/--eshell-prompt-status-segment) 'face 'default) "\n" (propertize "%" 'face 'default) " "))) @@ -179,35 +238,20 @@ pairs where COMMAND is the `cd' string `eshell/alias' should run." (delete-window))) (advice-add 'eshell-life-is-too-much :after 'cj/eshell-delete-window-on-exit) -(use-package eshell-toggle - :custom - (eshell-toggle-size-fraction 2) - (eshell-toggle-run-command nil) - (eshell-toggle-init-function #'eshell-toggle-init-eshell) - :bind - ("C-<f12>" . eshell-toggle)) +;; Run eshell's external commands through EAT (a real terminal): visual commands +;; (vim, htop, less) render properly and ANSI output is faithful, while eshell +;; stays the shell -- elisp functions as commands + TRAMP transparency. EAT +;; handles color itself, so it supersedes xterm-color for eshell; the +;; xterm-color block below stays for now and steps aside if colors double up. +(with-eval-after-load 'esh-mode + (require 'eat) + (eat-eshell-mode 1)) -(use-package xterm-color - :after eshell - ;; Two hooks. eshell-before-prompt is the real hook name; use-package appends - ;; "-hook", so writing eshell-before-prompt-hook here registered on a - ;; nonexistent eshell-before-prompt-hook-hook and never ran. The eshell-mode - ;; hook scopes TERM=xterm-256color to eshell-spawned processes only (a global - ;; setenv would leak it to every start-process regardless of terminal). - :hook - ((eshell-before-prompt . (lambda () - (setq xterm-color-preserve-properties t))) - (eshell-mode . (lambda () - (setq-local process-environment - (cons "TERM=xterm-256color" - process-environment))))) - :config - ;; Wire xterm-color into eshell's output pipeline (per its README): install - ;; the filter and drop eshell's own ANSI handler. Without this the escapes are - ;; never interpreted and TERM=xterm-256color only leaks raw codes. - (add-to-list 'eshell-preoutput-filter-functions 'xterm-color-filter) - (setq eshell-output-filter-functions - (remove 'eshell-handle-ansi-color eshell-output-filter-functions))) +;; eshell-toggle and xterm-color are retired. F12 opens eshell now (the +;; dock-and-remember toggle in eat-config.el), and eat-eshell-mode renders +;; eshell's output through EAT, which handles ANSI color natively -- so +;; xterm-color's filter and its TERM=xterm-256color override are redundant and +;; would fight EAT's own TERM=eat-truecolor. (use-package eshell-syntax-highlighting :after esh-mode diff --git a/modules/eww-config.el b/modules/eww-config.el index ff7ddc211..0ddebfe4f 100644 --- a/modules/eww-config.el +++ b/modules/eww-config.el @@ -1,4 +1,4 @@ -;;; eww-config --- EWW Text Browser Settings -*- lexical-binding: t; coding: utf-8; -*- +;;; eww-config.el --- EWW Text Browser Settings -*- lexical-binding: t; coding: utf-8; -*- ;; author Craig Jennings <c@cjennings.net> ;; ;;; Commentary: @@ -73,6 +73,12 @@ ;; --------------------------------- EWW Config -------------------------------- +(require 'system-lib) +;; eww renders pages with shr, which paints with manual `face' properties. Left +;; in `global-font-lock-mode' font-lock overwrites them and the page loses its +;; colors, the same issue as elfeed-show and mu4e-view. Exclude eww-mode. +(cj/exclude-from-global-font-lock 'eww-mode) + (use-package eww :ensure nil ;; built-in :bind diff --git a/modules/external-open.el b/modules/external-open.el index 22e56a290..811c32c28 100644 --- a/modules/external-open.el +++ b/modules/external-open.el @@ -42,15 +42,33 @@ "Open certain files with the OS default handler." :group 'files) -(defcustom default-open-extensions - '( - ;; Video - "\\.3g2\\'" "\\.3gp\\'" "\\.asf\\'" "\\.avi\\'" "\\.divx\\'" "\\.dv\\'" +(defcustom cj/video-extensions + '("\\.3g2\\'" "\\.3gp\\'" "\\.asf\\'" "\\.avi\\'" "\\.divx\\'" "\\.dv\\'" "\\.f4v\\'" "\\.flv\\'" "\\.m1v\\'" "\\.m2ts\\'" "\\.m2v\\'" "\\.m4v\\'" "\\.mkv\\'" "\\.mov\\'" "\\.mpe\\'" "\\.mpeg\\'" "\\.mpg\\'" "\\.mp4\\'" "\\.mts\\'" "\\.ogv\\'" "\\.rm\\'" "\\.rmvb\\'" "\\.vob\\'" - "\\.webm\\'" "\\.wmv\\'" + "\\.webm\\'" "\\.wmv\\'") + "Regexps matching video files opened in a looping player. +These route through `cj/open-video-looping' (mpv --loop-file=inf by default) +instead of the OS default handler, so a video opened from dirvish plays on +repeat." + :type '(repeat (regexp :tag "Video extension regexp")) + :group 'external-open) + +(defcustom cj/video-open-command "mpv" + "Player command used to open local video files on repeat. +Launched detached from Emacs with `cj/video-open-args' before the file name." + :type 'string + :group 'external-open) + +(defcustom cj/video-open-args '("--loop-file=inf") + "Arguments passed to `cj/video-open-command' before the file name. +Defaults to mpv's infinite single-file loop so the video plays on repeat." + :type '(repeat string) + :group 'external-open) +(defcustom default-open-extensions + '( ;; Audio "\\.aac\\'" "\\.ac3\\'" "\\.aif\\'" "\\.aifc\\'" "\\.aiff\\'" "\\.alac\\'" "\\.amr\\'" "\\.ape\\'" "\\.caf\\'" @@ -142,18 +160,49 @@ Logs output and exit code to buffer *external-open.log*." nil 0))))) +;; -------------------------- Open Videos On Repeat ---------------------------- + +(defun cj/--video-file-p (file) + "Return non-nil when FILE matches a regexp in `cj/video-extensions'." + (and (stringp file) + (let ((case-fold-search t)) + (cl-some (lambda (re) (string-match-p re file)) cj/video-extensions)))) + +(defun cj/--video-open-arglist (file) + "Return the argument list to play FILE on repeat: `cj/video-open-args' + FILE." + (append cj/video-open-args (list file))) + +(defun cj/open-video-looping (&optional filename) + "Open FILENAME (or the file at point) in a looping video player, detached. +Uses `cj/video-open-command' and `cj/video-open-args' (mpv --loop-file=inf by +default) so the video plays on repeat. Launched asynchronously so it never +blocks Emacs." + (interactive) + (let* ((file (expand-file-name + (or (cj/file-from-context filename) + (user-error "No file associated with this buffer")))) + (args (cj/--video-open-arglist file))) + (if (env-windows-p) + (w32-shell-execute "open" cj/video-open-command + (mapconcat (lambda (a) (format "\"%s\"" a)) args " ")) + (apply #'call-process cj/video-open-command nil 0 nil args)))) + ;; -------------------- Open Files With Default File Handler ------------------- (defun cj/find-file-auto (orig-fun &rest args) - "If file has an extension in `default-open-extensions', open externally. -Else call ORIG-FUN with ARGS." + "Open FILE externally based on its extension, else call ORIG-FUN with ARGS. +A video (`cj/video-extensions') opens in a looping player; any other extension +in `default-open-extensions' opens with the OS default handler." (let* ((file (car args)) (case-fold-search t)) - (if (and (stringp file) - (cl-some (lambda (re) (string-match-p re file)) - default-open-extensions)) - (cj/xdg-open file) - (apply orig-fun args)))) + (cond + ((cj/--video-file-p file) + (cj/open-video-looping file)) + ((and (stringp file) + (cl-some (lambda (re) (string-match-p re file)) + default-open-extensions)) + (cj/xdg-open file)) + (t (apply orig-fun args))))) (defun cj/external-open-install-advice () "Install the `cj/find-file-auto' advice on `find-file'. diff --git a/modules/face-diagnostic.el b/modules/face-diagnostic.el index a2bfe2483..6f0722099 100644 --- a/modules/face-diagnostic.el +++ b/modules/face-diagnostic.el @@ -36,7 +36,7 @@ Return one of `theme-faced', `terminal-ansi', `document-shr', or best-effort dump rather than a full provenance trace." (with-current-buffer (or buffer (current-buffer)) (cond - ((derived-mode-p 'term-mode 'comint-mode 'eshell-mode 'ghostel-mode) + ((derived-mode-p 'term-mode 'comint-mode 'eshell-mode 'eat-mode) 'terminal-ansi) ((derived-mode-p 'eww-mode 'nov-mode 'elfeed-show-mode 'mu4e-view-mode) 'document-shr) diff --git a/modules/flycheck-config.el b/modules/flycheck-config.el index 1afd3ae6c..2a5a5e74f 100644 --- a/modules/flycheck-config.el +++ b/modules/flycheck-config.el @@ -1,4 +1,4 @@ -;;; flycheck-config --- Syntax/Grammar Check -*- lexical-binding: t; coding: utf-8; -*- +;;; flycheck-config.el --- Syntax/Grammar Check -*- lexical-binding: t; coding: utf-8; -*- ;; author Craig Jennings <c@cjennings.net> ;;; Commentary: @@ -6,40 +6,17 @@ ;; Layer: 2 (Core UX). ;; Category: C/P. ;; Load shape: eager. -;; Eager reason: general linting setup; spec target is hook-loaded, a deferral -;; candidate. -;; Top-level side effects: package configuration via use-package, binds into -;; cj/custom-keymap through use-package :map. +;; Eager reason: linting keymap and mode hooks; could become hook-loaded. +;; Top-level side effects: package config and C-; ? binding. ;; Runtime requires: keybindings. -;; Direct test load: yes (requires keybindings explicitly). +;; Direct test load: yes. ;; -;; This file configures Flycheck for on-demand syntax and grammar checking. -;; - Flycheck starts automatically only in sh-mode and emacs-lisp-mode - -;; - This binds a custom helper (=cj/flycheck-list-errors=) to "C-; ?" -;; for popping up Flycheck's error list in another window. - -;; - It also customizes Checkdoc to suppress only the "sentence-end-double-space" -;; and "warn-escape" warnings. - -;; - It registers LanguageTool for comprehensive grammar checking of prose files -;; (text-mode, markdown-mode, gfm-mode, org-mode). - -;; Note: Grammar checking is on-demand only to avoid performance issues. -;; Hitting "C-; ?" runs cj/flycheck-prose-on-demand if in an org buffer. - -;; The cj/flycheck-prose-on-demand function: -;; - Turns on flycheck for the local buffer -;; - Enables LanguageTool checker -;; - Triggers an immediate check -;; - Displays errors in the *Flycheck errors* buffer - -;; Installation: -;; On Arch Linux: -;; sudo pacman -S languagetool +;; Flycheck configuration for automatic shell/Elisp linting and on-demand prose +;; grammar checks. C-; ? opens the Flycheck error list, enabling prose checking +;; first when appropriate. ;; -;; The wrapper script at scripts/languagetool-flycheck formats LanguageTool's -;; JSON output into flycheck-compatible format. It requires Python 3. +;; LanguageTool uses scripts/languagetool-flycheck to adapt JSON output to +;; Flycheck's checker protocol. ;;; Code: diff --git a/modules/flyspell-and-abbrev.el b/modules/flyspell-and-abbrev.el index 376a9dc51..b73bfdf32 100644 --- a/modules/flyspell-and-abbrev.el +++ b/modules/flyspell-and-abbrev.el @@ -6,48 +6,18 @@ ;; Layer: 2 (Core UX). ;; Category: C/P. ;; Load shape: eager. -;; Eager reason: text-mode spelling and abbrev hooks; spec target is hook-loaded. -;; Top-level side effects: package configuration via use-package (mode hooks). +;; Eager reason: text-mode spelling and abbrev hooks. +;; Top-level side effects: package configuration via use-package. ;; Runtime requires: cl-lib. ;; Direct test load: yes. ;; -;; WORKFLOW: -;; This module provides intelligent spell checking with automatic abbreviation -;; creation to prevent repeated misspellings. +;; On-demand Flyspell workflow with automatic abbrev creation from accepted +;; corrections. C-' checks/corrects nearby misspellings; C-c f toggles Flyspell +;; with mode-aware behavior. ;; -;; KEYBINDINGS: -;; C-' - Main spell check interface (cj/flyspell-then-abbrev) -;; C-c f - Toggle flyspell on/off (cj/flyspell-toggle) -;; M-o - Access 'other options' during correction (save to dictionary, etc.) -;; -;; SPELL CHECKING WORKFLOW: -;; 1. Press C-' to start spell checking -;; 2. Finds the nearest misspelled word above the cursor -;; 3. Prompts for correction or allows saving to personal dictionary -;; 4. Press C-' again to move to the next misspelling -;; 5. Each correction automatically creates an abbrev for future auto-expansion -;; -;; FLYSPELL ACTIVATION: -;; Flyspell is NOT automatically enabled. You activate it manually: -;; - C-c f - Toggle flyspell on (uses smart mode detection) or off -;; - C-' - Runs flyspell-buffer then starts correction workflow -;; -;; When enabled, flyspell adapts to the buffer type: -;; - Programming modes (prog-mode): Only checks comments and strings -;; - Text modes (text-mode): Checks all text -;; - Other modes: Must enable manually with C-c f -;; -;; ABBREVIATION AUTO-EXPANSION: -;; Each spell correction creates an abbrev that auto-expands the misspelling -;; to the correct spelling when you type it in the future. This significantly -;; increases typing speed over time. -;; -;; Original idea from Artur Malabarba: -;; http://endlessparentheses.com/ispell-and-abbrev-the-perfect-auto-correct.html -;; -;; NOTES: -;; The default flyspell keybinding "C-;" is unbound in this config as it's -;; used for the custom keymap (cj/custom-keymap). +;; Flyspell is not enabled globally. Programming buffers check comments/strings +;; when enabled; prose buffers check all text. The default C-; Flyspell binding +;; is intentionally left free for cj/custom-keymap. ;;; Code: diff --git a/modules/font-config.el b/modules/font-config.el index 3272a946e..3aa3d80f6 100644 --- a/modules/font-config.el +++ b/modules/font-config.el @@ -1,4 +1,4 @@ -;;; font-config --- Font Defaults and Related Functionality -*- lexical-binding: t; coding: utf-8; -*- +;;; font-config.el --- Font Defaults and Related Functionality -*- lexical-binding: t; coding: utf-8; -*- ;; author: Craig Jennings <c@cjennings.net> ;;; Commentary: @@ -6,51 +6,18 @@ ;; Layer: 2 (Core UX). ;; Category: C/P/S. ;; Load shape: eager. -;; Eager reason: font setup for the first frame, plus font keybindings. -;; Top-level side effects: binds five global font keys, runs font-installation -;; checks, configures packages via use-package. +;; Eager reason: first-frame font setup and font keybindings. +;; Top-level side effects: font keys, font checks, package config. ;; Runtime requires: host-environment, keybindings. ;; Direct test load: yes. ;; -;; This module provides font configuration, including: -;; -;; 1. Font Management: -;; - Dynamic font preset switching via `fontaine' package -;; - Separate configurations for fixed-pitch and variable-pitch fonts -;; - Multiple size presets for different viewing contexts -;; - Per-frame font configuration tracking for daemon mode compatibility -;; -;; 2. Icon Support: -;; - All-the-icons integration with automatic font installation -;; - Nerd fonts support for enhanced icons in terminals and GUI -;; - Platform-specific emoji font configuration (Noto, Apple, Segoe) -;; - Emojify package for emoji rendering and insertion -;; -;; 3. Typography Enhancements: -;; - Programming ligatures via `ligature' package -;; - Mode-specific ligature rules for markdown and programming -;; - Text scaling keybindings for quick size adjustments -;; -;; 4. Utility Functions: -;; - `cj/font-installed-p': Check font availability -;; - `cj/display-available-fonts': Interactive font browser with samples -;; - Frame-aware font application for client/server setups -;; -;; Configuration Notes: -;; - Default preset: BerkeleyMono Nerd Font; height 120 on laptops, 140 on desktops -;; - Variable pitch: Lexend in the default preset; Merriweather for fallback presets -;; - Handles both standalone and daemon mode Emacs instances -;; - Emoji fonts selected based on OS availability -;; -;; Keybindings: -;; - M-S-f: Select font preset (fontaine-set-preset) -;; - C-z F: Display available fonts -;; - C-+/C-=: Increase text scale -;; - C--/C-_: Decrease text scale -;; - C-c E i: Insert emoji -;; - C-c E l: List emojis -;; +;; Configures fontaine presets, text scaling keys, icon/emoji fonts, and +;; programming ligatures. Presets are applied per frame so daemon clients get +;; the intended fixed/variable pitch sizes. ;; +;; Also carries font-rendering safeguards for known HarfBuzz/font-cache crashes +;; triggered by emoji and Arabic shaping in this setup. + ;;; Code: (require 'host-environment) @@ -96,7 +63,7 @@ (default :default-family "BerkeleyMono Nerd Font" :default-weight regular - :default-height ,(if (env-laptop-p) 120 140) + :default-height ,(if (env-laptop-p) 130 140) :fixed-pitch-family nil ;; falls back to :default-family :fixed-pitch-weight nil ;; falls back to :default-weight :fixed-pitch-height 1.0 @@ -116,11 +83,6 @@ (FiraCode-Literata :default-family "Fira Code Nerd Font" :variable-pitch-family "Literata") - (EBook - :default-family "Lexend" - :default-weight regular - :default-height 200 - :variable-pitch-family "Lexend") (24-point-font :default-height 240) (20-point-font @@ -198,35 +160,29 @@ If FRAME is nil, uses the selected frame." t nil)) -;; ------------------------------- All The Icons ------------------------------- -;; icons made available through fonts +;; ------------------------------- Nerd Icons fonts ---------------------------- +;; nerd-icons (configured in nerd-icons-config.el) renders glyphs from the +;; "Symbols Nerd Font Mono" font. Auto-install it on the first GUI frame when +;; it is missing -- the same convenience the dropped all-the-icons setup gave. -(declare-function all-the-icons-install-fonts "all-the-icons") +(declare-function nerd-icons-install-fonts "nerd-icons") -(defun cj/maybe-install-all-the-icons-fonts (&optional _frame) - "Install all-the-icons fonts if needed and we have a GUI." +(defun cj/maybe-install-nerd-icons-fonts (&optional _frame) + "Install the nerd-icons font if it is missing and we have a GUI." (when (and (env-gui-p) - (not (cj/font-installed-p "all-the-icons"))) - (all-the-icons-install-fonts t) + (not (cj/font-installed-p "Symbols Nerd Font Mono"))) + (nerd-icons-install-fonts t) ;; Remove this hook after successful installation - (remove-hook 'server-after-make-frame-hook #'cj/maybe-install-all-the-icons-fonts))) + (remove-hook 'server-after-make-frame-hook #'cj/maybe-install-nerd-icons-fonts))) -(use-package all-the-icons - :demand t - :config - ;; Handle both daemon and non-daemon modes +;; nerd-icons loads after this module (see init.el order), so defer the wiring +;; until it is present. Daemon: install on the first GUI frame; otherwise now. +(with-eval-after-load 'nerd-icons (if (daemonp) - (add-hook 'server-after-make-frame-hook #'cj/maybe-install-all-the-icons-fonts) - (cj/maybe-install-all-the-icons-fonts))) - -(use-package all-the-icons-nerd-fonts - :after all-the-icons - :demand t - :config - (all-the-icons-nerd-fonts-prefer)) + (add-hook 'server-after-make-frame-hook #'cj/maybe-install-nerd-icons-fonts) + (cj/maybe-install-nerd-icons-fonts))) ;; ----------------------------- Emoji Fonts Per OS ---------------------------- -;; Set emoji fonts in priority order (first found wins) (defun cj/setup-emoji-fontset (&optional _frame) "Set emoji fonts in priority order (first found wins). diff --git a/modules/help-config.el b/modules/help-config.el index f8431aef2..114b264ed 100644 --- a/modules/help-config.el +++ b/modules/help-config.el @@ -1,4 +1,4 @@ -;;; help-config --- Help Functionality Configuration -*- lexical-binding: t; coding: utf-8; -*- +;;; help-config.el --- Help Functionality Configuration -*- lexical-binding: t; coding: utf-8; -*- ;; author Craig Jennings <c@cjennings.net> ;;; Commentary: @@ -9,7 +9,7 @@ ;; Eager reason: help/info/man configuration and its keybindings; eager only by ;; init order, a deferral candidate. ;; Top-level side effects: two global keys, package configuration via use-package. -;; Runtime requires: none. +;; Runtime requires: system-lib. ;; Direct test load: yes. ;; ;; This module enhances Emacs' built-in help system and documentation features. @@ -25,6 +25,7 @@ ;;; Code: +(require 'system-lib) ;; completion table + file annotator (setq help-window-select t) ;; Always select the help buffer in a separate window @@ -90,7 +91,11 @@ Preserves any unsaved changes and checks if the file exists." info-files)) (chosen-name (completing-read "Select Info file: " - (mapcar #'car files-alist) + (cj/completion-table-annotated + 'cj-info-file + (cj/completion-file-annotator + (lambda (c) (cdr (assoc c files-alist)))) + (mapcar #'car files-alist)) nil t)) (chosen-file (cdr (assoc chosen-name files-alist)))) (when chosen-file diff --git a/modules/help-utils.el b/modules/help-utils.el index 3e31efffe..9792841a3 100644 --- a/modules/help-utils.el +++ b/modules/help-utils.el @@ -1,4 +1,4 @@ -;;; help-utils --- Help Integrations and Searches -*- lexical-binding: t; coding: utf-8; -*- +;;; help-utils.el --- Help Integrations and Searches -*- lexical-binding: t; coding: utf-8; -*- ;; author Craig Jennings <c@cjennings.net> ;; ;;; Commentary: diff --git a/modules/httpd-config.el b/modules/httpd-config.el index 60baf7e82..1a2a5c611 100644 --- a/modules/httpd-config.el +++ b/modules/httpd-config.el @@ -1,4 +1,4 @@ -;;; httpd-config --- Setup for a Simple HTTP Server -*- lexical-binding: t; coding: utf-8; -*- +;;; httpd-config.el --- Setup for a Simple HTTP Server -*- lexical-binding: t; coding: utf-8; -*- ;; author Craig Jennings <c@cjennings.net> ;;; Commentary: diff --git a/modules/hugo-config.el b/modules/hugo-config.el index 7afa45a7b..b26398c69 100644 --- a/modules/hugo-config.el +++ b/modules/hugo-config.el @@ -9,7 +9,7 @@ ;; Eager reason: none; blog publishing is a command-loaded deferral candidate ;; for Phase 4. ;; Top-level side effects: package configuration via use-package. -;; Runtime requires: user-constants, host-environment. +;; Runtime requires: user-constants, host-environment, system-lib. ;; Direct test load: yes. ;; ;; Integrates ox-hugo for publishing Org files to a Hugo website. @@ -27,6 +27,7 @@ (require 'user-constants) (require 'host-environment) +(require 'system-lib) ;; completion table + file annotator ;; --------------------------------- Constants --------------------------------- @@ -166,7 +167,12 @@ Switches #+hugo_draft between true and false." (if (null drafts) (message "No drafts found in %s" cj/hugo-content-org-dir) (let ((choice (completing-read "Open draft: " - (mapcar #'car drafts) nil t))) + (cj/completion-table-annotated + 'cj-hugo-draft + (cj/completion-file-annotator + (lambda (c) (cdr (assoc c drafts)))) + (mapcar #'car drafts)) + nil t))) (find-file (cdr (assoc choice drafts))))))) ;; ---------------------------- Preview and Publish ---------------------------- diff --git a/modules/jumper.el b/modules/jumper.el index 3dc00aa18..1fbd1293b 100644 --- a/modules/jumper.el +++ b/modules/jumper.el @@ -11,72 +11,17 @@ ;; Layer: 4 (Optional). ;; Category: O/L. ;; Load shape: eager. -;; Eager reason: none; navigation helper, a command-loaded deferral candidate. -;; Top-level side effects: defines a jumper keymap. +;; Eager reason: none; jump commands can autoload. +;; Top-level side effects: defines jumper keymap. ;; Runtime requires: cl-lib. ;; Direct test load: yes. ;; -;; Jumper provides a simple way to store and jump between locations -;; in your codebase without needing to remember register assignments. +;; Small register-backed jump list. Locations are stored in numbered registers, +;; shown through completion with file/line context, and removed explicitly when +;; no longer useful. ;; -;; PURPOSE: -;; -;; When working on large codebases, you often need to jump between -;; multiple related locations: a function definition, its tests, its -;; callers, configuration files, etc. Emacs registers are perfect for -;; this, but require you to remember which register you assigned to -;; which location. Jumper automates register management, letting you -;; focus on your work instead of bookkeeping. -;; -;; WORKFLOW: -;; -;; 1. Navigate to an important location in your code -;; 2. Press M-SPC SPC to store it (automatically assigned to register 0) -;; 3. Continue working, storing more locations as needed (registers 1-9) -;; 4. Press M-SPC j to jump back to any stored location -;; 5. Select from the list using completion (shows file, line, context) -;; 6. Press M-SPC d to remove locations you no longer need -;; -;; RECOMMENDED USAGE: -;; -;; Store locations temporarily while working on a feature: -;; - Store the main function you're implementing -;; - Store the test file where you're writing tests -;; - Store the caller that needs updating -;; - Store the documentation that needs changes -;; - Jump between them freely as you work -;; - Clear them when done with the feature -;; -;; SPECIAL BEHAVIORS: -;; -;; - Duplicate prevention: Storing the same location twice shows a message -;; instead of wasting a register slot. -;; -;; - Single location toggle: When only one location is stored, M-SPC j -;; toggles between that location and your current position. Perfect for -;; rapid back-and-forth between two related files. -;; -;; - Last location tracking: The last position before each jump is saved -;; in register 'z', allowing quick "undo" of navigation. -;; -;; - Smart selection: With multiple locations, completing-read shows -;; helpful context: "[0] filename.el:42 - function definition..." -;; -;; KEYBINDINGS: -;; -;; M-SPC SPC Store current location in next available register -;; M-SPC j Jump to a stored location (with completion) -;; M-SPC d Delete a stored location from the list -;; -;; CONFIGURATION: -;; -;; You can customize the prefix key and maximum locations: -;; -;; (setq jumper-prefix-key "C-c j") ; Change prefix key -;; (setq jumper-max-locations 20) ; Store up to 20 locations -;; -;; Note: Changing jumper-max-locations requires restarting Emacs or -;; manually reinitializing jumper--registers. +;; A single stored location toggles with the current point; each jump records the +;; previous point in register z for a quick return path. ;;; Code: @@ -124,12 +69,10 @@ marker." (defun jumper--location-exists-p () "Check if current location is already stored." - (let ((key (jumper--location-key)) - (found nil)) - (dotimes (i jumper--next-index found) - (when (jumper--with-marker-at - i (lambda () (string= key (jumper--location-key)))) - (setq found t))))) + (let ((key (jumper--location-key))) + (cl-loop for i from 0 below jumper--next-index + thereis (jumper--with-marker-at + i (lambda () (string= key (jumper--location-key))))))) (defun jumper--register-available-p () "Check if there are registers available." diff --git a/modules/keybindings.el b/modules/keybindings.el index b61c3f2b3..7072cb9c2 100644 --- a/modules/keybindings.el +++ b/modules/keybindings.el @@ -1,4 +1,4 @@ -;;; keybindings --- General Keyboard Shortcuts -*- lexical-binding: t; coding: utf-8; -*- +;;; keybindings.el --- General Keyboard Shortcuts -*- lexical-binding: t; coding: utf-8; -*- ;; author: Craig Jennings <c@cjennings.net> ;; ;;; Commentary: diff --git a/modules/keyboard-compat.el b/modules/keyboard-compat.el index 914a343a6..9395b9c86 100644 --- a/modules/keyboard-compat.el +++ b/modules/keyboard-compat.el @@ -6,90 +6,18 @@ ;; Layer: 1 (Foundation). ;; Category: F/S. ;; Load shape: eager. -;; Eager reason: normalizes terminal/GUI key input so the first session's -;; keybindings resolve consistently. -;; Top-level side effects: adds `cj/keyboard-compat-terminal-setup' to -;; `emacs-startup-hook'. +;; Eager reason: normalizes terminal/GUI key input before custom bindings matter. +;; Top-level side effects: adds cj/keyboard-compat-terminal-setup to startup. ;; Runtime requires: host-environment. -;; Direct test load: yes (registers a startup hook; batch-safe). +;; Direct test load: yes. ;; -;; This module fixes keyboard input differences between terminal and GUI Emacs. +;; Normalizes Meta+Shift bindings across GUI and terminal frames. GUI frames +;; translate M-uppercase events to explicit M-S-lowercase keys; terminal frames +;; decode arrow escape sequences before key lookup so ESC O prefixes do not trip +;; M-S bindings. ;; -;; THE PROBLEM: Meta+Shift keybindings behave differently in terminal vs GUI -;; ========================================================================= -;; -;; In Emacs, there are two ways to express "Meta + Shift + o": -;; -;; 1. M-O (Meta + uppercase O) - key code 134217807 -;; 2. M-S-o (Meta + explicit Shift modifier + lowercase o) - key code 167772271 -;; -;; These are NOT the same key in Emacs! -;; -;; GUI Emacs behavior: -;; When you press Meta+Shift+o on your keyboard, GUI Emacs receives M-O -;; (uppercase O). It does NOT receive M-S-o. This is because the keyboard -;; sends Shift+o as uppercase 'O', not as a Shift modifier plus lowercase 'o'. -;; -;; Terminal Emacs behavior: -;; Terminals send escape sequences for special keys. Arrow keys send: -;; - Up: ESC O A -;; - Down: ESC O B -;; - Right: ESC O C -;; - Left: ESC O D -;; -;; The problem: ESC O is interpreted as M-O by Emacs! So if you bind M-O -;; to a function, pressing the up arrow sends "ESC O A", Emacs sees "M-O" -;; and triggers your function instead of moving up. Arrow keys break. -;; -;; THE SOLUTION: Different handling for each display type -;; ====================================================== -;; -;; For terminal mode (handled by cj/keyboard-compat-terminal-setup): -;; - Use input-decode-map to translate arrow escape sequences BEFORE -;; any keybinding lookup. ESC O A becomes [up], not M-O followed by A. -;; - Keybindings use M-S-o syntax (some terminals support explicit Shift) -;; - Disable graphical icons that show as unicode artifacts -;; -;; For GUI mode (handled by cj/keyboard-compat-gui-setup): -;; - Use key-translation-map to translate M-O to M-S-o BEFORE lookup -;; - This way, pressing Meta+Shift+o (which sends M-O) gets translated -;; to M-S-o, matching the keybinding definitions -;; - All 18 Meta+Shift keybindings work correctly -;; -;; WHY NOT JUST USE M-O FOR KEYBINDINGS? -;; ===================================== -;; -;; We could bind to M-O directly, but: -;; 1. Terminal arrow keys would break (ESC O prefix conflict) -;; 2. We'd need to maintain two sets of bindings (M-O for GUI, something -;; else for terminal) -;; -;; By using M-S-o syntax everywhere and translating M-O -> M-S-o in GUI mode, -;; we have one consistent set of keybindings that work everywhere. -;; -;; KEYBINDINGS AFFECTED: -;; ==================== -;; -;; The following M-S- keybindings are translated from M-uppercase in GUI: -;; -;; M-O -> M-S-o cj/kill-other-window (undead-buffers.el) -;; M-M -> M-S-m cj/kill-all-other-buffers-and-windows (undead-buffers.el) -;; M-Y -> M-S-y yank-media (keybindings.el) -;; M-F -> M-S-f fontaine-set-preset (font-config.el) -;; M-W -> M-S-w wttrin (weather-config.el) -;; M-E -> M-S-e eww (eww-config.el) -;; M-L -> M-S-l cj/switch-themes (ui-theme.el) -;; M-R -> M-S-r cj/elfeed-open (elfeed-config.el) -;; M-V -> M-S-v cj/split-and-follow-right (ui-navigation.el) -;; M-H -> M-S-h cj/split-and-follow-below (ui-navigation.el) -;; M-T -> M-S-t toggle-window-split (ui-navigation.el) -;; M-Z -> M-S-z cj/undo-kill-buffer (ui-navigation.el) -;; M-U -> M-S-u winner-undo (ui-navigation.el) -;; M-D -> M-S-d dwim-shell-commands-menu (dwim-shell-config.el) -;; M-I -> M-S-i edit-indirect-region (text-config.el) -;; M-C -> M-S-c time-zones (chrono-tools.el) -;; M-B -> M-S-b calibredb (calibredb-epub-config.el) -;; M-K -> M-S-k show-kill-ring (show-kill-ring.el) +;; Also provides terminal-specific display fallbacks, such as hiding icon glyphs +;; that render poorly outside GUI frames. ;;; Code: @@ -140,12 +68,6 @@ This runs after init to override any package settings." nerd-icons-icon-for-buffer)) (advice-add fn :around #'cj/--icon-blank-in-terminal))) -(with-eval-after-load 'all-the-icons - (dolist (fn '(all-the-icons-icon-for-file - all-the-icons-icon-for-dir - all-the-icons-icon-for-mode)) - (advice-add fn :around #'cj/--icon-blank-in-terminal))) - ;; ============================================================================= ;; GUI-specific fixes ;; ============================================================================= diff --git a/modules/latex-config.el b/modules/latex-config.el index f2a586704..2cc19171e 100644 --- a/modules/latex-config.el +++ b/modules/latex-config.el @@ -1,4 +1,4 @@ -;;; latex-config --- Setup for LaTeX and Related Software -*- lexical-binding: t; coding: utf-8; -*- +;;; latex-config.el --- Setup for LaTeX and Related Software -*- lexical-binding: t; coding: utf-8; -*- ;; author Craig Jennings <c@cjennings.net> ;;; Commentary: diff --git a/modules/local-repository.el b/modules/local-repository.el index 6376d9f73..e3c7a227a 100644 --- a/modules/local-repository.el +++ b/modules/local-repository.el @@ -1,4 +1,4 @@ -;;; local-repository.el --- local repository functionality -*- lexical-binding: t; coding: utf-8; -*- +;;; local-repository.el --- Local package archive helpers -*- lexical-binding: t; coding: utf-8; -*- ;; author Craig Jennings <c@cjennings.net> ;;; Commentary: @@ -6,20 +6,25 @@ ;; Layer: 4 (Optional). ;; Category: O/D/P. ;; Load shape: eager. -;; Eager reason: none; local package-mirror workflow, a command-loaded deferral -;; candidate. +;; Eager reason: none; local package mirror commands can autoload. ;; Top-level side effects: none. -;; Runtime requires: elpa-mirror. +;; Runtime requires: elpa-mirror when updating the mirror. ;; Direct test load: yes. ;; +;; Adds the checked-in local package archive to package-archives with high +;; priority, and provides a command to refresh that archive from installed +;; packages via elpa-mirror. + ;;; Code: (require 'elpa-mirror nil t) ;; optional; cj/update-localrepo-repository fails at call-time if absent +(declare-function elpamr-create-mirror-for-installed "elpa-mirror") + ;; ------------------------------ Utility Function ----------------------------- -(defun car-member (value list) +(defun localrepo--car-member (value list) "Check if VALUE exists as the car of any cons cell in LIST." (member value (mapcar #'car list))) @@ -60,11 +65,11 @@ keep them in source control." (defun localrepo-initialize () "Add the repository to the package archives, then gives it a high priority." - (unless (car-member localrepo-repository-id package-archives) + (unless (localrepo--car-member localrepo-repository-id package-archives) (add-to-list 'package-archives (cons localrepo-repository-id localrepo-repository-location))) - (unless (car-member localrepo-repository-id package-archive-priorities) + (unless (localrepo--car-member localrepo-repository-id package-archive-priorities) (add-to-list 'package-archive-priorities (cons localrepo-repository-id localrepo-repository-priority)))) diff --git a/modules/mail-config.el b/modules/mail-config.el index 1d8a98c97..84d5f029a 100644 --- a/modules/mail-config.el +++ b/modules/mail-config.el @@ -1,4 +1,4 @@ -;;; mail-config --- Settings for Mu4e Email -*- lexical-binding: t; coding: utf-8; -*- +;;; mail-config.el --- Settings for Mu4e Email -*- lexical-binding: t; coding: utf-8; -*- ;; author Craig Jennings <c@cjennings.net> ;; ;;; Commentary: diff --git a/modules/markdown-config.el b/modules/markdown-config.el index 424c09cc8..4b6c9947d 100644 --- a/modules/markdown-config.el +++ b/modules/markdown-config.el @@ -1,4 +1,4 @@ -;;; markdown-config --- Settings for Editing Markdown -*- lexical-binding: t; coding: utf-8; -*- +;;; markdown-config.el --- Settings for Editing Markdown -*- lexical-binding: t; coding: utf-8; -*- ;; author Craig Jennings <c@cjennings.net> ;;; Commentary: diff --git a/modules/media-utils.el b/modules/media-utils.el index 685530d89..1abbc1b2b 100644 --- a/modules/media-utils.el +++ b/modules/media-utils.el @@ -86,9 +86,11 @@ strings." :value-type sexp)) :group 'media) -(defcustom cj/default-media-player 'vlc +(defcustom cj/default-media-player 'mpv "The default media player to use for videos. -Should be a key from `cj/media-players'." +Should be a key from `cj/media-players'. mpv is the default because it +resolves streaming-site URLs itself via yt-dlp, so it needs no pre-extracted +stream URL (see the :needs-stream-url flag in `cj/media-players')." :type 'symbol :group 'media) diff --git a/modules/modeline-config.el b/modules/modeline-config.el index 61dcb69c6..2793cfae5 100644 --- a/modules/modeline-config.el +++ b/modules/modeline-config.el @@ -1,4 +1,4 @@ -;;; modeline-config --- Modeline Settings -*- lexical-binding: t; coding: utf-8; -*- +;;; modeline-config.el --- Modeline Settings -*- lexical-binding: t; coding: utf-8; -*- ;; author: Craig Jennings <c@cjennings.net> ;;; Commentary: diff --git a/modules/mousetrap-mode.el b/modules/mousetrap-mode.el index 3817e0081..656d49e2f 100644 --- a/modules/mousetrap-mode.el +++ b/modules/mousetrap-mode.el @@ -1,4 +1,4 @@ -;;; mousetrap-mode.el --- -*- coding: utf-8; lexical-binding: t; -*- +;;; mousetrap-mode.el --- Profile-based mouse event blocking -*- coding: utf-8; lexical-binding: t; -*- ;; ;;; Commentary: ;; @@ -11,25 +11,12 @@ ;; Runtime requires: cl-lib. ;; Direct test load: yes. ;; -;; Mouse Trap Mode is a minor mode for Emacs that disables most mouse and -;; trackpad events to prevent accidental text modifications. Hitting the -;; trackpad and finding my text is being inserted in an unintended place is -;; quite annoying, especially when you're overcaffeinated. +;; Global minor mode that blocks accidental mouse edits while preserving allowed +;; interaction categories per major-mode profile: scroll, click, drag, and +;; multi-click. ;; -;; The mode uses a profile-based architecture to selectively enable/disable -;; mouse events based on the current major mode. Profiles define which -;; event categories are allowed (scrolling, clicks, drags, etc.), and modes -;; are mapped to profiles. -;; -;; The keymap is built dynamically when the mode is toggled, so you can -;; change profiles or mode mappings and re-enable the mode without reloading -;; your Emacs configuration. -;; -;; Keymaps are buffer-local via `emulation-mode-map-alists', so each buffer -;; gets the correct profile for its major mode independently. -;; -;; Inspired by this blog post from Malabarba -;; https://endlessparentheses.com/disable-mouse-only-inside-emacs.html +;; The mode builds buffer-local emulation keymaps from profiles, so changing a +;; profile or mode mapping takes effect after toggling the mode. ;; ;;; Code: diff --git a/modules/mu4e-org-contacts-integration.el b/modules/mu4e-org-contacts-integration.el index daa12701a..6062b8cf5 100644 --- a/modules/mu4e-org-contacts-integration.el +++ b/modules/mu4e-org-contacts-integration.el @@ -2,8 +2,13 @@ ;; author: Craig Jennings <c@cjennings.net> ;;; Commentary: -;; This module provides seamless integration between org-contacts and mu4e's -;; email composition, enabling automatic contact completion in email fields. +;; +;; Completion-at-point integration between org-contacts and mu4e/org-msg compose +;; buffers. Header fields complete against org contact email strings; message +;; bodies keep their normal TAB behavior. +;; +;; Dependencies are optional at file load. Activation is a no-op when mu4e or +;; org-contacts is unavailable so the wider config can still load. ;;; Code: diff --git a/modules/mu4e-org-contacts-setup.el b/modules/mu4e-org-contacts-setup.el index 64e9a611f..bfb9b1f24 100644 --- a/modules/mu4e-org-contacts-setup.el +++ b/modules/mu4e-org-contacts-setup.el @@ -2,8 +2,10 @@ ;; author: Craig Jennings <c@cjennings.net> ;;; Commentary: -;; Simple setup file to enable org-contacts integration with mu4e. -;; Add this to your mail-config.el or load it after both mu4e and org-contacts. +;; +;; Thin activation wrapper for mu4e-org-contacts-integration. If mu4e is loaded, +;; enable org-contacts completion and disable mu4e's internal contact collector +;; so completion has one source of truth. ;;; Code: diff --git a/modules/music-config.el b/modules/music-config.el index 76fff283b..d16e2bb2f 100644 --- a/modules/music-config.el +++ b/modules/music-config.el @@ -5,90 +5,18 @@ ;; Layer: 4 (Optional). ;; Category: O/D/P/S. ;; Load shape: eager. -;; Eager reason: none; optional music workflow that registers a music keymap, a -;; command-loaded deferral candidate. EMMS hooks should run only after EMMS. -;; Top-level side effects: defines a music keymap under cj/custom-keymap, one -;; global key, package config. +;; Eager reason: none; optional music workflow that registers a music keymap. +;; Top-level side effects: defines C-; m map, one global key, package config. ;; Runtime requires: subr-x, user-constants, keybindings. -;; Direct test load: yes (requires keybindings explicitly). +;; Direct test load: yes. ;; -;; Music management in Emacs via EMMS with MPV backend. -;; Focus: simple, modular helpers; consistent error handling; streamlined UX. -;; -;; Highlights: -;; - Fuzzy add: select files/dirs; dirs have trailing /; case-insensitive; stable order -;; - Recursive directory add -;; - Dired/Dirvish integration (add selection) -;; - M3U playlist save/load/edit/reload -;; - Radio station M3U creation (streaming URLs supported) -;; - Playlist window toggling -;; - Consume mode (remove tracks after playback) -;; - MPV as player (no daemon required) -;; -;; Keybindings (playlist-mode-map): -;; -;; Aligned with ncmpcpp defaults where possible (83% match). -;; Additional EMMS-specific bindings for features ncmpcpp lacks. -;; -;; Key Action ncmpcpp default Match -;; ─── ────── ─────────────── ───── -;; Playback -;; SPC pause add_item * -;; s stop stop ✓ -;; > / n next track next ✓ -;; < / P previous track previous ✓ -;; p play selected (enter) ✓ -;; f seek forward seek_forward ✓ -;; b seek backward seek_backward ✓ -;; -;; Toggles -;; r repeat playlist toggle_repeat ✓ -;; t repeat track (none) + -;; z random toggle_random ✓ -;; x consume toggle_crossfade * -;; Z shuffle shuffle ✓ -;; -;; Volume -;; + / = volume up volume_up ✓ -;; - volume down volume_down ✓ -;; -;; Info -;; i song info show_song_info ✓ -;; o jump to playing jump_to_playing ✓ -;; -;; Playlist management -;; a add music (fuzzy) add_selected ✓ -;; c / C clear playlist clear_playlist ✓ -;; S save playlist (none) + -;; L load playlist (none) + -;; E edit playlist M3U (none) + -;; g reload playlist (none) + -;; A append track to M3U (none) + -;; q quit/bury quit ✓ -;; -;; Track reordering -;; S-up move track up (shift-up) ✓ -;; S-down move track down (shift-down) ✓ -;; C-up move track up (alias) (none) + -;; C-down move track down (alias) (none) + -;; -;; Other -;; R create radio station (none) + -;; -;; Legend: ✓ = matches ncmpcpp default -;; * = intentional divergence (see below) -;; + = EMMS-only feature -;; -;; Intentional divergences from ncmpcpp defaults: -;; -;; SPC/p swap: ncmpcpp defaults p=pause, SPC=add_item_to_playlist. -;; This config uses SPC=pause (more natural in Emacs) and p=play -;; selected track. Pause via SPC is a common media player convention. -;; -;; x=consume vs crossfade: ncmpcpp's crossfade is an mpd daemon -;; feature. EMMS uses mpv directly, so consume mode (remove tracks -;; after playback) is more useful here. +;; EMMS setup using an mpv subprocess player, M3U playlist helpers, fuzzy +;; file/directory adds, Dired/Dirvish integration, radio-station creation, and +;; playlist window toggling. ;; +;; The playlist keymap intentionally follows ncmpcpp where it maps cleanly, with +;; EMMS-specific additions for M3U editing and consume mode. + ;;; Code: (require 'subr-x) @@ -108,13 +36,26 @@ (defvar emms-random-playlist) (defvar emms-playlist-selected-marker) (defvar emms-source-file-default-directory) -(defvar emms-player-mpv-parameters) -(defvar emms-player-mpv-regexp) (defvar emms-player-playing-p) (defvar emms-player-paused-p) (defvar emms-playlist-mode-map) (defvar dirvish-mode-map) +;; Playlist-header faces. Defined here so the `cj/music--header-text' +;; references are valid (an undefined face spams "Invalid face reference" on +;; every render). Appearance inherits themed base faces so the active theme +;; owns the colors -- the literal values were dropped in the route-colors pass. +(defface cj/music-header-face '((t :inherit shadow)) + "Playlist-header field labels (Playlist, Current, Mode, Keys).") +(defface cj/music-header-value-face '((t :inherit default)) + "Playlist-header field values.") +(defface cj/music-mode-on-face '((t :inherit warning)) + "Active mode indicator in the playlist header.") +(defface cj/music-mode-off-face '((t :inherit shadow)) + "Inactive mode indicator in the playlist header.") +(defface cj/music-keyhint-face '((t :inherit shadow)) + "Key hints in the playlist header.") + ;; Foreign functions used lazily after their packages load. (declare-function emms-playlist-mode "emms-playlist-mode") (declare-function emms-playlist-track-at "emms-playlist-mode") @@ -146,9 +87,98 @@ (defvar cj/music-file-extensions '("aac" "flac" "m4a" "mp3" "ogg" "opus" "wav") "List of valid music file extensions.") +(defvar cj/music-seek-seconds 5 + "Seconds to move when seeking forward or backward in the current track.") + (defvar cj/music-playlist-buffer-name "*EMMS-Playlist*" "Name of the EMMS playlist buffer used by this configuration.") +;;; Subprocess mpv player (reliable playback) + +;; The IPC player (emms-player-mpv) drives mpv over a socket -- start mpv idle, +;; connect, send loadfile. That handshake was leaving mpv loaded but never +;; streaming, so playback silently failed. Driving mpv with the track as a +;; direct argument -- the invocation that plays every time -- is the reliable +;; path. --no-config isolates this mpv from the interactive/video mpv setup so +;; the two cannot interfere. Pause is in place via process signals; in-track +;; seek is not available with a subprocess player (the trade for reliability). + +(declare-function emms-player "emms") +(declare-function emms-player-set "emms") +(declare-function emms-player-simple-start "emms-player-simple") +(declare-function emms-player-simple-stop "emms-player-simple") +(defvar emms-player-simple-process-name) +(defvar emms-player-cj/music-mpv) + +(defvar cj/music--mpv-regex + (concat "\\(?:\\." (regexp-opt cj/music-file-extensions) "\\'\\)" + "\\|\\`\\(?:https?\\|mms\\)://") + "Track names the subprocess mpv player handles: music files or stream URLs.") + +(defvar cj/music--mpv-socket + (expand-file-name "emms/mpv-control.sock" user-emacs-directory) + "IPC control socket for the subprocess mpv player. +mpv opens it per playback via --input-ipc-server. It does NOT affect startup: +mpv still plays the track passed as a direct argument, so the reliable start is +unchanged. The socket only carries control commands (seek) to the already +playing process, which is where the old idle + loadfile handshake failed.") + +(defun cj/music--mpv-start (track) + "Play TRACK by running mpv with the track name as a direct argument." + (emms-player-simple-start (emms-track-name track) + 'emms-player-cj/music-mpv + "mpv" + (list "--no-video" "--no-config" "--really-quiet" + (concat "--input-ipc-server=" cj/music--mpv-socket)))) + +(defun cj/music--mpv-stop () + "Stop the mpv subprocess." + (emms-player-simple-stop)) + +(defun cj/music--mpv-playable-p (track) + "Return non-nil if the subprocess mpv player can play TRACK." + (and (executable-find "mpv") + (memq (emms-track-type track) '(file url)) + (string-match cj/music--mpv-regex (emms-track-name track)))) + +(defun cj/music--mpv-pause () + "Pause the mpv subprocess in place by stopping it (SIGSTOP)." + (let ((proc (get-process emms-player-simple-process-name))) + (when (and proc (process-live-p proc)) + (signal-process proc 'SIGSTOP)))) + +(defun cj/music--mpv-resume () + "Resume the paused mpv subprocess (SIGCONT)." + (let ((proc (get-process emms-player-simple-process-name))) + (when (and proc (process-live-p proc)) + (signal-process proc 'SIGCONT)))) + +(defun cj/music--mpv-command (json) + "Send JSON (a one-line mpv IPC command) to the control socket. +A no-op when nothing is playing or the socket is gone, so it never errors." + (when (file-exists-p cj/music--mpv-socket) + (ignore-errors + (let ((proc (make-network-process :name "cj-music-mpv-cmd" + :family 'local + :service cj/music--mpv-socket + :noquery t))) + (unwind-protect + (progn (process-send-string proc (concat json "\n")) + (accept-process-output proc 0.1)) + (delete-process proc)))))) + +(defun cj/music-seek-forward () + "Seek `cj/music-seek-seconds' seconds forward in the current track." + (interactive) + (cj/music--mpv-command + (format "{\"command\": [\"seek\", %d, \"relative\"]}" cj/music-seek-seconds))) + +(defun cj/music-seek-backward () + "Seek `cj/music-seek-seconds' seconds backward in the current track." + (interactive) + (cj/music--mpv-command + (format "{\"command\": [\"seek\", %d, \"relative\"]}" (- cj/music-seek-seconds)))) + ;;; Buffer-local state (defvar-local cj/music-playlist-file nil @@ -189,14 +219,24 @@ Directories are suffixed with /; files are plain. Hidden dirs/files skipped." (sort acc #'string-lessp))) (defun cj/music--completion-table (candidates) - "Completion table for CANDIDATES preserving order and case-insensitive match." - (lambda (string pred action) - (if (eq action 'metadata) - '(metadata - (display-sort-function . identity) - (cycle-sort-function . identity) - (completion-ignore-case . t)) - (complete-with-action action candidates string pred)))) + "Completion table for CANDIDATES preserving order and case-insensitive match. +Tags the `cj-music-file' category and annotates each candidate (a path relative +to `cj/music-root', with a trailing slash for directories) with its size and +modification date so marginalia can show them." + (let ((annotate (cj/completion-file-annotator + (lambda (c) + (expand-file-name + (if (string-suffix-p "/" c) (substring c 0 -1) c) + cj/music-root))))) + (lambda (string pred action) + (if (eq action 'metadata) + `(metadata + (category . cj-music-file) + (annotation-function . ,annotate) + (display-sort-function . identity) + (cycle-sort-function . identity) + (completion-ignore-case . t)) + (complete-with-action action candidates string pred))))) (defun cj/music--ensure-playlist-buffer () "Ensure EMMS playlist buffer exists and is in playlist mode. Return buffer." @@ -843,7 +883,7 @@ For URL tracks: decoded URL." :commands (emms-mode-line-mode) :config (require 'emms-setup) - (require 'emms-player-mpv) + (require 'emms-player-simple) (require 'emms-playlist-mode) (require 'emms-source-file) (require 'emms-source-playlist) @@ -852,8 +892,13 @@ For URL tracks: decoded URL." (setq emms-source-file-default-directory cj/music-root) (setq emms-playlist-default-major-mode 'emms-playlist-mode) - ;; Use MPV as player - MUST be set before emms-all - (setq emms-player-list '(emms-player-mpv)) + ;; Use the reliable subprocess mpv player (built above) - MUST be set before emms-all + (setq emms-player-cj/music-mpv + (emms-player #'cj/music--mpv-start #'cj/music--mpv-stop + #'cj/music--mpv-playable-p)) + (emms-player-set emms-player-cj/music-mpv 'pause #'cj/music--mpv-pause) + (emms-player-set emms-player-cj/music-mpv 'resume #'cj/music--mpv-resume) + (setq emms-player-list '(emms-player-cj/music-mpv)) ;; Now initialize EMMS (emms-all) @@ -862,17 +907,6 @@ For URL tracks: decoded URL." (emms-playing-time-display-mode -1) (emms-mode-line-mode -1) - ;; MPV configuration - ;; MPV supports both local files and stream URLs - (setq emms-player-mpv-parameters - '("--quiet" "--no-video" "--audio-display=no")) - - ;; Update supported file types for mpv player - (setq emms-player-mpv-regexp - (concat "\\(?:\\`\\(?:https?\\|mms\\)://\\)\\|\\(?:\\." - (regexp-opt cj/music-file-extensions) - "\\'\\)")) - ;; Keep cj/music-playlist-file in sync if playlist is cleared. ;; Ensure we don't stack duplicate advice on reload. (advice-remove 'emms-playlist-clear #'cj/music--after-playlist-clear) @@ -908,8 +942,8 @@ For URL tracks: decoded URL." (">" . cj/music-next) ("P" . cj/music-previous) ("<" . cj/music-previous) - ("f" . emms-seek-forward) - ("b" . emms-seek-backward) + ("f" . cj/music-seek-forward) + ("b" . cj/music-seek-backward) ("q" . emms-playlist-mode-bury-buffer) ("a" . cj/music-fuzzy-select-and-add) ;; Toggles (aligned with ncmpcpp) diff --git a/modules/nerd-icons-config.el b/modules/nerd-icons-config.el index e2edb0717..e38db7d80 100644 --- a/modules/nerd-icons-config.el +++ b/modules/nerd-icons-config.el @@ -72,7 +72,20 @@ every call. The `memq' check skips when the face is already present." :after (nerd-icons marginalia) :hook (marginalia-mode . nerd-icons-completion-marginalia-setup) :config - (nerd-icons-completion-mode)) + (nerd-icons-completion-mode) + ;; The `cj/--nerd-icons-color-dir' advice forces `nerd-icons-yellow' onto every + ;; dir icon, so the package's inherit-behind `nerd-icons-completion-dir-face' + ;; can never win. Redefine the file-category icon so completing-read folders + ;; carry the dir face: copy the icon first (the memoized original stays + ;; untouched, so dired/dirvish folders are unaffected) and prepend the dir face + ;; so it takes the foreground. Files keep their own type face. + (cl-defmethod nerd-icons-completion-get-icon (cand (_cat (eql file))) + (if (string-suffix-p "/" cand) + (let ((icon (copy-sequence + (nerd-icons-icon-for-dir cand :height nerd-icons-completion-icon-size)))) + (add-face-text-property 0 (length icon) 'nerd-icons-completion-dir-face nil icon) + (concat icon " ")) + (concat (nerd-icons-icon-for-file cand :height nerd-icons-completion-icon-size) " ")))) (use-package nerd-icons-ibuffer :after nerd-icons diff --git a/modules/nov-reading.el b/modules/nov-reading.el new file mode 100644 index 000000000..4134f4975 --- /dev/null +++ b/modules/nov-reading.el @@ -0,0 +1,282 @@ +;;; nov-reading.el --- Reading-view theme layer for nov-mode EPUBs -*- lexical-binding: t; -*- +;; author: Craig Jennings <c@cjennings.net> + +;;; Commentary: +;; +;; Layer: 4 (Added features). +;; Category: O (optional commands + faces). +;; Load shape: eager. +;; Eager reason: defines the reading faces and commands the nov launch hook and +;; keymap reference; the faces must exist for theme-studio's inventory too. +;; Top-level side effects: defface x9 (3 palettes + per-palette heading/link), +;; defcustoms, a defgroup, a defvar. +;; Runtime requires: none (face-remap and text-scale are built in). +;; Direct test load: yes. +;; +;; A small theme layer on top of the stock `nov' package (no fork): how an EPUB +;; *reads*, kept buffer-local so it never disturbs the frame or other buffers. +;; Two knobs: +;; +;; - Reading palette -- the background + foreground, as sepia / dark / light, +;; each a face the dupre theme / theme-studio own (registered as the +;; "nov-reading" bespoke app in theme-studio's face_data.py). +;; - Typography -- a serif family and a base height, with +/-/= adjusting the +;; page font size live via a buffer-local text-scale on top of the base. +;; The live size is remembered globally, so every book opens where you left +;; it; "=" returns to the base height. +;; +;; calibredb-epub-config.el owns the library/calibre side and the text-width / +;; centering layout; this module owns reading color and typography. Its launch +;; entry point `cj/nov-reading-setup' is called from that module's nov-mode hook. + +;;; Code: + +(defgroup cj/nov-reading nil + "Reading-view theming for nov-mode EPUBs." + :group 'cj) + +;; ----------------------------- Reading palettes ------------------------------ +;; nov renders through shr and defines no faces, so a palette is a buffer-local +;; face-remap of `default'. Each palette is one face carrying a :background and +;; :foreground, so the theme owns the real colors (the hex defaults here are a +;; starting point to tune in theme-studio). + +(defface cj/nov-reading-sepia + '((t :background "#1f1b16" :foreground "#c9b187")) + "Sepia reading palette for nov-mode: warm dark background, tan text." + :group 'cj/nov-reading) + +(defface cj/nov-reading-dark + '((t :background "#15140f" :foreground "#cfc8b8")) + "Dark reading palette for nov-mode: near-black background, light-gray text." + :group 'cj/nov-reading) + +(defface cj/nov-reading-light + '((t :background "#ece3cf" :foreground "#2a2622")) + "Light reading palette for nov-mode: cream background, near-black text." + :group 'cj/nov-reading) + +;; Structural faces: recolor shr's heading (h1-h6) and link faces per palette, +;; remapped buffer-local so the EPUB's hierarchy reads in the palette's accent +;; while mail/eww (the other shr consumers) keep the theme's shr colors. Heading +;; faces carry :foreground only -- shr's per-level height and weight survive the +;; relative remap; link faces add :underline so the cue reads as a link. + +(defface cj/nov-reading-sepia-heading + '((t :foreground "#e6c98a")) + "Heading accent for the sepia reading palette (recolors shr-h1..h6)." + :group 'cj/nov-reading) + +(defface cj/nov-reading-sepia-link + '((t :foreground "#c98f5a" :underline t)) + "Link accent for the sepia reading palette (recolors shr-link)." + :group 'cj/nov-reading) + +(defface cj/nov-reading-dark-heading + '((t :foreground "#e8e0cc")) + "Heading accent for the dark reading palette (recolors shr-h1..h6)." + :group 'cj/nov-reading) + +(defface cj/nov-reading-dark-link + '((t :foreground "#8fb0c4" :underline t)) + "Link accent for the dark reading palette (recolors shr-link)." + :group 'cj/nov-reading) + +(defface cj/nov-reading-light-heading + '((t :foreground "#5a3d28")) + "Heading accent for the light reading palette (recolors shr-h1..h6)." + :group 'cj/nov-reading) + +(defface cj/nov-reading-light-link + '((t :foreground "#8a5a2a" :underline t)) + "Link accent for the light reading palette (recolors shr-link)." + :group 'cj/nov-reading) + +(defcustom cj/nov-reading-palettes + '(("sepia" :face cj/nov-reading-sepia + :heading cj/nov-reading-sepia-heading + :link cj/nov-reading-sepia-link) + ("dark" :face cj/nov-reading-dark + :heading cj/nov-reading-dark-heading + :link cj/nov-reading-dark-link) + ("light" :face cj/nov-reading-light + :heading cj/nov-reading-light-heading + :link cj/nov-reading-light-link)) + "Alist of reading-palette NAME -> face property list for nov-mode. +Each entry's plist supplies the palette's colors, all theme-owned faces: + :face reading-view :background and :foreground, remapped onto `default' + :heading recolors shr's heading faces (h1-h6) for this palette + :link recolors shr's link face for this palette +The selector and cycle commands choose among these names. Add an entry to add a +palette; omit :heading or :link to leave that element at the theme's default." + :type '(alist :key-type string + :value-type + (plist :options ((:face face) (:heading face) (:link face)))) + :group 'cj/nov-reading) + +(defcustom cj/nov-reading-default-palette "sepia" + "Reading palette applied to a fresh nov-mode buffer. +A key in `cj/nov-reading-palettes', or nil for the theme's normal rendering." + :type '(choice (const :tag "None (theme default)" nil) string) + :group 'cj/nov-reading) + +(defvar-local cj/nov--reading-remap-cookies nil + "List of `face-remap-add-relative' cookies for the active reading palette. +Covers the `default' remap and any shr heading/link remaps, so switching +palettes can remove them all at once.") + +(defvar-local cj/nov--reading-palette nil + "Name of the reading palette active in this buffer, or nil for none.") + +(defun cj/nov--reading-palette-plist (name) + "Return the face property list for palette NAME, or nil when unknown. +NAME nil (the no-palette state) and unknown names both yield nil." + (cdr (assoc name cj/nov-reading-palettes))) + +(defun cj/nov--reading-palette-face (name) + "Return the base (bg/fg) face for palette NAME, or nil when NAME is unknown." + (plist-get (cj/nov--reading-palette-plist name) :face)) + +(defun cj/nov--next-reading-palette (current names) + "Return the palette after CURRENT in the cycle NAMES then nil, wrapping. +CURRENT nil is the no-palette state, and a returned nil means no palette. An +unknown CURRENT falls back to the first palette." + (let* ((cycle (append names (list nil))) + (tail (cdr (member current cycle)))) + (car (or tail cycle)))) + +(defun cj/nov--apply-reading-palette (name) + "Apply reading palette NAME buffer-local; NAME nil removes any palette. +Remaps `default' to the palette's :face, and (when present) shr's heading faces +h1-h6 to its :heading face and shr-link to its :link face. Removes the previous +palette's remaps first so switching never stacks, and leaves the typography +remap (a separate `default' remap) untouched." + (mapc #'face-remap-remove-relative cj/nov--reading-remap-cookies) + (setq cj/nov--reading-remap-cookies nil) + (let* ((plist (cj/nov--reading-palette-plist name)) + (face (plist-get plist :face))) + (when face + (push (face-remap-add-relative 'default face) + cj/nov--reading-remap-cookies) + (let ((heading (plist-get plist :heading))) + (when heading + (dolist (h '(shr-h1 shr-h2 shr-h3 shr-h4 shr-h5 shr-h6)) + (push (face-remap-add-relative h heading) + cj/nov--reading-remap-cookies)))) + (let ((link (plist-get plist :link))) + (when link + (push (face-remap-add-relative 'shr-link link) + cj/nov--reading-remap-cookies)))) + (setq cj/nov--reading-palette (and face name)))) + +(defun cj/nov-set-reading-palette (name) + "Choose reading palette NAME for this nov buffer; \"none\" clears it. +Interactively prompts among `cj/nov-reading-palettes' plus \"none\"." + (interactive + (list (completing-read "Reading palette: " + (cons "none" (mapcar #'car cj/nov-reading-palettes)) + nil t))) + (unless (derived-mode-p 'nov-mode) + (user-error "Not in a nov-mode buffer")) + (cj/nov--apply-reading-palette (unless (equal name "none") name)) + (message "Reading palette: %s" (or cj/nov--reading-palette "none"))) + +(defun cj/nov-cycle-reading-palette () + "Cycle to the next reading palette, then the no-palette state, wrapping." + (interactive) + (unless (derived-mode-p 'nov-mode) + (user-error "Not in a nov-mode buffer")) + (let ((next (cj/nov--next-reading-palette + cj/nov--reading-palette + (mapcar #'car cj/nov-reading-palettes)))) + (cj/nov--apply-reading-palette next) + (message "Reading palette: %s" (or next "none")))) + +;; ------------------------------- Typography ---------------------------------- + +(defcustom cj/nov-reading-font-family "Merriweather" + "Variable-pitch serif family for the EPUB reading view." + :type 'string + :group 'cj/nov-reading) + +(defcustom cj/nov-reading-text-height 180 + "Base `default'-face height (1/10 pt) the reading view renders at. +The +/-/= keys adjust the page size from here with a buffer-local text-scale. +That adjustment is remembered globally (see `cj/nov-reading-text-scale-file'): +every book and every session opens at the size you last left it, and `=' +returns to this base." + :type 'integer + :group 'cj/nov-reading) + +(defvar cj/nov-reading-text-scale-file + (expand-file-name "data/nov-reading-text-scale" user-emacs-directory) + "File persisting the global reading text-scale offset across sessions. +A single integer: the buffer-local `text-scale-mode-amount' the +/-/= keys +last set, applied on top of `cj/nov-reading-text-height' when a book opens.") + +(defun cj/nov-reading--parse-text-scale (s) + "Parse S (a string or nil) as an integer text-scale offset; 0 when invalid. +Surrounding whitespace is tolerated; non-integer content yields 0." + (let ((trimmed (and (stringp s) (string-trim s)))) + (if (and trimmed (string-match-p "\\`[+-]?[0-9]+\\'" trimmed)) + (string-to-number trimmed) + 0))) + +(defun cj/nov-reading--load-text-scale () + "Return the persisted reading text-scale offset, or 0 when none is saved." + (if (file-readable-p cj/nov-reading-text-scale-file) + (cj/nov-reading--parse-text-scale + (with-temp-buffer + (insert-file-contents cj/nov-reading-text-scale-file) + (buffer-string))) + 0)) + +(defun cj/nov-reading--save-text-scale (amount) + "Persist AMOUNT as the global reading text-scale offset. +Creates the data directory when absent." + (make-directory (file-name-directory cj/nov-reading-text-scale-file) t) + (with-temp-file cj/nov-reading-text-scale-file + (insert (number-to-string amount)))) + +(defun cj/nov-reading-apply-typography () + "Apply the reading family and base height buffer-local. +Remaps `variable-pitch', `default', and `fixed-pitch' so nov's shr output reads +as a comfortably-sized serif page." + (face-remap-add-relative 'variable-pitch + :family cj/nov-reading-font-family :height 1.0) + (face-remap-add-relative 'default + :family cj/nov-reading-font-family + :height cj/nov-reading-text-height) + (face-remap-add-relative 'fixed-pitch :height cj/nov-reading-text-height)) + +(defun cj/nov-reading-text-bigger () + "Increase the page font size and remember it across books and sessions." + (interactive) + (text-scale-increase 1) + (cj/nov-reading--save-text-scale text-scale-mode-amount)) + +(defun cj/nov-reading-text-smaller () + "Decrease the page font size and remember it across books and sessions." + (interactive) + (text-scale-decrease 1) + (cj/nov-reading--save-text-scale text-scale-mode-amount)) + +(defun cj/nov-reading-text-reset () + "Reset the page font size to the base reading height; clears the saved offset." + (interactive) + (text-scale-set 0) + (cj/nov-reading--save-text-scale 0)) + +;; ------------------------------- Launch hook --------------------------------- + +(defun cj/nov-reading-setup () + "Apply the reading view (typography + default palette) to this nov buffer. +Restores the remembered page font size on top of the base height. +Called from the nov-mode launch hook in calibredb-epub-config.el." + (cj/nov-reading-apply-typography) + (text-scale-set (cj/nov-reading--load-text-scale)) + (when cj/nov-reading-default-palette + (cj/nov--apply-reading-palette cj/nov-reading-default-palette))) + +(provide 'nov-reading) +;;; nov-reading.el ends here diff --git a/modules/org-agenda-config.el b/modules/org-agenda-config.el index 3234cc929..207c286e6 100644 --- a/modules/org-agenda-config.el +++ b/modules/org-agenda-config.el @@ -1,4 +1,4 @@ -;;; org-agenda-config --- Org-Agenda/Todo Config -*- lexical-binding: t; coding: utf-8; -*- +;;; org-agenda-config.el --- Org-Agenda/Todo Config -*- lexical-binding: t; coding: utf-8; -*- ;; author: Craig Jennings <c@cjennings.net> ;; ;;; Commentary: @@ -6,51 +6,18 @@ ;; Layer: 3 (Domain Workflow). ;; Category: D/S. ;; Load shape: eager. -;; Eager reason: daily agenda workflow; the user expects agenda available at the -;; first session. -;; Top-level side effects: one add-hook and an idle timer that builds the agenda -;; file cache 10s after startup (guarded; spec tracks the cache lifecycle). +;; Eager reason: agenda should be available in the first session. +;; Top-level side effects: agenda hooks plus guarded idle cache build. ;; Runtime requires: user-constants, system-lib, cj-cache-lib. ;; Direct test load: yes. ;; -;; Performance: -;; - Caches agenda file list to avoid scanning projects directory on every view -;; - Cache builds asynchronously 10 seconds after Emacs startup (non-blocking) -;; - First agenda view uses cache if ready, otherwise builds synchronously -;; - Subsequent views are instant (cached) -;; - Cache auto-refreshes after 1 hour -;; - Manual refresh: M-x cj/org-agenda-refresh-files (e.g., after adding projects) +;; Org agenda configuration for global, project-scoped, and buffer-scoped task +;; views. F8 opens the main agenda; modified F8 bindings narrow by project, +;; current buffer, or task list. ;; -;; Agenda views are tied to the F8 (fate) key. -;; -;; "We are what we repeatedly do. -;; Excellence, then, is not an act, but a habit" -;; -- Aristotle -;; -;; "...watch your actions, they become habits; -;; watch your habits, they become character; -;; watch your character, for it becomes your destiny." -;; -- Lao Tzu -;; -;; -;; f8 - MAIN AGENDA which organizes all tasks and events into: -;; - all unfinished priority A tasks -;; - the weekly schedule, including the habit consistency graph -;; - all priority B tasks -;; -;; C-f8 - PROJECT AGENDA showing the main agenda filtered to a single project. -;; Prompts for project selection, then shows overdue/hi-pri/schedule/B tasks -;; scoped to that project's todo.org plus all calendars and inbox. -;; -;; s-f8 - TASK LIST containing all tasks from all agenda targets. -;; -;; M-f8 - TASK LIST containing all tasks from just the current org-mode buffer. -;; -;; NOTE: -;; Files that contain information relevant to the agenda are: the inbox, the -;; schedule-file, the synced calendars, and the per-project todo.org files found -;; in immediate subdirectories of projects-dir. (org-roam notes are refile -;; targets, not agenda sources -- see org-refile-config.el.) +;; Agenda files come from inbox, schedule files, synced calendars, and immediate +;; project todo.org files. The file list is cached and rebuilt asynchronously to +;; keep normal agenda opens fast. ;;; Code: (require 'user-constants) @@ -278,7 +245,16 @@ scoped to that project's todo.org plus calendars, schedule, and inbox." (file-exists-p (expand-file-name "todo.org" dir)))) all-dirs)) (project-names (mapcar #'file-name-nondirectory project-dirs)) - (chosen (completing-read "Show agenda for project: " project-names nil t)) + (chosen (completing-read + "Show agenda for project: " + (cj/completion-table-annotated + 'cj-agenda-project + (cj/completion-file-annotator + (lambda (c) + (expand-file-name "todo.org" + (expand-file-name c projects-dir)))) + project-names) + nil t)) (todo-file (expand-file-name "todo.org" (expand-file-name chosen projects-dir))) (org-agenda-files (cons todo-file (cj/--org-agenda-base-files)))) diff --git a/modules/org-capture-config.el b/modules/org-capture-config.el index 9f5bfbe7f..14fb8e582 100644 --- a/modules/org-capture-config.el +++ b/modules/org-capture-config.el @@ -345,22 +345,43 @@ Captured On: %U" :prepend t) ) ;; end use-package org-protocol ;; ---------------------- Popup Capture Frame Auto-Close ---------------------- -;; The quick-capture script (Hyprland Super+Shift+N) opens an emacsclient +;; The quick-capture script (Hyprland Super+N) opens an emacsclient ;; frame named "org-capture"; Hyprland window rules float and center it by ;; that name. These hooks close the frame when the capture finalizes or ;; aborts, so the popup never lingers. Frames not named "org-capture" are ;; untouched — normal in-Emacs captures keep their windows. -(defun cj/org-capture--popup-frame-p () - "Return non-nil when the selected frame is the quick-capture popup." - (equal (frame-parameter nil 'name) "org-capture")) - -(defun cj/org-capture--delete-popup-frame () - "Delete the current frame when it is the quick-capture popup." - (when (cj/org-capture--popup-frame-p) - (delete-frame))) - -(add-hook 'org-capture-after-finalize-hook #'cj/org-capture--delete-popup-frame) +(defun cj/org-capture--frame-reapable-p (frame-name buffer-names) + "Non-nil when a frame named FRAME-NAME showing BUFFER-NAMES is a reapable popup. +Reapable means the quick-capture popup (FRAME-NAME equal to \"org-capture\") with +no capture UI left in any window — no *Org Select* menu and no CAPTURE-* buffer. +A popup still mid-capture has capture UI and is not reapable, so it is spared." + (and (equal frame-name "org-capture") + (not (seq-some (lambda (b) + (cj/org-capture--popup-sole-window-p frame-name b)) + buffer-names)))) + +(defun cj/org-capture-reap-popup-frames () + "Delete every quick-capture popup frame that no longer shows capture UI. +Reaps across ALL frames, not just the selected one: a capture that finalizes, +aborts, or errors while the daemon's selected frame is something else (the common +multi-frame case) still cleans up its \"org-capture\" popup, while a popup +mid-capture is spared. Never deletes the last remaining frame. Safe to call +anytime — bound to nothing, run via M-x when a stray popup needs clearing." + (interactive) + (dolist (f (frame-list)) + (when (and (frame-live-p f) + (cdr (frame-list)) ; never delete the last frame + (cj/org-capture--frame-reapable-p + (frame-parameter f 'name) + (mapcar (lambda (w) (buffer-name (window-buffer w))) + (window-list f 'no-minibuf)))) + (delete-frame f)))) + +;; Reap on every capture exit. `remove-hook' first so a live module reload swaps +;; the retired narrow (selected-frame) handler for this one without leaving both. +(remove-hook 'org-capture-after-finalize-hook #'cj/org-capture--delete-popup-frame) +(add-hook 'org-capture-after-finalize-hook #'cj/org-capture-reap-popup-frames) ;; The popup opens a fresh emacsclient frame still showing the daemon's last ;; buffer. `org-mks' shows the *Org Select* menu via @@ -439,9 +460,9 @@ daemon's main frame and the capture would otherwise land there." (when frame (select-frame-set-input-focus frame)) (let ((org-capture-templates (cj/--quick-capture-template inbox-file))) (org-capture nil "t"))) - (quit (cj/org-capture--delete-popup-frame)) + (quit (cj/org-capture-reap-popup-frames)) (error (message "Quick-capture: %s" (error-message-string err)) - (cj/org-capture--delete-popup-frame))))) + (cj/org-capture-reap-popup-frames))))) (provide 'org-capture-config) ;;; org-capture-config.el ends here. diff --git a/modules/org-config.el b/modules/org-config.el index f316ee0df..6f25752f4 100644 --- a/modules/org-config.el +++ b/modules/org-config.el @@ -1,4 +1,4 @@ -;;; org-config --- Settings and Enhancements to Org Mode -*- lexical-binding: t; coding: utf-8; -*- +;;; org-config.el --- Settings and Enhancements to Org Mode -*- lexical-binding: t; coding: utf-8; -*- ;; author Craig Jennings <c@cjennings.net> ;;; Commentary: ;; diff --git a/modules/org-contacts-config.el b/modules/org-contacts-config.el index 64abb9fb5..944d75c10 100644 --- a/modules/org-contacts-config.el +++ b/modules/org-contacts-config.el @@ -168,15 +168,29 @@ Added: %U" ;;; ------------------------- Quick Contact Functions --------------------------- +(require 'system-lib) + (defun cj/org-contacts-find () "Find and open a contact." (interactive) (find-file contacts-file) (goto-char (point-min)) - (let ((contact (completing-read "Find contact: " - (org-map-entries - (lambda () (nth 4 (org-heading-components))) - nil (list contacts-file))))) + (let* ((alist (org-map-entries + (lambda () + (cons (nth 4 (org-heading-components)) + (or (org-entry-get nil "EMAIL") + (org-entry-get nil "PHONE")))) + nil (list contacts-file))) + (contact (completing-read + "Find contact: " + (cj/completion-table-annotated + 'contact + (lambda (cand) + (let ((info (cdr (assoc cand alist)))) + (when (and info (> (length info) 0)) + (concat " " (propertize info 'face + 'completions-annotations))))) + alist)))) (goto-char (point-min)) (search-forward contact) (org-fold-show-entry) diff --git a/modules/org-drill-config.el b/modules/org-drill-config.el index 2c6e400e0..29f6130a2 100644 --- a/modules/org-drill-config.el +++ b/modules/org-drill-config.el @@ -8,7 +8,7 @@ ;; Eager reason: none; optional flashcard workflow, a command-loaded deferral ;; candidate for Phase 4. ;; Top-level side effects: defines a drill keymap, registers it under cj/custom-keymap. -;; Runtime requires: user-constants, keybindings. +;; Runtime requires: user-constants, keybindings, system-lib. ;; Direct test load: yes (requires keybindings explicitly). ;; ;; Notes: Org-Drill @@ -29,6 +29,7 @@ (require 'user-constants) ;; `drill-dir' (require 'keybindings) ;; provides `cj/custom-keymap' +(require 'system-lib) ;; completion table + file annotator (declare-function org-drill "org-drill" (&optional scope drill-match resume-p)) (declare-function org-drill-resume "org-drill" ()) (declare-function org-capture "org-capture" (&optional goto keys)) @@ -57,7 +58,13 @@ drill commands and the drill capture templates share." (defun cj/--drill-pick-file (dir) "Prompt for one of the drill Org files in DIR; return its absolute path." (expand-file-name - (completing-read "Choose flashcard file: " (cj/--drill-files-or-error dir) nil t) + (completing-read "Choose flashcard file: " + (cj/completion-table-annotated + 'cj-drill-file + (cj/completion-file-annotator + (lambda (c) (expand-file-name c dir))) + (cj/--drill-files-or-error dir)) + nil t) dir)) (defun cj/--drill-pick-dir (other-dir) diff --git a/modules/org-webclipper.el b/modules/org-webclipper.el index 99e837e63..40ceada76 100644 --- a/modules/org-webclipper.el +++ b/modules/org-webclipper.el @@ -5,53 +5,29 @@ ;; Layer: 4 (Optional). ;; Category: O/D/P. ;; Load shape: eager. -;; Eager reason: none; web clipping runs via org-protocol/command, a Phase 4 -;; protocol/command-loaded deferral candidate. +;; Eager reason: none; protocol and direct clipping can load on command. ;; Top-level side effects: org-protocol handler registration via use-package. -;; Runtime requires: none (configures packages via use-package). +;; Runtime requires: none. ;; Direct test load: yes. ;; -;; This package provides a seamless "fire-and-forget" workflow for clipping -;; web pages from the browser directly into an Org file using org-protocol -;; and org-web-tools. +;; Captures web pages into Org from org-protocol, EWW, or W3M. The protocol path +;; records URL/title dynamically around org-capture; the direct path clips the +;; current browser buffer. ;; -;; Features: -;; - Browser bookmarklet integration via org-protocol -;; - Automatic conversion to Org format using eww-readable and Pandoc -;; - One-click capture from any web page -;; - Preserves page structure and formatting -;; - Smart heading adjustment (removes page title, demotes remaining headings) -;; -;; Setup: -;; 1. Ensure this file is loaded in your Emacs configuration -;; 2. Make sure emacsclient is configured for org-protocol -;; 3. Add the following bookmarklet to your browser's bookmarks bar: -;; -;; javascript:location.href='org-protocol://webclip?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title);void(0); -;; -;; To add the bookmarklet: -;; a. Create a new bookmark in your browser -;; b. Set the name to: Clip to Org (or your preference) -;; c. Set the URL to the JavaScript code above -;; d. Save it to your bookmarks bar for easy access -;; -;; 4. Click the bookmarklet on any web page to clip its content -;; -;; The clipped content will be added to the file specified by `webclipped-file` -;; under the "Webclipped Inbox" heading with proper formatting and metadata. -;; -;; Architecture: -;; - cj/--process-webclip-content: Pure function for content processing -;; - cj/org-protocol-webclip-handler: Handles URL fetching and capture -;; - cj/org-webclipper-EWW: Direct capture from EWW/W3M buffers -;; -;; Requirements: -;; - org-web-tools package -;; - Pandoc installed on your system -;; - Emacs server running (M-x server-start) +;; Content is converted to readable Org, normalized, and filed under the +;; configured webclip inbox heading. ;;; Code: +(declare-function org-web-tools--url-as-readable-org "org-web-tools") +(declare-function org-w3m-copy-for-org-mode "org-w3m") +(declare-function org-eww-copy-for-org-mode "org-eww") +(declare-function org-capture-get "org-capture") +;; Special vars from org-capture / org-protocol / user-constants, loaded at +;; runtime; declared here so standalone byte-compilation does not warn. +(defvar org-capture-templates) +(defvar org-protocol-protocol-alist) +(defvar webclipped-file) ;; Variables for storing org-protocol data (defvar cj/--webclip-url nil @@ -76,7 +52,6 @@ See `cj/--webclip-url' for the binding contract.") (defun cj/webclipper-ensure-initialized () "Ensure webclipper is initialized when first used." (unless cj/webclipper-initialized - ;; Load required packages now (require 'org-protocol) (require 'org-capture) (require 'org-web-tools) diff --git a/modules/pdf-config.el b/modules/pdf-config.el index 56b397df3..a5dc3c490 100644 --- a/modules/pdf-config.el +++ b/modules/pdf-config.el @@ -1,4 +1,4 @@ -;;; pdf-config --- PDF Viewer Setup -*- lexical-binding: t; coding: utf-8; -*- +;;; pdf-config.el --- PDF Viewer Setup -*- lexical-binding: t; coding: utf-8; -*- ;; author Craig Jennings <c@cjennings.net> ;;; Commentary: diff --git a/modules/prog-c.el b/modules/prog-c.el index 294375cb4..728df0181 100644 --- a/modules/prog-c.el +++ b/modules/prog-c.el @@ -1,4 +1,4 @@ -;;; prog-c --- C Programming Settings and Functionality -*- lexical-binding: t; coding: utf-8; -*- +;;; prog-c.el --- C Programming Settings and Functionality -*- lexical-binding: t; coding: utf-8; -*- ;; author Craig Jennings <c@cjennings.net> ;;; Commentary: diff --git a/modules/prog-general.el b/modules/prog-general.el index f22f89923..15bf40c41 100644 --- a/modules/prog-general.el +++ b/modules/prog-general.el @@ -1,4 +1,4 @@ -;;; prog-general --- General Programming Settings -*- lexical-binding: t; coding: utf-8; -*- +;;; prog-general.el --- General Programming Settings -*- lexical-binding: t; coding: utf-8; -*- ;; author: Craig Jennings <c@cjennings.net> ;;; Commentary: diff --git a/modules/prog-go.el b/modules/prog-go.el index 4b09f29c3..7faf92a08 100644 --- a/modules/prog-go.el +++ b/modules/prog-go.el @@ -1,4 +1,4 @@ -;;; prog-go --- Golang Specific Settings and Functionality -*- lexical-binding: t; coding: utf-8; -*- +;;; prog-go.el --- Golang Specific Settings and Functionality -*- lexical-binding: t; coding: utf-8; -*- ;; author Craig Jennings <c@cjennings.net> ;;; Commentary: diff --git a/modules/prog-lisp.el b/modules/prog-lisp.el index 30c04ad7e..ba568c9c6 100644 --- a/modules/prog-lisp.el +++ b/modules/prog-lisp.el @@ -1,4 +1,4 @@ -;;; prog-lisp --- Lisp Specific Settings and Functionality -*- lexical-binding: t; coding: utf-8; -*- +;;; prog-lisp.el --- Lisp Specific Settings and Functionality -*- lexical-binding: t; coding: utf-8; -*- ;; author Craig Jennings <c@cjennings.net> ;;; Commentary: diff --git a/modules/prog-lsp.el b/modules/prog-lsp.el index 045dda248..1c74bcc10 100644 --- a/modules/prog-lsp.el +++ b/modules/prog-lsp.el @@ -1,4 +1,4 @@ -;;; prog-lsp --- Setup for LSP Mode -*- lexical-binding: t; coding: utf-8; -*- +;;; prog-lsp.el --- Setup for LSP Mode -*- lexical-binding: t; coding: utf-8; -*- ;; author: Craig Jennings <c@cjennings.net> ;;; Commentary: diff --git a/modules/prog-python.el b/modules/prog-python.el index d8556c4d7..6354bd90c 100644 --- a/modules/prog-python.el +++ b/modules/prog-python.el @@ -1,4 +1,4 @@ -;;; prog-python --- Python Specific Setup and Functionality -*- lexical-binding: t; coding: utf-8; -*- +;;; prog-python.el --- Python Specific Setup and Functionality -*- lexical-binding: t; coding: utf-8; -*- ;; author Craig Jennings <c@cjennings.net> ;;; Commentary: diff --git a/modules/prog-shell.el b/modules/prog-shell.el index 45c0afbca..d7f97932b 100644 --- a/modules/prog-shell.el +++ b/modules/prog-shell.el @@ -1,4 +1,4 @@ -;;; prog-shell --- Shell Programming Settings and Functionality -*- lexical-binding: t; coding: utf-8; -*- +;;; prog-shell.el --- Shell Programming Settings and Functionality -*- lexical-binding: t; coding: utf-8; -*- ;; author Craig Jennings <c@cjennings.net> ;;; Commentary: diff --git a/modules/prog-yaml.el b/modules/prog-yaml.el index e07cf510e..71f358c7f 100644 --- a/modules/prog-yaml.el +++ b/modules/prog-yaml.el @@ -1,4 +1,4 @@ -;;; prog-yaml --- YAML Settings -*- lexical-binding: t; coding: utf-8; -*- +;;; prog-yaml.el --- YAML Settings -*- lexical-binding: t; coding: utf-8; -*- ;; author: Craig Jennings <c@cjennings.net> ;;; Commentary: diff --git a/modules/selection-framework.el b/modules/selection-framework.el index 464654a20..7f7f9a475 100644 --- a/modules/selection-framework.el +++ b/modules/selection-framework.el @@ -128,7 +128,6 @@ ;; Optionally tweak the register preview window. (advice-add #'register-preview :override #'consult-register-window) - ;; Configure other variables and modes (setq xref-show-xrefs-function #'consult-xref xref-show-definitions-function #'consult-xref) diff --git a/modules/show-kill-ring.el b/modules/show-kill-ring.el index a6c59e26c..e65d48b5f 100644 --- a/modules/show-kill-ring.el +++ b/modules/show-kill-ring.el @@ -1,4 +1,4 @@ -;;; show-kill-ring --- Displays Previous Kill Ring Entries -*- lexical-binding: t; coding: utf-8; -*- +;;; show-kill-ring.el --- Displays Previous Kill Ring Entries -*- lexical-binding: t; coding: utf-8; -*- ;; Show Kill Ring ;; Stolen from Steve Yegge when he wasn't looking ;; enhancements and bugs added by Craig Jennings <c@cjennings.net> diff --git a/modules/signal-config.el b/modules/signal-config.el index 86cb523ce..edb7d0dc3 100644 --- a/modules/signal-config.el +++ b/modules/signal-config.el @@ -309,7 +309,13 @@ opens the chosen recipient in `signel-chat'." (candidates (cons note-self cj/signel--contact-cache)) (table (lambda (string pred action) (if (eq action 'metadata) - '(metadata + `(metadata + (category . signal-contact) + (annotation-function + . ,(lambda (cand) + (let ((r (cdr (assoc cand candidates)))) + (when r + (concat " " (propertize r 'face 'completions-annotations)))))) (display-sort-function . identity) (cycle-sort-function . identity)) (complete-with-action action candidates string pred)))) diff --git a/modules/system-commands.el b/modules/system-commands.el index 44ac3ae89..de5e88535 100644 --- a/modules/system-commands.el +++ b/modules/system-commands.el @@ -6,14 +6,14 @@ ;; Layer: 3 (Domain Workflow). ;; Category: D/S. ;; Load shape: eager. -;; Eager reason: registers the C-; ! system-command keymap; high-impact commands +;; Eager reason: binds C-; ! to the system-command menu; high-impact commands ;; that should run only by command (command-loaded target). -;; Top-level side effects: defines a system-command keymap under cj/custom-keymap. +;; Top-level side effects: binds C-; ! to the system-command menu in cj/custom-keymap. ;; Runtime requires: keybindings, host-environment, rx. ;; Direct test load: yes (requires keybindings explicitly). ;; ;; System commands for logout, lock, suspend, shutdown, reboot, and Emacs -;; exit/restart. Provides both a keymap (C-; !) and a completing-read menu. +;; exit/restart. C-; ! opens a completing-read menu of all commands. ;; ;; Commands include: ;; - Logout (terminate user session) @@ -28,8 +28,8 @@ ;; ;;; Code: -;; `keybindings' provides `cj/custom-keymap', which is referenced at load -;; time by the `keymap-set' call at the tail of this file. An +;; `keybindings' provides `cj/custom-keymap' and `cj/register-command', +;; referenced at load time by the binding call at the tail of this file. An ;; `eval-when-compile' require would silence the byte-compiler but leave ;; the load-time reference void if anything required `system-commands' ;; before `keybindings'. Make the dependency explicit. @@ -181,29 +181,10 @@ daemon alive rather than killing the session blindly." (when-let ((cmd (alist-get choice commands nil nil #'equal))) (call-interactively cmd)))) -(defvar-keymap cj/system-command-map - :doc "Keymap for system commands." - "!" #'cj/system-command-menu - "L" #'cj/system-cmd-logout - "r" #'cj/system-cmd-reboot - "s" #'cj/system-cmd-shutdown - "S" #'cj/system-cmd-suspend - "l" #'cj/system-cmd-lock - "E" #'cj/system-cmd-exit-emacs - "e" #'cj/system-cmd-restart-emacs) -(cj/register-prefix-map "!" cj/system-command-map) - -(with-eval-after-load 'which-key - (which-key-add-key-based-replacements - "C-; !" "system commands" - "C-; ! !" "system command menu" - "C-; ! L" "logout" - "C-; ! E" "exit Emacs" - "C-; ! S" "suspend" - "C-; ! e" "restart Emacs" - "C-; ! l" "lock screen" - "C-; ! r" "reboot" - "C-; ! s" "shutdown")) +;; C-; ! opens the completing-read menu directly. The per-command leaf +;; keys (s/r/e/l/L/E/S) were removed 2026-06-28 to reclaim the key +;; real-estate; every command stays reachable through the menu. +(cj/register-command "!" #'cj/system-command-menu "system commands") (provide 'system-commands) ;;; system-commands.el ends here diff --git a/modules/system-defaults.el b/modules/system-defaults.el index 6d9c811a6..c63ca0093 100644 --- a/modules/system-defaults.el +++ b/modules/system-defaults.el @@ -1,4 +1,4 @@ -;;; system-defaults --- Non-UI Preferences -*- lexical-binding: t; coding: utf-8-unix; -*- +;;; system-defaults.el --- Non-UI Preferences -*- lexical-binding: t; coding: utf-8-unix; -*- ;; author: Craig Jennings <c@cjennings.net> ;; ;;; Commentary: @@ -266,10 +266,10 @@ appears only once per session." ;; ------------------ Unpropertize Kill Ring For Performance ----------------- -(defun unpropertize-kill-ring () +(defun cj/--unpropertize-kill-ring () (setq kill-ring (mapcar 'substring-no-properties kill-ring))) -(add-hook 'kill-emacs-hook 'unpropertize-kill-ring) +(add-hook 'kill-emacs-hook 'cj/--unpropertize-kill-ring) ;; ------------------------------- GNU 'ls' On BSD ------------------------------- diff --git a/modules/system-lib.el b/modules/system-lib.el index 49bb6cd1a..f1049c021 100644 --- a/modules/system-lib.el +++ b/modules/system-lib.el @@ -164,6 +164,50 @@ contributes its own modes regardless of load order." (setq font-lock-global-modes (cj/--font-lock-global-modes-excluding font-lock-global-modes mode)))) +(defun cj/completion-table (category collection) + "Return a completion table over COLLECTION tagged with completion CATEGORY. +COLLECTION is anything `completing-read' accepts (list, alist, obarray, hash +table, or another table). The table reports CATEGORY in its metadata so +marginalia (and embark, consult, sorting) can recognize and annotate the +candidates. Use a standard category (file, buffer, function, theme, ...) when +the candidates match one; marginalia then annotates them with no further work." + (lambda (string predicate action) + (if (eq action 'metadata) + `(metadata (category . ,category)) + (complete-with-action action collection string predicate)))) + +(defun cj/completion-table-annotated (category annotate collection) + "Like `cj/completion-table' but also attach ANNOTATE as the annotation function. +ANNOTATE is called with a candidate string and returns its annotation suffix, or +nil. Use this for a custom CATEGORY that marginalia has no built-in annotator +for: marginalia falls back to the table's own annotation function." + (lambda (string predicate action) + (if (eq action 'metadata) + `(metadata (category . ,category) + (annotation-function . ,annotate)) + (complete-with-action action collection string predicate)))) + +(defun cj/completion-file-annotator (candidate->path) + "Return an annotation function for completion candidates backed by files. +CANDIDATE->PATH maps a candidate string to its absolute file path, or nil when +the candidate has no backing file. The returned function, suitable as a +completion table's annotation function (see `cj/completion-table-annotated'), +yields a suffix with the file size and modification date for a regular file, +the marker \"dir\" plus the date for a directory, or nil when the path is nil +or the file is missing -- so marginalia then shows no suffix for that +candidate." + (lambda (cand) + (let ((path (funcall candidate->path cand))) + (when (and path (file-exists-p path)) + (let* ((attrs (file-attributes path)) + (dirp (eq t (file-attribute-type attrs))) + (size (if dirp "dir" + (file-size-human-readable (file-attribute-size attrs)))) + (date (format-time-string + "%Y-%m-%d" + (file-attribute-modification-time attrs)))) + (format " %8s %s" size date)))))) + (defun cj/format-region-with-program (program &rest args) "Replace the current buffer with PROGRAM ARGS run over its contents, via argv. Runs PROGRAM (with ARGS) on the whole buffer through `call-process-region' diff --git a/modules/system-utils.el b/modules/system-utils.el index c76193a71..e779026a0 100644 --- a/modules/system-utils.el +++ b/modules/system-utils.el @@ -1,4 +1,4 @@ -;;; system-utils --- System-Wide Utilities -*- lexical-binding: t; coding: utf-8; -*- +;;; system-utils.el --- System-Wide Utilities -*- lexical-binding: t; coding: utf-8; -*- ;; author Craig Jennings <c@cjennings.net> ;; ;;; Commentary: @@ -147,6 +147,22 @@ detached from Emacs." ;; in `nerd-icons-config'. (keymap-global-set "<remap> <list-buffers>" #'ibuffer) +;; Swap delete and diff in the ibuffer list: d diffs the buffer at point against +;; its saved file (was on =), and D marks it for deletion (was on d; `x' still +;; executes the marks). +(defvar ibuffer-mode-map) +(declare-function ibuffer-diff-with-file "ibuffer") +(declare-function ibuffer-mark-for-delete "ibuffer") +(with-eval-after-load 'ibuffer + (keymap-set ibuffer-mode-map "d" #'ibuffer-diff-with-file) + (keymap-set ibuffer-mode-map "D" #'ibuffer-mark-for-delete)) + +;; ibuffer paints its rows with manual `face' properties (nerd-icons + ibuffer +;; faces). Left in `global-font-lock-mode', font-lock leaks keyword fontification +;; onto buffer and mode names, mixing wrong colors in. Exclude it, the same fix +;; as the shr-rendered reader modes. +(cj/exclude-from-global-font-lock 'ibuffer-mode) + ;;; -------------------------- Scratch Buffer Happiness ------------------------- (defvar scratch-emacs-version-and-system diff --git a/modules/term-config.el b/modules/term-config.el deleted file mode 100644 index 474a85c42..000000000 --- a/modules/term-config.el +++ /dev/null @@ -1,558 +0,0 @@ -;;; term-config.el --- Settings for ghostel and the F12 toggle -*- lexical-binding: t; coding: utf-8; -*- -;; author Craig Jennings <c@cjennings.net> - -;;; Commentary: -;; -;; Layer: 3 (Domain Workflow). -;; Category: D/P. -;; Load shape: eager. -;; Eager reason: registers terminal keymaps and the F12 toggle. -;; Top-level side effects: defines two keymaps (one under cj/custom-keymap), one -;; global key, two add-hook, package config. -;; Runtime requires: keybindings, seq, subr-x, cj-window-geometry-lib, -;; cj-window-toggle-lib. -;; Direct test load: yes (requires keybindings explicitly). -;; -;; GHOSTEL -;; ghostel is a native Emacs terminal emulator over libghostty-vt (the Ghostty -;; engine). Like a real terminal, in its default semi-char mode most keys are -;; sent to the running program; `ghostel-keymap-exceptions' lists the keys that -;; reach Emacs instead. We add C-; so the personal prefix keymap works inside -;; ghostel buffers. -;; -;; The module degrades gracefully when ghostel is unavailable (D6 of the -;; migration spec): the package installs via use-package, the native module -;; auto-downloads on first use, and ghostel emits its own warning if the module -;; cannot load. A machine without a prebuilt binary needs Zig to build it; the -;; terminal commands stay defined either way. -;; -;; Two ways to lift text out of a terminal, both with the same key story: -;; - C-; x c enters copy-mode via `cj/term-copy-mode-dwim'. When a tmux -;; client is attached (typical -- `cj/term-launch-tmux' auto-starts tmux), -;; sends tmux's prefix C-b [ then C-a, so the user lands in tmux's own -;; copy-mode with the full pane history and the cursor at column 0 (so -;; scrolling up runs up the left, not the right). Without tmux, falls back to -;; `ghostel-copy-mode' (read-only standard-Emacs navigation over the -;; scrollback; M-w copies and stays, q / C-g exit) and moves point to the -;; start of the line for the same column-0 reason. -;; - C-; x h captures the current tmux pane's full history into a temporary -;; Emacs buffer. -;; In both copy surfaces, M-w copies the active region and stays open so several -;; pieces can be grabbed in a row; C-g / q leave without copying. - -;;; Code: - -(require 'keybindings) -(require 'seq) -(require 'subr-x) -(require 'cj-window-geometry-lib) -(require 'cj-window-toggle-lib) - -(declare-function ghostel "ghostel" (&optional directory)) -(declare-function ghostel-send-string "ghostel" (string)) -(declare-function ghostel-copy-mode "ghostel" ()) -(declare-function ghostel-clear-scrollback "ghostel" ()) -(declare-function ghostel-next-prompt "ghostel" (&optional n)) -(declare-function ghostel-previous-prompt "ghostel" (&optional n)) -(declare-function ghostel-send-next-key "ghostel" ()) -(declare-function ghostel--rebuild-semi-char-keymap "ghostel" ()) -(defvar ghostel-mode-map) -(defvar ghostel-keymap-exceptions) -(defvar ghostel-buffer-name) -(defvar ghostel--input-mode) - -;; eat backs the F12 toggle (see the eat package + F12 toggle sections below). -(declare-function eat "eat" (&optional program arg)) -(defvar eat-buffer-name) -(defvar eat-mode-map) -(defvar eat-semi-char-mode-map) -(defvar cj/custom-keymap) - -(defvar-keymap cj/term-map - :doc "Personal terminal command map.") -;; Lowercase x picked over T for fewer Shift presses; t is the toggle leaf. -(cj/register-prefix-map "x" cj/term-map) - -;; ----------------------------- tmux history ---------------------------------- - -(defvar-local cj/term-tmux-history--origin-buffer nil - "Buffer active before opening the tmux history buffer.") - -(defvar-local cj/term-tmux-history--origin-window nil - "Window active before opening the tmux history buffer.") - -(defvar-local cj/term-tmux-history--origin-point nil - "Point in the origin buffer before opening the tmux history buffer.") - -(defun cj/term--tmux-output (&rest args) - "Run tmux with ARGS and return its stdout. -Signal `user-error' when tmux exits with a non-zero status." - (with-temp-buffer - (let ((exit-code (apply #'process-file "tmux" nil t nil args))) - (unless (zerop exit-code) - (user-error "tmux failed: %s" (string-trim (buffer-string)))) - (buffer-string)))) - -(defun cj/term--tmux-pane-id-for-tty (tty) - "Return the tmux pane id for client TTY." - (let* ((output (cj/term--tmux-output - "list-clients" "-F" "#{client_tty}\t#{pane_id}")) - (lines (split-string output "\n" t)) - (match (seq-find - (lambda (line) - (let ((fields (split-string line "\t"))) - (equal (car fields) tty))) - lines))) - (unless match - (user-error "No tmux client found for terminal tty %s" tty)) - (cadr (split-string match "\t")))) - -(defun cj/term--tmux-capture-pane (pane-id) - "Return full joined tmux history for PANE-ID." - (cj/term--tmux-output - "capture-pane" "-p" "-J" "-S" "-" "-E" "-" "-t" pane-id)) - -(defun cj/term--current-tmux-pane-id () - "Return the tmux pane id for the current ghostel buffer." - (unless (eq major-mode 'ghostel-mode) - (user-error "Current buffer is not a ghostel buffer")) - (let* ((proc (get-buffer-process (current-buffer))) - (tty (and proc (process-tty-name proc)))) - (unless (and tty (not (string-empty-p tty))) - (user-error "Could not determine terminal tty")) - (cj/term--tmux-pane-id-for-tty tty))) - -(defvar-keymap cj/term-tmux-history-mode-map - :doc "Keymap for `cj/term-tmux-history-mode'. -M-w copies the active region without leaving the buffer; C-g, <escape>, or q -returns to the terminal without copying. RET is left unbound." - "M-w" #'kill-ring-save - "C-g" #'cj/term-tmux-history-quit - "<escape>" #'cj/term-tmux-history-quit - "q" #'cj/term-tmux-history-quit) - -(define-derived-mode cj/term-tmux-history-mode special-mode "Tmux History" - "Mode for copying captured tmux pane history with normal Emacs keys." - (setq-local truncate-lines t) - (goto-address-mode 1)) - -(defun cj/term-tmux-history-quit () - "Quit tmux history and return to its origin buffer." - (interactive) - (let ((history-buffer (current-buffer)) - (origin-buffer cj/term-tmux-history--origin-buffer) - (origin-window cj/term-tmux-history--origin-window) - (origin-point cj/term-tmux-history--origin-point)) - (when (buffer-live-p origin-buffer) - (if (window-live-p origin-window) - (progn - (set-window-buffer origin-window origin-buffer) - (select-window origin-window)) - (pop-to-buffer origin-buffer)) - (with-current-buffer origin-buffer - (when (integer-or-marker-p origin-point) - (goto-char origin-point)))) - (when (buffer-live-p history-buffer) - (kill-buffer history-buffer)))) - -(defun cj/term-tmux-history () - "Open full tmux pane history in a temporary Emacs buffer. - -The history buffer uses normal Emacs navigation and selection. `M-w' -copies the active region and stays open, so several pieces can be -copied in a row; `q', `<escape>', or `C-g' returns point to the -terminal buffer that launched it. - -The history view replaces the origin terminal buffer in the same window -\(via `switch-to-buffer'), not a split or a popped-up window." - (interactive) - (let* ((origin-buffer (current-buffer)) - (origin-window (selected-window)) - (origin-point (point)) - (pane-id (cj/term--current-tmux-pane-id)) - (history (cj/term--tmux-capture-pane pane-id)) - (buffer (get-buffer-create - (format "*terminal tmux history: %s*" (buffer-name origin-buffer))))) - (with-current-buffer buffer - (let ((inhibit-read-only t)) - (erase-buffer) - (insert history)) - (cj/term-tmux-history-mode) - (setq-local cj/term-tmux-history--origin-buffer origin-buffer) - (setq-local cj/term-tmux-history--origin-window origin-window) - (setq-local cj/term-tmux-history--origin-point origin-point) - (goto-char (point-max))) - (switch-to-buffer buffer))) - -;; ----------------------------- copy mode ------------------------------------- - -(defun cj/term--in-tmux-p () - "Return non-nil when the current ghostel buffer has a tmux client attached. -Errors from the pane-id lookup (not in ghostel-mode, no tty, no matching -client, tmux not installed) are treated as nil so callers can use this as a -cheap boolean predicate." - (and (eq major-mode 'ghostel-mode) - (condition-case _ - (and (cj/term--current-tmux-pane-id) t) - (error nil)))) - -(defun cj/term-copy-mode-dwim () - "Enter copy-mode using the engine appropriate to this terminal. - -When tmux is attached, write tmux's default prefix sequence (C-b [) into the -pty so the user lands in tmux's copy-mode with the full pane history, then -C-a to land the cursor at the start of the line. Without the trailing C-a -the copy cursor inherits the live column (far right after a prompt) and -scrolling up runs up the right edge; tmux's emacs copy-mode binds C-a to -start-of-line, so column 0 makes it run up the left. Without tmux, falls -through to `ghostel-copy-mode' (a read-only standard-Emacs view of the -scrollback; M-w copies and stays, q / C-g exit), then moves point to the -start of the line for the same column-0 reason." - (interactive) - (if (cj/term--in-tmux-p) - (ghostel-send-string "\C-b[\C-a") - (ghostel-copy-mode) - (beginning-of-line))) - -;; ----------------------------- copy-mode scroll ------------------------------ -;; -;; C-<up> both enters copy-mode and scrolls up one line, so a single stroke -;; lands in the scrollback already moving the right way. It joins -;; `ghostel-keymap-exceptions' so it reaches Emacs instead of the pty. Only the -;; up gesture is bound: C-<left>/<right> are readline word-motion at the shell -;; prompt and must pass through, and the other directions have no copy-mode use. -;; Pressed again while already in copy-mode it just moves up -- re-entering would -;; reset the cursor (tmux's prefix-[ + C-a, or ghostel's toggle exiting). - -(defun cj/term--tmux-pane-in-copy-mode-p (pane-id) - "Return non-nil when tmux PANE-ID is currently displaying a mode. -tmux's `pane_in_mode' is 1 while a pane is in any mode; copy-mode is the only -mode this config enters. tmux failures are treated as nil." - (condition-case nil - (equal "1" (string-trim - (cj/term--tmux-output - "display-message" "-p" "-t" pane-id "#{pane_in_mode}"))) - (error nil))) - -(defun cj/term-copy-mode-up () - "Enter copy-mode if needed, then scroll up one line. -A single C-<up> lands in the terminal's copy-mode already moving up. Pressed -again while already in copy-mode it just moves up another line, so it never -re-enters and resets the cursor. In tmux, writes the up-arrow escape sequence -into the pty; without tmux, moves point up in the `ghostel-copy-mode' buffer." - (interactive) - (let ((pane (ignore-errors (cj/term--current-tmux-pane-id)))) - (cond - (pane - (unless (cj/term--tmux-pane-in-copy-mode-p pane) - (cj/term-copy-mode-dwim)) - (ghostel-send-string "\e[A")) - (t - (unless (eq (bound-and-true-p ghostel--input-mode) 'copy) - (cj/term-copy-mode-dwim)) - (forward-line -1))))) - -;; ----------------------------- ghostel package ------------------------------- - -(defun cj/turn-off-chrome-for-term () - "Turn off line numbers and hl-line in a terminal buffer." - (hl-line-mode -1) - (display-line-numbers-mode -1)) - -(defun cj/term-launch-tmux () - "Auto-launch tmux in a ghostel buffer unless already inside tmux. - -Skipped when `cj/--ai-term-suppress-tmux' is non-nil so the AI-agent flow can -run its own project-named tmux session instead of a bare, auto-named one. -`bound-and-true-p' keeps this safe whether or not ai-term.el is loaded." - (let ((proc (get-buffer-process (current-buffer)))) - (when (and proc - (not (getenv "TMUX")) - (not (bound-and-true-p cj/--ai-term-suppress-tmux))) - (ghostel-send-string "tmux\n")))) - -(use-package ghostel - ;; PINNED at module 0.33.0 (ghostel-20260604.2049, the last pre-rework June-4 - ;; build), installed directly into elpa/ rather than from MELPA. The 0.35.0-0.35.2 - ;; native-PTY rework (worker threads + mutex-outside-read-loop) hard-crashes the - ;; whole Emacs process when a ghostel buffer is displayed: on Linux/glibc a - ;; SIGSETXID handler calls malloc while the main thread holds the arena lock - ;; (ghostel upstream #422); on macOS a recursive os_unfair_lock via - ;; run_window_change_functions (#423). `:ensure t' is satisfied by the present - ;; 0.33.0 dir and will NOT upgrade it -- do NOT `package-upgrade' ghostel until - ;; #422/#423 are fixed upstream, or it returns to the crashing 0.35.x. - :ensure t - :commands (ghostel) - :init - ;; These keys must reach Emacs (not the terminal program) inside ghostel - ;; buffers. In semi-char mode ghostel forwards every key NOT in - ;; `ghostel-keymap-exceptions' to the pty, and `ghostel-semi-char-mode-map' - ;; is rebuilt from that list by `ghostel--rebuild-semi-char-keymap' -- - ;; `add-to-list' alone updates the list but not the already-built map, so the - ;; rebuild is what actually lets the key through to `ghostel-mode-map' / the - ;; global map. C-; and F12 are the prefix + toggle; the modified arrows are - ;; windmove (S-arrows, focus), buffer-move (C-M-arrows, swap), and copy-mode - ;; entry (C-<up> only, via `cj/term-copy-mode-up'), which the ai-term workflow - ;; expects to work from inside an agent buffer. C-<left>/<right> deliberately - ;; stay forwarding so readline word-motion works at the shell prompt. F8 and - ;; F10 are global bindings (org agenda, music-playlist toggle) that reach - ;; Emacs by falling through to the global map once the semi-char map stops - ;; forwarding them. (Server shutdown moved off C-F10 to C-x C, which is - ;; deliberately left forwarding to the terminal program inside an agent - ;; buffer.) - (with-eval-after-load 'ghostel - (dolist (key '("C-;" "<f8>" "<f12>" "<f10>" - "S-<up>" "S-<down>" "S-<left>" "S-<right>" - "C-M-<up>" "C-M-<down>" "C-M-<left>" "C-M-<right>" - "C-<up>")) - (add-to-list 'ghostel-keymap-exceptions key)) - (ghostel--rebuild-semi-char-keymap)) - :hook - ((ghostel-mode . cj/turn-off-chrome-for-term) - (ghostel-mode . cj/term-launch-tmux)) - :custom - (ghostel-kill-buffer-on-exit t) - ;; Auto-download the prebuilt native module on first launch instead of the - ;; default `ask' prompt -- it fetches the platform release asset from GitHub - ;; (for the pinned 0.33.0 source this resolves to the matching v0.33.0 module). - ;; The compile-from-source fallback also works here: zig 0.15.2 is installed at - ;; /usr/local/bin/zig (see M-x ghostel-module-compile). - (ghostel-module-auto-install 'download) - ;; Byte analog of the prior 100000-line vterm setting (~100 bytes/line) -- D7. - (ghostel-max-scrollback (* 10 1024 1024))) - -;; ------------------------------- eat package --------------------------------- -;; EAT (pure-elisp terminal) backs the F12 toggle: its whole palette is real -;; Emacs faces, so it themes from the theme. ghostel stays for ai-term (M-SPC). -;; No tmux here -- F12's EAT runs a plain $SHELL (decision 2026-06-25). - -(use-package eat - :ensure t - :commands (eat) - :hook (eat-mode . cj/turn-off-chrome-for-term) - :custom - ;; Close the EAT buffer when its shell exits (mirrors ghostel-kill-buffer-on-exit). - (eat-kill-buffer-on-exit t) - :config - ;; F12 and C-; must reach Emacs from inside EAT. In semi-char mode (EAT's - ;; default) EAT forwards unbound keys to the terminal -- a letter runs - ;; `eat-self-input' -- so bind these explicitly or they never reach Emacs: - ;; F12 toggles the terminal window, C-; opens the global prefix map. - (keymap-set eat-semi-char-mode-map "<f12>" #'cj/term-toggle) - (keymap-set eat-semi-char-mode-map "C-;" cj/custom-keymap) - (keymap-set eat-mode-map "<f12>" #'cj/term-toggle) - (keymap-set eat-mode-map "C-;" cj/custom-keymap)) - -;; ----------------------- F12 toggle (custom) ----------------------- -;; -;; Mirrors the geometry-preservation pattern shared with ai-term.el: capture -;; direction + body size at toggle-off, replay them via a custom display action -;; using frame-edge directions and body-relative sizes so the result is -;; divider-independent and layout-stable. Manages the EAT terminal only; -;; ai-term.el's ghostel agent buffers are separate (M-SPC). - -(defcustom cj/term-toggle-window-height 0.7 - "Default fraction of frame height for the F12 terminal window. -Used as the size fallback when F12 docks the terminal as a bottom split." - :type 'number - :group 'term) - -(defcustom cj/term-toggle-window-width 0.5 - "Default fraction of frame width for the F12 terminal window. -Used as the size fallback when F12 docks the terminal as a right-side -column (see `cj/--term-toggle-default-direction')." - :type 'number - :group 'term) - -(defun cj/--term-toggle-default-direction () - "Return the default dock direction for the F12 terminal: `right' or `below'. -Docks as a right-side column only when a side-by-side split would leave -both panes at least `cj/window-dock-min-columns' wide (the terminal's -share is `cj/term-toggle-window-width'); otherwise stacks below. See -`cj/preferred-dock-direction'." - (cj/preferred-dock-direction (frame-width) cj/term-toggle-window-width)) - -(defun cj/--term-toggle-default-size (direction) - "Return the default size fraction paired with DIRECTION for the F12 terminal. -`cj/term-toggle-window-width' for `right', `cj/term-toggle-window-height' -otherwise." - (if (eq direction 'right) - cj/term-toggle-window-width - cj/term-toggle-window-height)) - -(defvar cj/--term-toggle-last-direction nil - "Last user-chosen direction for the F12 terminal display. -Symbol: right, left, or below. `above' is never stored. nil means use the -default `below' for F12's traditional bottom split.") - -(defvar cj/--term-toggle-last-size nil - "Last user-chosen size for the F12 terminal display. -Positive integer: body-cols (right/left) or total-lines (below/above) -- see -`cj/window-replay-size' for why the vertical axis uses total, not body. -nil means fall back to `cj/term-toggle-window-height' as a fraction.") - -(defun cj/--term-toggle-buffer-p (buffer) - "Return non-nil when BUFFER is the EAT terminal F12 should manage. - -Qualifies when BUFFER is alive and has `eat-mode' (or its name starts with the -EAT buffer-name prefix). ai-term's ghostel agent buffers never match -- they -are managed separately via M-SPC, not F12." - (and (bufferp buffer) - (buffer-live-p buffer) - (with-current-buffer buffer - (or (eq major-mode 'eat-mode) - (string-prefix-p (or (bound-and-true-p eat-buffer-name) - "*eat*") - (buffer-name buffer)))))) - -(defun cj/--term-toggle-buffers () - "Return live F12-managed terminal buffers in `buffer-list' (MRU) order." - (seq-filter #'cj/--term-toggle-buffer-p (buffer-list))) - -(defun cj/--term-toggle-displayed-window (&optional frame) - "Return a window in FRAME currently displaying an F12 terminal buffer, or nil. -FRAME defaults to the selected frame. Minibuffer is excluded." - (seq-find (lambda (w) - (cj/--term-toggle-buffer-p (window-buffer w))) - (window-list (or frame (selected-frame)) 'never))) - -(defun cj/--term-toggle-capture-state (window) - "Capture WINDOW's direction + body size into module-level state. -The default direction (used when WINDOW fills its frame) is the -column-rule choice from `cj/--term-toggle-default-direction'." - (cj/window-toggle-capture-state - window (cj/--term-toggle-default-direction) - 'cj/--term-toggle-last-direction - 'cj/--term-toggle-last-size - '(right below left))) - -(defun cj/--term-toggle-display-saved (buffer alist) - "Display-buffer action: split per saved direction and body size. -Delegates to `cj/window-toggle-display-saved' against the F12 state vars, -falling back to the column-rule default direction -\(`cj/--term-toggle-default-direction') and its paired size." - (let ((dir (cj/--term-toggle-default-direction))) - (cj/window-toggle-display-saved - buffer alist - 'cj/--term-toggle-last-direction dir - 'cj/--term-toggle-last-size (cj/--term-toggle-default-size dir)))) - -(defun cj/--term-toggle-display-rule-list () - "Return the `display-buffer-alist' entry list installed by F12. -Routes any terminal buffer satisfying `cj/--term-toggle-buffer-p' through -reuse-window then the saved-geometry action. Excludes agent buffers." - '(((lambda (buffer-or-name _) - (cj/--term-toggle-buffer-p (get-buffer buffer-or-name))) - (display-buffer-reuse-window - cj/--term-toggle-display-saved) - (inhibit-same-window . t)))) - -(dolist (entry (cj/--term-toggle-display-rule-list)) - (add-to-list 'display-buffer-alist entry)) - -(defun cj/--term-toggle-dispatch () - "Compute the F12 (`cj/term-toggle') action without performing it. - -Returns one of: -- (toggle-off . WINDOW) -- terminal displayed in WINDOW; hide it. -- (show-recent . BUFFER) -- terminal alive but not shown; redisplay. -- (create-new) -- no terminal buffer alive; create one." - (let ((win (cj/--term-toggle-displayed-window))) - (cond - (win (cons 'toggle-off win)) - (t - (let ((buffers (cj/--term-toggle-buffers))) - (cond - (buffers (cons 'show-recent (car buffers))) - (t '(create-new)))))))) - -(defun cj/term-toggle () - "Toggle the EAT terminal buffer. - -- If the EAT terminal is displayed in this frame, capture its geometry and - delete its window (toggle off). Falls back to burying when it is the only - window in the frame. -- Otherwise, if the EAT terminal buffer is alive, display it via the - saved-geometry action. -- Otherwise, create a new EAT terminal, displaying it through the same - saved-geometry action. - -ai-term's ghostel agent buffers are managed separately via M-SPC, not F12." - (interactive) - (pcase (cj/--term-toggle-dispatch) - (`(toggle-off . ,win) - (cj/--term-toggle-capture-state win) - (if (one-window-p) - (bury-buffer (window-buffer win)) - (delete-window win)) - nil) - (`(show-recent . ,buf) - (display-buffer buf) - (let ((w (get-buffer-window buf))) - (when w (select-window w))) - buf) - (`(create-new) - ;; Create the EAT buffer without stealing the layout, then display it - ;; through the saved-geometry dock rule (same path as show-recent). - (save-window-excursion (eat)) - (let ((buf (get-buffer (or (bound-and-true-p eat-buffer-name) "*eat*")))) - (when buf - (display-buffer buf) - (let ((w (get-buffer-window buf))) - (when w (select-window w)))) - buf)))) - -(keymap-global-set "<f12>" #'cj/term-toggle) - -;; ----------------------------- prefix menu ----------------------------------- - -(keymap-set cj/term-map "c" #'cj/term-copy-mode-dwim) -(keymap-set cj/term-map "h" #'cj/term-tmux-history) -(keymap-set cj/term-map "l" #'ghostel-clear-scrollback) -(keymap-set cj/term-map "N" #'ghostel) -(keymap-set cj/term-map "n" #'ghostel-next-prompt) -(keymap-set cj/term-map "p" #'ghostel-previous-prompt) -(keymap-set cj/term-map "q" #'ghostel-send-next-key) -(keymap-set cj/term-map "t" #'cj/term-toggle) - -(defun cj/term-send-C-SPC () - "Forward C-SPC (NUL) to the terminal instead of setting an Emacs mark. - -ghostel forwards the `C-@' event but not the distinct `C-SPC' event GUI -Emacs produces, so a bare C-SPC in a ghostel buffer falls through to the -global `set-mark-command'. That sets an Emacs region in the terminal buffer -that follows point as output streams (a stuck \"selection\" C-g / Escape -can't clear) and, worse, never reaches tmux -- so tmux copy-mode's -begin-selection (C-Space) never starts and M-w then copies nothing. -Forwarding NUL makes C-Space behave like a terminal key." - (interactive) - (ghostel-send-string "\C-@")) - -(defun cj/term-install-keys () - "Make `C-;' resolve as the personal keymap inside ghostel buffers, bind the -F12 toggle, forward C-SPC so it reaches the terminal (see -`cj/term-send-C-SPC'), and bind C-<up> to enter copy-mode and scroll up." - (when (boundp 'ghostel-mode-map) - (keymap-set ghostel-mode-map "C-;" cj/custom-keymap) - (keymap-set ghostel-mode-map "<f12>" #'cj/term-toggle) - (keymap-set ghostel-mode-map "C-SPC" #'cj/term-send-C-SPC) - (keymap-set ghostel-mode-map "C-<up>" #'cj/term-copy-mode-up))) - -(cj/term-install-keys) -(with-eval-after-load 'ghostel - (cj/term-install-keys)) - -(with-eval-after-load 'which-key - (which-key-add-key-based-replacements - "C-; x" "terminal menu" - "C-; x c" "copy mode (tmux/ghostel)" - "C-; x h" "tmux scrollback history" - "C-; x l" "clear scrollback" - "C-; x N" "new terminal" - "C-; x n" "next prompt" - "C-; x p" "previous prompt" - "C-; x q" "send next key to terminal" - "C-; x t" "toggle terminal")) - -(provide 'term-config) -;;; term-config.el ends here. diff --git a/modules/test-runner.el b/modules/test-runner.el index 50d4f7e40..e05145e4e 100644 --- a/modules/test-runner.el +++ b/modules/test-runner.el @@ -6,74 +6,24 @@ ;; Layer: 2 (Core UX). ;; Category: C/L. ;; Load shape: eager. -;; Eager reason: the test keymap entry point and project-scoped runner state. -;; Top-level side effects: defines a test keymap, registers it under cj/custom-keymap. -;; Runtime requires: ert, cl-lib, keybindings. -;; Direct test load: yes (requires keybindings explicitly). +;; Eager reason: registers the C-; t test runner entry point and state. +;; Top-level side effects: defines and registers cj/test-map. +;; Runtime requires: ert, cl-lib, keybindings, system-lib. +;; Direct test load: yes. ;; -;; This module provides a powerful ERT test runner with focus/unfocus workflow -;; for efficient test-driven development in Emacs Lisp projects. -;; -;; PURPOSE: -;; -;; When working on large Emacs Lisp projects with many test files, you often -;; want to focus on running just the tests relevant to your current work without -;; waiting for the entire suite to run. This module provides a smart test runner -;; that supports both running all tests and focusing on specific test files. -;; -;; WORKFLOW: -;; -;; 1. Run all tests initially to establish baseline (C-; t R) -;; 2. Add test files to focus while working on a feature (C-; t a) -;; 3. Run focused tests repeatedly as you develop (C-; t r) -;; 4. Add more test files as needed (C-; t b from within test buffer) -;; 5. View your focused test list at any time (C-; t v) -;; 6. Clear focus and run all tests before finishing (C-; t c, then C-; t R) -;; -;; PROJECT INTEGRATION: -;; -;; - Automatically discovers test directories in Projectile projects -;; (looks for "test" or "tests" under project root) -;; - Falls back to ~/.emacs.d/tests if not in a Projectile project -;; - Test files must match pattern: test-*.el -;; -;; SPECIAL BEHAVIORS: -;; -;; - Smart test running: Automatically runs all or focused tests based on mode -;; - Test extraction: Discovers test names via regex to run specific tests -;; - At-point execution: Run individual test at cursor position (C-; t .) -;; - Error handling: Continues loading tests even if individual files fail -;; -;; KEYBINDINGS: -;; -;; C-; t L Load all test files -;; C-; t R Run all tests (full suite) -;; C-; t r Run tests smartly (all or focused based on mode) -;; C-; t . Run test at point -;; C-; t a Add test file to focus (with completion) -;; C-; t b Add current buffer's test file to focus -;; C-; t c Clear all focused test files -;; C-; t v View list of focused test files -;; C-; t t Toggle mode between 'all and 'focused -;; -;; RECOMMENDED USAGE: -;; -;; While implementing a feature: -;; - Add the main test file for the feature you're working on -;; - Add any related test files that might be affected -;; - Use C-; t r to repeatedly run just those focused tests -;; - This provides fast feedback during development -;; -;; Before committing: -;; - Clear the focus with C-; t c -;; - Run the full suite with C-; t R to ensure nothing broke -;; - Verify all tests pass before pushing changes +;; Project-aware ERT runner with two modes: all tests or a focused file set. +;; Test roots come from Projectile projects, falling back to the config's tests +;; directory, and test files are discovered by the test-*.el convention. ;; +;; Commands under C-; t load tests, run all/focused tests, run the test at point, +;; and manage the per-project focus list. + ;;; Code: (require 'ert) (require 'cl-lib) (require 'keybindings) ;; provides cj/custom-keymap +(require 'system-lib) ;; completion table + file annotator ;;; External Variables and Functions @@ -260,7 +210,11 @@ Returns: \\='success if added successfully, :test #'string=)) (selected (if unfocused-files (completing-read "Add test file to focus: " - unfocused-files + (cj/completion-table-annotated + 'cj-test-file + (cj/completion-file-annotator + (lambda (c) (expand-file-name c dir))) + unfocused-files) nil t) (user-error "All test files are already focused")))) (pcase (cj/test--do-focus-add selected available-files focused-files) @@ -329,7 +283,13 @@ Returns: \\='success if removed successfully, (if (null focused-files) (user-error "No focused files to remove") (let ((selected (completing-read "Remove from focus: " - focused-files + (cj/completion-table-annotated + 'cj-test-file + (cj/completion-file-annotator + (lambda (c) + (expand-file-name + c (cj/test--get-test-directory)))) + focused-files) nil t))) (pcase (cj/test--do-focus-remove selected focused-files) ('success diff --git a/modules/text-config.el b/modules/text-config.el index 14e06f3e8..dd7bd3cac 100644 --- a/modules/text-config.el +++ b/modules/text-config.el @@ -1,4 +1,4 @@ -;;; text-config --- Text Settings and Functionality -*- lexical-binding: t; coding: utf-8; -*- +;;; text-config.el --- Text Settings and Functionality -*- lexical-binding: t; coding: utf-8; -*- ;; author Craig Jennings <c@cjennings.net> ;;; Commentary: diff --git a/modules/tramp-config.el b/modules/tramp-config.el index e3b835f1f..f2bc8457c 100644 --- a/modules/tramp-config.el +++ b/modules/tramp-config.el @@ -57,7 +57,6 @@ (setq tramp-auto-save-directory (expand-file-name "tramp-auto-save" user-emacs-directory)) - ;; Create directory if it doesn't exist (unless (file-exists-p tramp-auto-save-directory) (make-directory tramp-auto-save-directory t)) diff --git a/modules/transcription-config.el b/modules/transcription-config.el index e00306d1e..944063b88 100644 --- a/modules/transcription-config.el +++ b/modules/transcription-config.el @@ -195,6 +195,8 @@ transcript lands alongside the source, not next to the temp /tmp audio." (txt-file (car outputs)) (log-file (cdr outputs)) (buffer-name (format " *transcribe-%s*" (file-name-nondirectory audio-file))) + (stderr-buffer-name (format " *transcribe-stderr-%s*" + (file-name-nondirectory audio-file))) (process-name (format "transcribe-%s" (file-name-nondirectory audio-file)))) (unless (file-executable-p script) @@ -203,15 +205,25 @@ transcript lands alongside the source, not next to the temp /tmp audio." (cj/--init-log-file log-file audio-file script) (let* ((process-environment (cj/--build-process-environment cj/transcribe-backend)) + ;; A live, explicitly-managed buffer for stderr. Passing a file PATH + ;; to :stderr makes Emacs create a phantom buffer named after the + ;; path, so the error text never reaches the log file and that buffer + ;; leaks per run; the sentinel drains this buffer into the log and + ;; kills it. Keeping stderr off the stdout :buffer leaves the + ;; transcript (stdout) clean. + (stderr-buffer (with-current-buffer (get-buffer-create stderr-buffer-name) + (erase-buffer) + (current-buffer))) (process (make-process :name process-name :buffer (get-buffer-create buffer-name) :command (list script audio-file) :sentinel (lambda (proc event) - (cj/--transcription-sentinel proc event audio-file txt-file log-file) + (cj/--transcription-sentinel proc event audio-file + txt-file log-file stderr-buffer) (when cleanup-file (ignore-errors (delete-file cleanup-file)))) - :stderr log-file))) + :stderr stderr-buffer))) (cj/--track-transcription process audio-file) (cj/--notify "Transcription" (format "Started on %s" (file-name-nondirectory audio-file))) @@ -294,20 +306,25 @@ References TXT-FILE on success (normal urgency), LOG-FILE on failure (format "Errored. Logs in %s" (file-name-nondirectory log-file)) 'critical))) -(defun cj/--transcription-sentinel (process event _audio-file txt-file log-file) +(defun cj/--transcription-sentinel (process event _audio-file txt-file log-file stderr-buffer) "Sentinel for transcription PROCESS. EVENT is the process event string. TXT-FILE and LOG-FILE are the -associated output files." +associated output files. STDERR-BUFFER holds the process's stderr; its +contents are appended to LOG-FILE so the \"Logs in <file>\" notification +points at real error text, and the buffer is then killed so it does not +leak per run." (let* ((success-p (and (string-match-p "finished" event) (= 0 (process-exit-status process)))) (process-buffer (process-buffer process))) (cj/--write-transcript-on-success process-buffer success-p txt-file) - (cj/--append-to-log process-buffer log-file event) + (cj/--append-to-log stderr-buffer log-file event) (cj/--update-transcription-status process success-p) (when (and success-p (not (cj/--should-keep-log success-p))) (delete-file log-file)) (when (buffer-live-p process-buffer) (kill-buffer process-buffer)) + (when (buffer-live-p stderr-buffer) + (kill-buffer stderr-buffer)) (cj/--notify-completion success-p txt-file log-file) (run-at-time 600 nil #'cj/--cleanup-completed-transcriptions) (force-mode-line-update t))) diff --git a/modules/ui-config.el b/modules/ui-config.el index 32bd393f5..fbc3d91c1 100644 --- a/modules/ui-config.el +++ b/modules/ui-config.el @@ -1,4 +1,4 @@ -;;; ui-config --- User Interface Preferences -*- lexical-binding: t; coding: utf-8; -*- +;;; ui-config.el --- User Interface Preferences -*- lexical-binding: t; coding: utf-8; -*- ;; author: Craig Jennings <c@cjennings.net> ;;; Commentary: diff --git a/modules/ui-navigation.el b/modules/ui-navigation.el index cb0fc5697..7ec56e078 100644 --- a/modules/ui-navigation.el +++ b/modules/ui-navigation.el @@ -1,4 +1,4 @@ -;;; ui-navigation --- Managing Cursor Placement, Buffers, and Windows -*- lexical-binding: t; coding: utf-8; -*- +;;; ui-navigation.el --- Managing Cursor Placement, Buffers, and Windows -*- lexical-binding: t; coding: utf-8; -*- ;; author Craig Jennings <c@cjennings.net> ;;; Commentary: @@ -110,7 +110,9 @@ existing split does. No-op when SIDE is nil." (defun cj/window-resize-sticky () "Resize the active window's divider in the just-pressed arrow's direction \(via `windsize'), then keep `cj/window-resize-map' active so bare arrows keep -nudging until any other key. Bound to `C-; b <left>/<right>/<up>/<down>'. +nudging until any other key. Bound to `C-; b <arrow>' and to the global +`M-<arrow>' keys (each direction); the arrow is read with `event-basic-type', +so the Meta modifier on the M-<arrow> path is stripped and both behave alike. When the selected window is the sole window in the frame there is no divider to move, so the first arrow instead splits a sliver away on the @@ -119,13 +121,21 @@ buffer; the current window keeps almost the whole frame and the following arrows shrink it via `windsize', so it reads the same as resizing an existing split." (interactive) - (let ((key (key-description (vector last-command-event)))) + (let ((key (format "<%s>" (event-basic-type last-command-event)))) (if (one-window-p) (cj/window--pull-away (cj/window-pull-side key)) (let ((cmd (keymap-lookup cj/window-resize-map key))) (when cmd (call-interactively cmd))))) (set-transient-map cj/window-resize-map t)) +;; M-<arrow> mirrors `C-; b <arrow>': one chord to pull a split from a sole +;; window or nudge a divider. M-<up>/<down> are otherwise unbound; M-<left>/ +;; <right> shed their word-motion, which stays on `C-<left>'/`C-<right>'. +(keymap-global-set "M-<left>" #'cj/window-resize-sticky) +(keymap-global-set "M-<right>" #'cj/window-resize-sticky) +(keymap-global-set "M-<up>" #'cj/window-resize-sticky) +(keymap-global-set "M-<down>" #'cj/window-resize-sticky) + ;; ------------------------------ Window Splitting ----------------------------- (defun cj/split-and-follow-right () diff --git a/modules/ui-theme.el b/modules/ui-theme.el index eb4efd9b5..499e71a49 100644 --- a/modules/ui-theme.el +++ b/modules/ui-theme.el @@ -37,13 +37,17 @@ ;; ------------------------------- Switch Themes ------------------------------- ;; loads themes in completing read, then persists via the functions below +(require 'system-lib) + (defun cj/switch-themes () "Function to switch themes and save chosen theme name for persistence. Unloads any other applied themes before applying the chosen theme." (interactive) (let ((chosentheme (completing-read "Load custom theme: " - (mapcar #'symbol-name - (custom-available-themes))))) + (cj/completion-table + 'theme + (mapcar #'symbol-name + (custom-available-themes)))))) (cj/theme-disable-all) (cj/theme-load-name chosentheme)) (cj/save-theme-to-file)) diff --git a/modules/undead-buffers.el b/modules/undead-buffers.el index fe43575e9..4780ef227 100644 --- a/modules/undead-buffers.el +++ b/modules/undead-buffers.el @@ -32,7 +32,13 @@ (defvar cj/undead-buffer-list '("*scratch*" "*EMMS-Playlist*" "*Messages*" "*ert*" "*AI-Assistant*") - "Buffers to bury instead of killing.") + "Buffer names to bury instead of killing (exact match).") + +(defvar cj/undead-buffer-regexps nil + "Regexps for buffer names to bury instead of killing, alongside +`cj/undead-buffer-list'. Use for dynamically-named buffer families where an +exact name can't be pre-listed -- e.g. ai-term agents, named \"agent [<project>]\". +Register one with `cj/make-buffer-pattern-undead'.") (defun cj/make-buffer-undead (name) "Append NAME to `cj/undead-buffer-list' if not present. @@ -41,6 +47,23 @@ Signal an error if NAME is not a non-empty string. Return the updated list." (error "cj/bury-alive-add: NAME must be a non-empty string")) (add-to-list 'cj/undead-buffer-list name t)) +(defun cj/make-buffer-pattern-undead (regexp) + "Append REGEXP to `cj/undead-buffer-regexps' if not present. +A buffer whose name matches REGEXP is buried instead of killed. Signal an +error if REGEXP is not a non-empty string. Return the updated list." + (unless (and (stringp regexp) (> (length regexp) 0)) + (error "cj/make-buffer-pattern-undead: REGEXP must be a non-empty string")) + (add-to-list 'cj/undead-buffer-regexps regexp t)) + +(defun cj/--buffer-undead-p (name) + "Return non-nil when buffer NAME should be buried instead of killed. +NAME is undead when it is in `cj/undead-buffer-list' (exact) or matches any +regexp in `cj/undead-buffer-regexps'." + (and (stringp name) + (or (member name cj/undead-buffer-list) + (seq-some (lambda (re) (string-match-p re name)) + cj/undead-buffer-regexps)))) + (defun cj/kill-buffer-or-bury-alive (buffer) "Kill BUFFER or bury it if it's in `cj/undead-buffer-list'." (interactive "bBuffer to kill or bury: ") @@ -49,7 +72,7 @@ Signal an error if NAME is not a non-empty string. Return the updated list." (progn (add-to-list 'cj/undead-buffer-list (buffer-name)) (message "Added %s to bury-alive-list" (buffer-name))) - (if (member (buffer-name) cj/undead-buffer-list) + (if (cj/--buffer-undead-p (buffer-name)) (bury-buffer) (kill-buffer))))) (keymap-global-set "<remap> <kill-buffer>" #'cj/kill-buffer-or-bury-alive) @@ -60,7 +83,7 @@ Undead-buffers are buffers in `cj/undead-buffer-list'." (let* ((buf (current-buffer)) (name (buffer-name buf))) (and - (not (member name cj/undead-buffer-list)) + (not (cj/--buffer-undead-p name)) (buffer-file-name buf) (buffer-modified-p buf)))) diff --git a/modules/vc-config.el b/modules/vc-config.el index fcca7e07b..60fcaeb89 100644 --- a/modules/vc-config.el +++ b/modules/vc-config.el @@ -8,7 +8,7 @@ ;; Eager reason: the C-x g Magit entry point and the git keymap. ;; Top-level side effects: defines two keymaps, registers under cj/custom-keymap, ;; package configuration via use-package. -;; Runtime requires: user-constants, keybindings. +;; Runtime requires: user-constants, keybindings, system-lib. ;; Direct test load: yes (requires keybindings explicitly). ;; ;; C-x g is my general entry to Magit's version control via the status page. @@ -26,6 +26,7 @@ (require 'user-constants) ;; provides code-dir (require 'keybindings) ;; provides cj/custom-keymap +(require 'system-lib) ;; completion table + file annotator ;; Forward declaration: cj/vc-map is defined later in this file (see ;; `defvar-keymap' below) but referenced earlier in a use-package :bind form. @@ -199,7 +200,13 @@ repository's README if found, else `dired's the clone." (read-directory-name "Clone to: " code-dir)) ;; C-u: Choose from configured list (current-prefix-arg - (completing-read "Clone to: " cj/git-clone-dirs nil t)) + (completing-read "Clone to: " + (cj/completion-table-annotated + 'cj-clone-dir + (cj/completion-file-annotator + (lambda (c) (expand-file-name c))) + cj/git-clone-dirs) + nil t)) ;; No prefix: Use default (first in list) (t (car cj/git-clone-dirs))))) diff --git a/modules/video-audio-recording-capture.el b/modules/video-audio-recording-capture.el new file mode 100644 index 000000000..069975bc3 --- /dev/null +++ b/modules/video-audio-recording-capture.el @@ -0,0 +1,394 @@ +;;; video-audio-recording-capture.el --- ffmpeg capture engine and process lifecycle -*- lexical-binding: t; coding: utf-8; -*- + +;; Author: Craig Jennings <c@cjennings.net> + +;;; Commentary: +;; +;; Layer: 4 (Optional). +;; Category: O/S. +;; Load shape: library. +;; Top-level side effects: none (defuns only). +;; Runtime requires: subr-x, system-lib, video-audio-recording-devices. +;; Direct test load: yes (requires video-audio-recording-devices explicitly). +;; +;; Capture engine for video-audio-recording: ffmpeg / wf-recorder command +;; construction, the recording process lifecycle (sentinel, graceful +;; producer-first shutdown, exit polling), the modeline indicator, +;; dependency checks, device acquisition and validation, and the start/stop +;; entry points. Builds on the devices layer for discovery and selection. +;; +;; Configuration and the recording process-handle variables are owned by +;; the top video-audio-recording module; they are forward-declared here so +;; the engine reads and updates them without a back-require onto the top +;; module. + +;;; Code: + +(require 'subr-x) +(require 'system-lib) ;; provides cj/log-silently +(require 'video-audio-recording-devices) + +;; Configuration and process-handle state owned by the top module; +;; declared special here so the engine reads and updates them without a +;; back-require onto video-audio-recording.el. +(defvar cj/recording-mic-boost) +(defvar cj/recording-system-volume) +(defvar cj/recording-mic-device) +(defvar cj/recording-system-device) +(defvar cj/video-recording-ffmpeg-process) +(defvar cj/audio-recording-ffmpeg-process) + +;;; Modeline Indicator + +(defun cj/recording-modeline-indicator () + "Return modeline string showing active recordings. +Shows 🎤 (microphone) for audio, 🎬 (clapper board) for video. +Checks if process is actually alive, not just if variable is set." + (let ((audio-active (and cj/audio-recording-ffmpeg-process + (process-live-p cj/audio-recording-ffmpeg-process))) + (video-active (and cj/video-recording-ffmpeg-process + (process-live-p cj/video-recording-ffmpeg-process)))) + (cond + ((and audio-active video-active) " 🎤🎬 ") + (audio-active " 🎤 ") + (video-active " 🎬 ") + (t "")))) + +;;; Process Lifecycle (Sentinel and Graceful Shutdown) + +(defun cj/recording-process-sentinel (process event) + "Sentinel for recording processes — handles unexpected exits. +PROCESS is the ffmpeg shell process, EVENT describes what happened. +This is called by Emacs when the process changes state (exits, is +killed, etc.). It clears the process variable and updates the modeline +so the recording indicator disappears even if the recording crashes or +is killed externally." + (when (memq (process-status process) '(exit signal)) + (cond + ((eq process cj/audio-recording-ffmpeg-process) + (setq cj/audio-recording-ffmpeg-process nil) + (message "Audio recording stopped: %s" (string-trim event))) + ((eq process cj/video-recording-ffmpeg-process) + (setq cj/video-recording-ffmpeg-process nil) + (message "Video recording stopped: %s" (string-trim event)))) + (force-mode-line-update t))) + +(defun cj/recording--wait-for-exit (process timeout-secs) + "Wait for PROCESS to exit, polling until done or TIMEOUT-SECS elapsed. +Returns t if the process exited within the timeout, nil if it timed out. + +This replaces fixed `sit-for' delays with an actual check that ffmpeg has +finished writing its output file. Container finalization (writing index +tables, flushing buffers) can take several seconds for large recordings, +so a fixed 0.5s wait was causing zero-byte output files." + (let ((deadline (+ (float-time) timeout-secs))) + (while (and (process-live-p process) + (< (float-time) deadline)) + (accept-process-output process 0.1)) + (not (process-live-p process)))) + +;;; Dependency Checks + +(defun cj/recording-check-ffmpeg () + "Check if ffmpeg is available. Error if not found." + (unless (executable-find "ffmpeg") + (user-error "Ffmpeg not found. Install with: sudo pacman -S ffmpeg") + nil) + t) + +(defun cj/recording--wayland-p () + "Return non-nil if running under Wayland." + (string= (getenv "XDG_SESSION_TYPE") "wayland")) + +(defun cj/recording--check-wf-recorder () + "Check if wf-recorder is available (needed for Wayland video capture)." + (if (executable-find "wf-recorder") + t + (user-error "wf-recorder not found. Install with: sudo pacman -S wf-recorder") + nil)) + +;;; Device Acquisition and Validation + +(defun cj/recording-quick-setup () + "Quick device setup for recording — two-step mic + sink selection. +Step 1: Pick a microphone. Each mic shows its status: + [in use] = an app is actively using this mic + [ready] = recently used, still open + [available] = no app has this mic open + [muted] = device is muted in PulseAudio +Step 2: Pick an audio output to capture. Same status labels, plus +application names for outputs with active streams (e.g. \"Firefox\"). +Devices are sorted: in use → ready → available → muted. +The chosen output's .monitor source is set as the system audio device. + +This approach is portable across systems — plug in a new mic, run this +command, and it appears in the list. No hardware-specific configuration +needed." + (interactive) + (let* ((mic-entries (cj/recording--label-devices (cj/recording--get-available-mics)))) + (unless mic-entries + (user-error "No microphones found. Is a mic connected?")) + (let ((mic-device (cj/recording--select-from-labeled "Select microphone: " mic-entries)) + (sink-entries (cj/recording--label-sinks (cj/recording--get-available-sinks)))) + (let ((sink-device (cj/recording--select-from-labeled "Select audio output to capture: " sink-entries))) + (setq cj/recording-mic-device mic-device) + (setq cj/recording-system-device (concat sink-device ".monitor")) + (message "Recording ready!\n Mic: %s\n System audio: %s.monitor" + (car (rassoc mic-device mic-entries)) + (file-name-nondirectory sink-device)))))) + +(defun cj/recording-get-devices () + "Get audio devices, prompting user if not already configured. +Returns (mic-device . system-device) cons cell. +If devices aren't set, goes straight into quick setup (mic selection)." + (unless (and cj/recording-mic-device cj/recording-system-device) + (cj/recording-quick-setup)) + (unless (and cj/recording-mic-device cj/recording-system-device) + (user-error "Audio devices not configured. Run C-; r s (quick setup) or C-; r S (manual select)")) + (cj/recording--validate-system-audio) + (cons cj/recording-mic-device cj/recording-system-device)) + +(defun cj/recording--validate-system-audio () + "Validate that the configured system audio device will capture audio. +Checks two things: +1. Does the configured device still exist as a PulseAudio source? +2. Is anything currently playing through the monitored sink? + +Auto-fixes stale devices by falling back to the default sink's monitor. +Warns (but doesn't block) if no audio is currently playing. +Respects the user's explicit sink choice from quick-setup." + (when cj/recording-system-device + (let* ((sources-output (shell-command-to-string "pactl list sources short 2>/dev/null")) + (current-default (cj/recording--get-default-sink-monitor)) + (device-exists (cj/recording--source-exists-p + cj/recording-system-device sources-output))) + ;; Check 1: Device no longer exists — auto-update + (unless device-exists + (let ((old cj/recording-system-device)) + (setq cj/recording-system-device current-default) + (message "System audio device updated: %s → %s (old device no longer exists)" + old current-default))) + ;; Check 2: No active audio on the monitored sink — warn + (let* ((sink-name (if (string-suffix-p ".monitor" cj/recording-system-device) + (substring cj/recording-system-device 0 -8) + cj/recording-system-device)) + (sinks-output (shell-command-to-string "pactl list sinks short 2>/dev/null")) + (sink-index (cj/recording--get-sink-index sink-name sinks-output)) + (sink-inputs (shell-command-to-string "pactl list sink-inputs 2>/dev/null")) + (has-audio (and sink-index + (cj/recording--sink-has-active-audio-p sink-index sink-inputs)))) + (unless has-audio + (message "Warning: No audio connected to %s. Run C-; r s to check devices" + sink-name) + (cj/log-silently + (concat "No audio connected to %s. " + "Run C-; r s to see active streams and switch devices") + sink-name)))))) + +;;; ffmpeg Command Construction + +(defun cj/recording--build-video-command (mic-device system-device filename on-wayland) + "Build the shell command string for video recording. +MIC-DEVICE and SYSTEM-DEVICE are PulseAudio device names. +FILENAME is the output .mkv path. ON-WAYLAND selects the capture method. + +On Wayland: wf-recorder captures screen as H.264 in matroska container, +piped to ffmpeg which adds mic + system audio, then writes the final MKV. + +On X11: ffmpeg captures screen directly via x11grab with PulseAudio audio." + (if on-wayland + (progn + (cj/recording--check-wf-recorder) + (format (concat "wf-recorder -y -c libx264 -m matroska -f /dev/stdout 2>/dev/null | " + "ffmpeg -i pipe:0 " + "-f pulse -i %s " + "-f pulse -i %s " + "-filter_complex \"[1:a]volume=%.1f[mic];[2:a]volume=%.1f[sys];[mic][sys]amerge=inputs=2[out]\" " + "-map 0:v -map \"[out]\" " + "-c:v copy " + "%s") + (shell-quote-argument mic-device) + (shell-quote-argument system-device) + cj/recording-mic-boost + cj/recording-system-volume + (shell-quote-argument filename))) + (format (concat "ffmpeg -framerate 30 -f x11grab -i :0.0+ " + "-f pulse -i %s " + "-ac 1 " + "-f pulse -i %s " + "-ac 2 " + "-filter_complex \"[1:a]volume=%.1f[mic];[2:a]volume=%.1f[sys];[mic][sys]amerge=inputs=2[out]\" " + "-map 0:v -map \"[out]\" " + "%s") + (shell-quote-argument mic-device) + (shell-quote-argument system-device) + cj/recording-mic-boost + cj/recording-system-volume + (shell-quote-argument filename)))) + +(defun cj/recording--build-audio-command (mic-device system-device filename) + "Build the ffmpeg shell command string for audio-only recording. +MIC-DEVICE and SYSTEM-DEVICE are PulseAudio device names. FILENAME is +the output .m4a path. Mixes mic + system monitor into a single AAC file." + (format (concat "ffmpeg " + "-f pulse -i %s " ; Input 0: microphone + "-f pulse -i %s " ; Input 1: system audio monitor + "-filter_complex \"" + "[0:a]volume=%.1f[mic];" + "[1:a]volume=%.1f[sys];" + "[mic][sys]amix=inputs=2:duration=longest[out]\" " + "-map \"[out]\" " + "-c:a aac " + "-b:a 64k " + "%s") + (shell-quote-argument mic-device) + (shell-quote-argument system-device) + cj/recording-mic-boost + cj/recording-system-volume + (shell-quote-argument filename))) + +;;; Start Recording + +(defun cj/ffmpeg-record-video (directory) + "Start a video recording, saving output to DIRECTORY. +Uses wf-recorder on Wayland, x11grab on X11." + (cj/recording-check-ffmpeg) + (unless cj/video-recording-ffmpeg-process + ;; On Wayland, kill any orphan wf-recorder processes left over from + ;; previous crashes. Without this, old wf-recorders hold the compositor + ;; capture and new ones fail silently. This one stays a broad by-name + ;; kill on purpose: the orphans' launching shells are already dead, so + ;; there is no live PID to scope to. The stop path, by contrast, scopes + ;; to our own shell's child (see cj/recording--interrupt-child-wf-recorder). + (when (cj/recording--wayland-p) + (call-process "pkill" nil nil nil "-INT" "wf-recorder") + (sit-for 0.1)) + (let* ((devices (cj/recording-get-devices)) + (mic-device (car devices)) + (system-device (cdr devices)) + (location (expand-file-name directory)) + (name (format-time-string "%Y-%m-%d-%H-%M-%S")) + (filename (expand-file-name (concat name ".mkv") location)) + (on-wayland (cj/recording--wayland-p)) + (record-command (cj/recording--build-video-command + mic-device system-device filename on-wayland))) + (setq cj/video-recording-ffmpeg-process + (start-process-shell-command "ffmpeg-video-recording" + "*ffmpeg-video-recording*" + record-command)) + (set-process-query-on-exit-flag cj/video-recording-ffmpeg-process nil) + (set-process-sentinel cj/video-recording-ffmpeg-process #'cj/recording-process-sentinel) + (force-mode-line-update t) + (message "Started video recording to %s (%s, mic: %.1fx, system: %.1fx)." + filename + (if on-wayland "Wayland/wf-recorder" "X11") + cj/recording-mic-boost cj/recording-system-volume)))) + +(defun cj/ffmpeg-record-audio (directory) + "Start an audio recording, saving output to DIRECTORY. +Records from microphone and system audio monitor (configured device), +mixing them together into a single M4A/AAC file. + +The filter graph mixes two PulseAudio inputs: + [mic] → volume boost → amerge → AAC encoder → .m4a + [sys] → volume boost ↗" + (cj/recording-check-ffmpeg) + (unless cj/audio-recording-ffmpeg-process + (let* ((devices (cj/recording-get-devices)) + (mic-device (car devices)) + (system-device (cdr devices)) + (location (expand-file-name directory)) + (name (format-time-string "%Y-%m-%d-%H-%M-%S")) + (filename (expand-file-name (concat name ".m4a") location)) + (ffmpeg-command + (cj/recording--build-audio-command mic-device system-device filename))) + (message "Recording from mic: %s + ALL system outputs" mic-device) + (cj/log-silently "Audio recording ffmpeg command: %s" ffmpeg-command) + (setq cj/audio-recording-ffmpeg-process + (start-process-shell-command "ffmpeg-audio-recording" + "*ffmpeg-audio-recording*" + ffmpeg-command)) + (set-process-query-on-exit-flag cj/audio-recording-ffmpeg-process nil) + (set-process-sentinel cj/audio-recording-ffmpeg-process #'cj/recording-process-sentinel) + (force-mode-line-update t) + (message "Started recording to %s (mic: %.1fx, all system audio: %.1fx)" + filename cj/recording-mic-boost cj/recording-system-volume)))) + +;;; Stop Recording + +(defun cj/recording--interrupt-child-wf-recorder (shell-pid) + "Send SIGINT to the wf-recorder child of SHELL-PID, if any. +Scopes the producer-first stop to the wf-recorder this module launched +\(a child of our recording shell) via `pkill -P', instead of killing +every wf-recorder on the system by name. Does nothing when SHELL-PID +is nil (the shell already exited, so there is no child to signal)." + (when shell-pid + (call-process "pkill" nil nil nil + "-INT" "-P" (number-to-string shell-pid) "wf-recorder"))) + +(defun cj/video-recording-stop () + "Stop the video recording, waiting for ffmpeg to finalize the file. +On Wayland, kills wf-recorder first so ffmpeg gets a clean EOF on its +video input pipe, then signals the process group. Waits up to 5 seconds +for ffmpeg to write container metadata before giving up." + (interactive) + (if (not cj/video-recording-ffmpeg-process) + (message "No video recording in progress.") + (let ((proc cj/video-recording-ffmpeg-process)) + ;; On Wayland, kill the producer (wf-recorder) FIRST so ffmpeg sees + ;; a clean EOF on pipe:0. This triggers ffmpeg's orderly shutdown: + ;; drain remaining frames, write container metadata, close file. + ;; Without this, simultaneous SIGINT to both causes ffmpeg to abort + ;; without creating a file. + (when (cj/recording--wayland-p) + (cj/recording--interrupt-child-wf-recorder (process-id proc)) + (sit-for 0.3)) ; Brief pause for pipe to close + ;; Now send SIGINT to the process group. On Wayland, this reaches + ;; ffmpeg (which is already shutting down from the pipe EOF) and + ;; reinforces the stop. On X11, this is the primary shutdown signal. + (let ((pid (process-id proc))) + (when pid + (signal-process (- pid) 2))) ; 2 = SIGINT + ;; Wait for ffmpeg to finalize the container. MKV files need index + ;; tables written at the end — without this wait, the file is truncated. + (let ((exited (cj/recording--wait-for-exit proc 5))) + (unless exited + (message "Warning: recording process did not exit within 5 seconds"))) + ;; Safety net: signal our own straggler wf-recorder on Wayland. + ;; If the shell already exited, process-id returns nil and this is + ;; a no-op (the child is already gone with it). + (when (cj/recording--wayland-p) + (cj/recording--interrupt-child-wf-recorder (process-id proc))) + ;; The sentinel handles clearing cj/video-recording-ffmpeg-process + ;; and updating the modeline. If the process already exited during + ;; our wait, the sentinel has already fired. If not, force cleanup. + (when (eq cj/video-recording-ffmpeg-process proc) + (setq cj/video-recording-ffmpeg-process nil) + (force-mode-line-update t)) + (message "Stopped video recording.")))) + +(defun cj/audio-recording-stop () + "Stop the audio recording, waiting for ffmpeg to finalize the file. +Sends SIGINT to the process group and waits up to 3 seconds for ffmpeg +to flush audio frames and write the M4A container trailer." + (interactive) + (if (not cj/audio-recording-ffmpeg-process) + (message "No audio recording in progress.") + (let ((proc cj/audio-recording-ffmpeg-process)) + ;; Send SIGINT to the process group (see video-recording-stop for details) + (let ((pid (process-id proc))) + (when pid + (signal-process (- pid) 2))) + ;; M4A finalization is faster than MKV, but still needs time to write + ;; the AAC trailer and flush the output buffer. + (let ((exited (cj/recording--wait-for-exit proc 3))) + (unless exited + (message "Warning: recording process did not exit within 3 seconds"))) + ;; Fallback cleanup if sentinel hasn't fired yet + (when (eq cj/audio-recording-ffmpeg-process proc) + (setq cj/audio-recording-ffmpeg-process nil) + (force-mode-line-update t)) + (message "Stopped audio recording.")))) + +(provide 'video-audio-recording-capture) +;;; video-audio-recording-capture.el ends here diff --git a/modules/video-audio-recording-devices.el b/modules/video-audio-recording-devices.el new file mode 100644 index 000000000..375a81cf9 --- /dev/null +++ b/modules/video-audio-recording-devices.el @@ -0,0 +1,344 @@ +;;; video-audio-recording-devices.el --- PulseAudio device discovery for recording -*- lexical-binding: t; coding: utf-8; -*- + +;; Author: Craig Jennings <c@cjennings.net> + +;;; Commentary: +;; +;; Layer: 4 (Optional). +;; Category: D. +;; Load shape: library. +;; Top-level side effects: none (defuns only). +;; Runtime requires: subr-x, seq. +;; Direct test load: yes. +;; +;; Base layer of video-audio-recording: PulseAudio source and sink +;; discovery, the pactl output parsers, device labeling and sort/status +;; helpers for completing-read, and the lookup predicates used to validate +;; a configured device. Pure string and shell-query helpers with no +;; dependency on recording state, configuration, or the capture engine, so +;; the engine and command layers build on it. + +;;; Code: + +(require 'subr-x) +(require 'seq) + +;;; PulseAudio Source/Sink Parsing + +(defun cj/recording--parse-pactl-output (output) + "Parse pactl sources OUTPUT into structured list. +Returns list of (device-name driver state) tuples. +Extracted as a separate function for testability." + (let ((sources nil)) + (dolist (line (split-string output "\n" t)) + (when (string-match "^[0-9]+\t\\([^\t]+\\)\t\\([^\t]+\\)\t\\([^\t]+\\)\t\\([^\t]+\\)" line) + (let ((device (match-string 1 line)) + (driver (match-string 2 line)) + (state (match-string 4 line))) + (push (list device driver state) sources)))) + (nreverse sources))) + +(defun cj/recording-parse-sources () + "Parse pactl sources output into structured list. +Returns list of (device-name driver state) tuples." + (cj/recording--parse-pactl-output + (shell-command-to-string "pactl list sources short 2>/dev/null"))) + +(defun cj/recording-friendly-state (state) + "Convert technical STATE name to user-friendly label. +STATE is the raw state from pactl (SUSPENDED, RUNNING, IDLE, etc.)." + (pcase state + ("SUSPENDED" "Ready") + ("RUNNING" "Active") + ("IDLE" "Ready") + (_ state))) + +(defun cj/recording--get-default-sink-monitor () + "Return the PulseAudio monitor source for the default audio output. +The monitor source captures whatever is playing through the default sink +(music, calls, system sounds, etc.). This is the correct device +for capturing \"what I hear\" regardless of which output hardware is active." + (let ((default-sink (string-trim + (shell-command-to-string + "pactl get-default-sink 2>/dev/null")))) + (if (string-empty-p default-sink) + (user-error "No default audio output found. Is PulseAudio/PipeWire running?") + (concat default-sink ".monitor")))) + +(defun cj/recording--parse-pactl-verbose (output record-type) + "Parse verbose pactl OUTPUT into structured list. +RECORD-TYPE is \"Source\" or \"Sink\" — the record header in pactl output. +Returns list of (name description mute state) tuples." + (let ((entries nil) + (header-re (concat "^" record-type " #")) + (current-name nil) + (current-desc nil) + (current-mute nil) + (current-state nil)) + (dolist (line (split-string output "\n")) + (cond + ((string-match-p header-re line) + (when current-name + (push (list current-name current-desc current-mute current-state) + entries)) + (setq current-name nil current-desc nil + current-mute nil current-state nil)) + ((string-match "^\\s-+Name:\\s-+\\(.+\\)" line) + (setq current-name (match-string 1 line))) + ((string-match "^\\s-+Description:\\s-+\\(.+\\)" line) + (setq current-desc (match-string 1 line))) + ((string-match "^\\s-+Mute:\\s-+\\(.+\\)" line) + (setq current-mute (match-string 1 line))) + ((string-match "^\\s-+State:\\s-+\\(.+\\)" line) + (setq current-state (match-string 1 line))))) + (when current-name + (push (list current-name current-desc current-mute current-state) + entries)) + (nreverse entries))) + +(defun cj/recording--get-available-mics () + "Return available microphone sources as list of (name description state mute). +Filters out monitor sources but includes muted devices (shown with +a [muted] label in the UI). Uses the friendly description from +PulseAudio (e.g. \"Jabra SPEAK 510 Mono\") rather than the raw +device name. State is the PulseAudio state string (RUNNING, IDLE, +or SUSPENDED). Mute is \"yes\" or \"no\"." + (let* ((output (shell-command-to-string "pactl list sources 2>/dev/null")) + (sources (cj/recording--parse-pactl-verbose output "Source")) + (mics nil)) + (dolist (source sources) + (let ((name (nth 0 source)) + (desc (nth 1 source)) + (mute (nth 2 source)) + (state (nth 3 source))) + (when (not (string-match-p "\\.monitor$" name)) + (push (list name (or desc name) state mute) mics)))) + (nreverse mics))) + +(defun cj/recording--get-available-sinks () + "Return available audio sinks as list of (name description state mute). +Includes muted sinks (shown with a [muted] label in the UI). Uses +the friendly description from PulseAudio (e.g. \"JDS Labs Element IV +Analog Stereo\"). State is the PulseAudio state string (RUNNING, +IDLE, or SUSPENDED). Mute is \"yes\" or \"no\"." + (let* ((output (shell-command-to-string "pactl list sinks 2>/dev/null")) + (sinks (cj/recording--parse-pactl-verbose output "Sink")) + (result nil)) + (dolist (sink sinks) + (let ((name (nth 0 sink)) + (desc (nth 1 sink)) + (mute (nth 2 sink)) + (state (nth 3 sink))) + (push (list name (or desc name) state mute) result))) + (nreverse result))) + +(defun cj/recording--get-sink-apps () + "Return alist mapping sink index to list of application names. +Parses `pactl list sink-inputs' to find which apps are playing +audio through each sink." + (let ((output (shell-command-to-string "pactl list sink-inputs 2>/dev/null")) + (apps (make-hash-table :test 'equal)) + (current-sink nil)) + (dolist (line (split-string output "\n")) + (cond + ((string-match "^Sink Input #" line) + (setq current-sink nil)) + ((string-match "^[ \t]+Sink:[ \t]+\\([0-9]+\\)" line) + (setq current-sink (match-string 1 line))) + ((and current-sink + (string-match "application\\.name = \"\\([^\"]+\\)\"" line)) + (let ((existing (gethash current-sink apps))) + (unless (member (match-string 1 line) existing) + (puthash current-sink + (append existing (list (match-string 1 line))) + apps)))))) + ;; Convert hash to alist + (let ((result nil)) + (maphash (lambda (k v) (push (cons k v) result)) apps) + result))) + +;;; Device Lookups + +(defun cj/recording--get-sink-index (sink-name sinks-output) + "Return the numeric index of SINK-NAME from SINKS-OUTPUT. +SINKS-OUTPUT should be the output of `pactl list sinks short'. +Returns the index as a string, or nil if not found." + (let ((index nil)) + (dolist (line (split-string sinks-output "\n" t)) + (when (string-match "^\\([0-9]+\\)\t\\([^\t]+\\)\t" line) + (when (equal sink-name (match-string 2 line)) + (setq index (match-string 1 line))))) + index)) + +(defun cj/recording--source-exists-p (source-name pactl-output) + "Return non-nil if SOURCE-NAME exists in PACTL-OUTPUT. +PACTL-OUTPUT should be the output of `pactl list sources short'." + (let ((found nil)) + (dolist (line (split-string pactl-output "\n" t)) + (when (string-match "^[0-9]+\t\\([^\t]+\\)\t" line) + (when (equal source-name (match-string 1 line)) + (setq found t)))) + found)) + +(defun cj/recording--sink-has-active-audio-p (sink-index pactl-output) + "Return non-nil if SINK-INDEX has active audio streams. +PACTL-OUTPUT should be the output of `pactl list sink-inputs'. +SINK-INDEX is the numeric sink index as a string." + (let ((found nil) + (lines (split-string pactl-output "\n"))) + (dolist (line lines) + (when (string-match "^[ \t]+Sink:[ \t]+\\([0-9]+\\)" line) + (when (equal sink-index (match-string 1 line)) + (setq found t)))) + found)) + +;;; Device Labeling and Selection Primitives + +(defun cj/recording--device-sort-key (state muted) + "Return a numeric sort key for a device with STATE and MUTED flag. +Lower values sort first: RUNNING (0) → IDLE (1) → SUSPENDED (2) → muted (3)." + (if (equal muted "yes") + 3 + (pcase (upcase (or state "")) + ("RUNNING" 0) + ("IDLE" 1) + (_ 2)))) + +(defun cj/recording--device-status-label (state muted) + "Return a human-readable status label for a device. +MUTED is \"yes\" or \"no\". STATE is the PulseAudio state string." + (if (equal muted "yes") + "[muted]" + (pcase (upcase (or state "")) + ("RUNNING" "[in use]") + ("IDLE" "[ready]") + (_ "[available]")))) + +(defun cj/recording--label-devices (devices) + "Build labeled (label . name) alist from DEVICES for `completing-read'. +DEVICES is a list of (name description state mute) as returned by +`cj/recording--get-available-mics' or `cj/recording--get-available-sinks'. +Labels are formatted as \"Description [in use]\" etc. +Sorted: in use → ready → available → muted." + (let* ((labeled (mapcar + (lambda (dev) + (let* ((name (nth 0 dev)) + (desc (nth 1 dev)) + (state (nth 2 dev)) + (muted (nth 3 dev)) + (label (concat desc " " + (cj/recording--device-status-label state muted)))) + (list label name (cj/recording--device-sort-key state muted)))) + devices)) + (sorted (sort labeled (lambda (a b) (< (nth 2 a) (nth 2 b)))))) + (mapcar (lambda (entry) (cons (nth 0 entry) (nth 1 entry))) sorted))) + +(defun cj/recording--label-sinks (sinks) + "Build labeled (label . name) alist from SINKS for `completing-read'. +Like `cj/recording--label-devices' but also appends application names +for sinks with active audio streams. E.g. \"JDS Labs [in use] (Firefox)\"." + (let* ((sink-apps (cj/recording--get-sink-apps)) + (sinks-short (shell-command-to-string "pactl list sinks short 2>/dev/null")) + (labeled + (mapcar + (lambda (dev) + (let* ((name (nth 0 dev)) + (desc (nth 1 dev)) + (state (nth 2 dev)) + (muted (nth 3 dev)) + (index (cj/recording--get-sink-index name sinks-short)) + (apps (and index (cdr (assoc index sink-apps)))) + (status (cj/recording--device-status-label state muted)) + (app-str (if apps (concat " (" (string-join apps ", ") ")") "")) + (label (concat desc " " status app-str))) + (list label name (cj/recording--device-sort-key state muted)))) + sinks)) + (sorted (sort labeled (lambda (a b) (< (nth 2 a) (nth 2 b)))))) + (mapcar (lambda (entry) (cons (nth 0 entry) (nth 1 entry))) sorted))) + +(defun cj/recording--select-from-labeled (prompt entries) + "Prompt user with PROMPT to select from labeled ENTRIES. +ENTRIES is an alist of (label . device-name). Appends a Cancel option. +Returns the selected device name, or signals user-error if cancelled." + (let* ((alist (append entries '(("Cancel" . nil)))) + (choice (completing-read prompt + (lambda (string pred action) + (if (eq action 'metadata) + '(metadata (display-sort-function . identity)) + (complete-with-action action alist string pred))) + nil t)) + (device (cdr (assoc choice alist)))) + (unless device + (user-error "Device setup cancelled")) + device)) + +(defun cj/recording-group-devices-by-hardware () + "Group audio sources by physical hardware device. +Returns alist of (friendly-name . (mic-source . monitor-source)). +Only includes devices that have BOTH a mic and a monitor source, +since recording needs both to capture your voice and system audio." + (let ((sources (cj/recording-parse-sources)) + (devices (make-hash-table :test 'equal)) + (result nil)) + ;; Group sources by base device name (hardware identifier) + (dolist (source sources) + (let* ((device (nth 0 source)) + ;; Extract hardware ID — the unique part identifying the physical device. + ;; Different device types use different naming conventions in PulseAudio. + (base-name (cond + ;; USB devices: extract usb-XXXXX-XX part + ((string-match "\\.\\(usb-[^.]+\\-[0-9]+\\)\\." device) + (match-string 1 device)) + ;; Built-in (PCI) devices: extract pci-XXXXX part + ((string-match "\\.\\(pci-[^.]+\\)\\." device) + (match-string 1 device)) + ;; Bluetooth devices: extract and normalize MAC address + ;; (input uses colons, output uses underscores) + ((string-match "bluez_\\(?:input\\|output\\)\\.\\([^.]+\\)" device) + (replace-regexp-in-string "_" ":" (match-string 1 device))) + (t device))) + (is-monitor (string-match-p "\\.monitor$" device)) + (device-entry (gethash base-name devices))) + (unless device-entry + (setf device-entry (cons nil nil)) + (puthash base-name device-entry devices)) + (if is-monitor + (setcdr device-entry device) + (setcar device-entry device)))) + + ;; Convert hash table to alist with user-friendly names + (maphash (lambda (base-name pair) + (when (and (car pair) (cdr pair)) + (let ((friendly-name + (cond + ((string-match-p "usb.*[Jj]abra" base-name) "Jabra SPEAK 510 USB") + ((string-match-p "^usb-" base-name) "USB Audio Device") + ((string-match-p "^pci-" base-name) "Built-in Audio") + ((string-match-p "^[0-9A-Fa-f:]+$" base-name) "Bluetooth Headset") + (t base-name)))) + (push (cons friendly-name pair) result)))) + devices) + (nreverse result))) + +(defun cj/recording-select-device (prompt device-type) + "Interactively select an audio device. +PROMPT is shown to user. DEVICE-TYPE is \\='mic or \\='monitor for filtering. +Monitor devices end in .monitor (they tap system audio output). +Returns selected device name or nil." + (let* ((sources (cj/recording-parse-sources)) + (filtered (if (eq device-type 'monitor) + (seq-filter (lambda (s) (string-match-p "\\.monitor$" (car s))) sources) + (seq-filter (lambda (s) (not (string-match-p "\\.monitor$" (car s)))) sources))) + (choices (mapcar (lambda (s) + (let ((device (nth 0 s)) + (_driver (nth 1 s)) + (_state (nth 2 s)) + (friendly-state (cj/recording-friendly-state (nth 2 s)))) + (cons (format "%-10s %s" friendly-state device) device))) + filtered))) + (if choices + (cdr (assoc (completing-read prompt choices nil t) choices)) + (user-error "No %s devices found" (if (eq device-type 'monitor) "monitor" "input"))))) + +(provide 'video-audio-recording-devices) +;;; video-audio-recording-devices.el ends here diff --git a/modules/video-audio-recording.el b/modules/video-audio-recording.el index 1672529f7..10c108541 100644 --- a/modules/video-audio-recording.el +++ b/modules/video-audio-recording.el @@ -6,108 +6,29 @@ ;; Layer: 4 (Optional). ;; Category: O/D/S. ;; Load shape: eager. -;; Eager reason: none; registers a recording keymap, but device probing should -;; run only on command (command-loaded target). -;; Top-level side effects: defines cj/record-map and conditionally registers it -;; under C-; r. -;; Runtime requires: system-lib, keybindings. -;; Direct test load: yes (requires keybindings explicitly). +;; Eager reason: none; records only on command, but registers C-; r at load. +;; Top-level side effects: defines cj/record-map and registers it when possible. +;; Runtime requires: system-lib, keybindings, video-audio-recording-devices, +;; video-audio-recording-capture. +;; Direct test load: yes. ;; -;; Desktop video and audio recording from within Emacs using ffmpeg. -;; Records from both microphone and system audio simultaneously, which -;; makes it suitable for capturing meetings, presentations, and desktop activity. -;; -;; Architecture: -;; - Audio recordings use ffmpeg directly with PulseAudio inputs → M4A/AAC -;; - Video recordings differ by display server: -;; - X11: ffmpeg with x11grab + PulseAudio → MKV -;; - Wayland: wf-recorder piped to ffmpeg for audio mixing → MKV -;; (wf-recorder captures the compositor, ffmpeg mixes in audio) -;; -;; Process lifecycle: -;; - Start: `start-process-shell-command` creates a shell running the -;; ffmpeg (or wf-recorder|ffmpeg) pipeline. Process ref is stored in -;; `cj/video-recording-ffmpeg-process' or `cj/audio-recording-ffmpeg-process'. -;; - Stop: SIGINT is sent to the shell's process group so all pipeline -;; children (wf-recorder, ffmpeg) receive it. We then poll until the -;; process actually exits, giving ffmpeg time to finalize the container. -;; - Cleanup: A process sentinel auto-clears the process variable and -;; updates the modeline if the process dies unexpectedly. -;; -;; Note: video-recordings-dir and audio-recordings-dir are defined -;; (and directory created) in user-constants.el -;; -;; Quick Start -;; =========== -;; 1. Press C-; r s to run quick setup -;; 2. Pick a microphone from the list -;; 3. Pick an audio output — [in use] shows which apps are playing -;; 4. Press C-; r a to start/stop audio recording -;; 5. Recording starts - you'll see in your modeline -;; 6. Press C-; r a again to stop (🔴 disappears) -;; -;; Device Setup -;; ============ -;; C-; r a automatically prompts for device selection on first use. -;; Device selection lasts for the current Emacs session only. -;; -;; Manual device selection: -;; -;; C-; r s (cj/recording-quick-setup) - RECOMMENDED -;; Two-step setup: pick a mic, then pick an audio output to capture. -;; Both steps show status: [in use], [ready], [available], [muted]. -;; Audio outputs also show which apps are playing through them. -;; Sorted: in use → ready → available → muted. -;; -;; C-; r S (cj/recording-select-devices) - ADVANCED -;; Manual selection: choose mic and monitor separately. -;; Use when you need different devices for input/output. -;; -;; C-; r d (cj/recording-list-devices) -;; List all available audio devices and current configuration. -;; -;; C-; r w (cj/recording-show-active-audio) - DIAGNOSTIC TOOL -;; Show which apps are currently playing audio and through which device. -;; Use this DURING a phone call to see if the call audio is going through -;; the device you think it is. Helps diagnose "missing one side" issues. -;; -;; Pre-Recording Validation -;; ======================== -;; Every time you start a recording, the system audio device is -;; validated automatically: -;; 1. If the configured monitor device no longer exists (e.g. -;; USB DAC unplugged), it's auto-updated to the current -;; default sink's monitor. -;; 2. If no audio is currently playing through the monitored sink, -;; a warning is shown in the echo area. Recording proceeds -;; without interruption — run C-; r s to see active streams. -;; -;; Testing Devices Before Important Recordings -;; ============================================ -;; Always test devices before important recordings: -;; -;; C-; r t b (cj/recording-test-both) - RECOMMENDED -;; Guided test: mic only, monitor only, then both together. -;; Catches hardware issues before they ruin recordings! -;; -;; C-; r t m (cj/recording-test-mic) -;; Quick 5-second mic test with playback. -;; -;; C-; r t s (cj/recording-test-monitor) -;; Quick 5-second system audio test with playback. -;; -;; To adjust volumes: -;; - Use =M-x cj/recording-adjust-volumes= (or your keybinding =r l=) -;; - Or customize permanently: =M-x customize-group RET cj-recording RET= -;; - Or in your config: -;; #+begin_src emacs-lisp -;; (setq cj/recording-mic-boost 1.5) ; 50% louder -;; (setq cj/recording-system-volume 0.7) ; 30% quieter +;; Starts and stops ffmpeg-backed audio/video recordings from Emacs. Audio +;; captures microphone plus system monitor; video uses x11grab on X11 and +;; wf-recorder piped into ffmpeg on Wayland. ;; +;; This is the public face of the module: it owns configuration and the +;; recording process-handle state, the device-diagnostic and device-test +;; commands, the toggle commands, and the C-; r keymap. PulseAudio +;; discovery lives in video-audio-recording-devices and the ffmpeg capture +;; engine in video-audio-recording-capture, both required here. Every +;; public name is unchanged so existing callers and tests keep working. + ;;; Code: (require 'system-lib) (require 'keybindings) ;; provides cj/custom-keymap +(require 'video-audio-recording-devices) +(require 'video-audio-recording-capture) ;;; ============================================================ ;;; Configuration Variables @@ -141,7 +62,8 @@ If nil, will auto-detect on first use.") ;; These hold the Emacs process objects for running recordings. ;; The process is the shell that runs the ffmpeg (or wf-recorder|ffmpeg) -;; pipeline. When non-nil, a recording is in progress. +;; pipeline. When non-nil, a recording is in progress. The capture engine +;; reads and clears them; the toggle commands below read them. (defvar cj/video-recording-ffmpeg-process nil "Emacs process object for the active video recording shell, or nil.") @@ -150,204 +72,7 @@ If nil, will auto-detect on first use.") "Emacs process object for the active audio recording shell, or nil.") ;;; ============================================================ -;;; Modeline Indicator -;;; ============================================================ - -(defun cj/recording-modeline-indicator () - "Return modeline string showing active recordings. -Shows 🎤 (microphone) for audio, 🎬 (clapper board) for video. -Checks if process is actually alive, not just if variable is set." - (let ((audio-active (and cj/audio-recording-ffmpeg-process - (process-live-p cj/audio-recording-ffmpeg-process))) - (video-active (and cj/video-recording-ffmpeg-process - (process-live-p cj/video-recording-ffmpeg-process)))) - (cond - ((and audio-active video-active) " 🎤🎬 ") - (audio-active " 🎤 ") - (video-active " 🎬 ") - (t "")))) - -;;; ============================================================ -;;; Process Lifecycle (Sentinel and Graceful Shutdown) -;;; ============================================================ - -(defun cj/recording-process-sentinel (process event) - "Sentinel for recording processes — handles unexpected exits. -PROCESS is the ffmpeg shell process, EVENT describes what happened. -This is called by Emacs when the process changes state (exits, is -killed, etc.). It clears the process variable and updates the modeline -so the recording indicator disappears even if the recording crashes or -is killed externally." - (when (memq (process-status process) '(exit signal)) - (cond - ((eq process cj/audio-recording-ffmpeg-process) - (setq cj/audio-recording-ffmpeg-process nil) - (message "Audio recording stopped: %s" (string-trim event))) - ((eq process cj/video-recording-ffmpeg-process) - (setq cj/video-recording-ffmpeg-process nil) - (message "Video recording stopped: %s" (string-trim event)))) - (force-mode-line-update t))) - -(defun cj/recording--wait-for-exit (process timeout-secs) - "Wait for PROCESS to exit, polling until done or TIMEOUT-SECS elapsed. -Returns t if the process exited within the timeout, nil if it timed out. - -This replaces fixed `sit-for' delays with an actual check that ffmpeg has -finished writing its output file. Container finalization (writing index -tables, flushing buffers) can take several seconds for large recordings, -so a fixed 0.5s wait was causing zero-byte output files." - (let ((deadline (+ (float-time) timeout-secs))) - (while (and (process-live-p process) - (< (float-time) deadline)) - (accept-process-output process 0.1)) - (not (process-live-p process)))) - -;;; ============================================================ -;;; Dependency Checks -;;; ============================================================ - -(defun cj/recording-check-ffmpeg () - "Check if ffmpeg is available. Error if not found." - (unless (executable-find "ffmpeg") - (user-error "Ffmpeg not found. Install with: sudo pacman -S ffmpeg") - nil) - t) - -(defun cj/recording--wayland-p () - "Return non-nil if running under Wayland." - (string= (getenv "XDG_SESSION_TYPE") "wayland")) - -(defun cj/recording--check-wf-recorder () - "Check if wf-recorder is available (needed for Wayland video capture)." - (if (executable-find "wf-recorder") - t - (user-error "wf-recorder not found. Install with: sudo pacman -S wf-recorder") - nil)) - -;;; ============================================================ -;;; PulseAudio Device Discovery -;;; ============================================================ -;; -;; Audio devices are discovered via `pactl list sources short'. -;; Two types of sources matter: -;; - Input sources (microphones): capture your voice -;; - Monitor sources (*.monitor): capture system audio output -;; These tap into what's playing through speakers/headphones, -;; which is how we capture system audio (music, calls, etc.). -;; -;; Device selection is required before first recording. The quick -;; setup (C-; r s) groups hardware devices and lets you pick one -;; device to use for both mic and monitor — ideal for headsets. - -(defun cj/recording--parse-pactl-output (output) - "Parse pactl sources OUTPUT into structured list. -Returns list of (device-name driver state) tuples. -Extracted as a separate function for testability." - (let ((sources nil)) - (dolist (line (split-string output "\n" t)) - (when (string-match "^[0-9]+\t\\([^\t]+\\)\t\\([^\t]+\\)\t\\([^\t]+\\)\t\\([^\t]+\\)" line) - (let ((device (match-string 1 line)) - (driver (match-string 2 line)) - (state (match-string 4 line))) - (push (list device driver state) sources)))) - (nreverse sources))) - -(defun cj/recording-parse-sources () - "Parse pactl sources output into structured list. -Returns list of (device-name driver state) tuples." - (cj/recording--parse-pactl-output - (shell-command-to-string "pactl list sources short 2>/dev/null"))) - -(defun cj/recording-friendly-state (state) - "Convert technical STATE name to user-friendly label. -STATE is the raw state from pactl (SUSPENDED, RUNNING, IDLE, etc.)." - (pcase state - ("SUSPENDED" "Ready") - ("RUNNING" "Active") - ("IDLE" "Ready") - (_ state))) - -(defun cj/recording--get-default-sink-monitor () - "Return the PulseAudio monitor source for the default audio output. -The monitor source captures whatever is playing through the default sink -(music, calls, system sounds, etc.). This is the correct device -for capturing \"what I hear\" regardless of which output hardware is active." - (let ((default-sink (string-trim - (shell-command-to-string - "pactl get-default-sink 2>/dev/null")))) - (if (string-empty-p default-sink) - (user-error "No default audio output found. Is PulseAudio/PipeWire running?") - (concat default-sink ".monitor")))) - -(defun cj/recording--parse-pactl-verbose (output record-type) - "Parse verbose pactl OUTPUT into structured list. -RECORD-TYPE is \"Source\" or \"Sink\" — the record header in pactl output. -Returns list of (name description mute state) tuples." - (let ((entries nil) - (header-re (concat "^" record-type " #")) - (current-name nil) - (current-desc nil) - (current-mute nil) - (current-state nil)) - (dolist (line (split-string output "\n")) - (cond - ((string-match-p header-re line) - (when current-name - (push (list current-name current-desc current-mute current-state) - entries)) - (setq current-name nil current-desc nil - current-mute nil current-state nil)) - ((string-match "^\\s-+Name:\\s-+\\(.+\\)" line) - (setq current-name (match-string 1 line))) - ((string-match "^\\s-+Description:\\s-+\\(.+\\)" line) - (setq current-desc (match-string 1 line))) - ((string-match "^\\s-+Mute:\\s-+\\(.+\\)" line) - (setq current-mute (match-string 1 line))) - ((string-match "^\\s-+State:\\s-+\\(.+\\)" line) - (setq current-state (match-string 1 line))))) - (when current-name - (push (list current-name current-desc current-mute current-state) - entries)) - (nreverse entries))) - -(defun cj/recording--get-available-mics () - "Return available microphone sources as list of (name description state mute). -Filters out monitor sources but includes muted devices (shown with -a [muted] label in the UI). Uses the friendly description from -PulseAudio (e.g. \"Jabra SPEAK 510 Mono\") rather than the raw -device name. State is the PulseAudio state string (RUNNING, IDLE, -or SUSPENDED). Mute is \"yes\" or \"no\"." - (let* ((output (shell-command-to-string "pactl list sources 2>/dev/null")) - (sources (cj/recording--parse-pactl-verbose output "Source")) - (mics nil)) - (dolist (source sources) - (let ((name (nth 0 source)) - (desc (nth 1 source)) - (mute (nth 2 source)) - (state (nth 3 source))) - (when (not (string-match-p "\\.monitor$" name)) - (push (list name (or desc name) state mute) mics)))) - (nreverse mics))) - -(defun cj/recording--get-available-sinks () - "Return available audio sinks as list of (name description state mute). -Includes muted sinks (shown with a [muted] label in the UI). Uses -the friendly description from PulseAudio (e.g. \"JDS Labs Element IV -Analog Stereo\"). State is the PulseAudio state string (RUNNING, -IDLE, or SUSPENDED). Mute is \"yes\" or \"no\"." - (let* ((output (shell-command-to-string "pactl list sinks 2>/dev/null")) - (sinks (cj/recording--parse-pactl-verbose output "Sink")) - (result nil)) - (dolist (sink sinks) - (let ((name (nth 0 sink)) - (desc (nth 1 sink)) - (mute (nth 2 sink)) - (state (nth 3 sink))) - (push (list name (or desc name) state mute) result))) - (nreverse result))) - -;;; ============================================================ -;;; Device Selection UI +;;; Device Diagnostics and Selection Commands ;;; ============================================================ (defun cj/recording-list-devices () @@ -408,26 +133,6 @@ identify which device the phone app is actually using for output." (switch-to-buffer-other-window "*Active Audio Playback*") (message "Showing active audio playback. Press 'g' to refresh, 'q' to quit."))) -(defun cj/recording-select-device (prompt device-type) - "Interactively select an audio device. -PROMPT is shown to user. DEVICE-TYPE is \\='mic or \\='monitor for filtering. -Monitor devices end in .monitor (they tap system audio output). -Returns selected device name or nil." - (let* ((sources (cj/recording-parse-sources)) - (filtered (if (eq device-type 'monitor) - (seq-filter (lambda (s) (string-match-p "\\.monitor$" (car s))) sources) - (seq-filter (lambda (s) (not (string-match-p "\\.monitor$" (car s)))) sources))) - (choices (mapcar (lambda (s) - (let ((device (nth 0 s)) - (_driver (nth 1 s)) - (_state (nth 2 s)) - (friendly-state (cj/recording-friendly-state (nth 2 s)))) - (cons (format "%-10s %s" friendly-state device) device))) - filtered))) - (if choices - (cdr (assoc (completing-read prompt choices nil t) choices)) - (user-error "No %s devices found" (if (eq device-type 'monitor) "monitor" "input"))))) - (defun cj/recording-select-devices () "Interactively select microphone and system audio devices separately. Sets `cj/recording-mic-device' and `cj/recording-system-device'." @@ -440,191 +145,9 @@ Sets `cj/recording-mic-device' and `cj/recording-system-device'." cj/recording-mic-device cj/recording-system-device)) -(defun cj/recording-group-devices-by-hardware () - "Group audio sources by physical hardware device. -Returns alist of (friendly-name . (mic-source . monitor-source)). -Only includes devices that have BOTH a mic and a monitor source, -since recording needs both to capture your voice and system audio." - (let ((sources (cj/recording-parse-sources)) - (devices (make-hash-table :test 'equal)) - (result nil)) - ;; Group sources by base device name (hardware identifier) - (dolist (source sources) - (let* ((device (nth 0 source)) - ;; Extract hardware ID — the unique part identifying the physical device. - ;; Different device types use different naming conventions in PulseAudio. - (base-name (cond - ;; USB devices: extract usb-XXXXX-XX part - ((string-match "\\.\\(usb-[^.]+\\-[0-9]+\\)\\." device) - (match-string 1 device)) - ;; Built-in (PCI) devices: extract pci-XXXXX part - ((string-match "\\.\\(pci-[^.]+\\)\\." device) - (match-string 1 device)) - ;; Bluetooth devices: extract and normalize MAC address - ;; (input uses colons, output uses underscores) - ((string-match "bluez_\\(?:input\\|output\\)\\.\\([^.]+\\)" device) - (replace-regexp-in-string "_" ":" (match-string 1 device))) - (t device))) - (is-monitor (string-match-p "\\.monitor$" device)) - (device-entry (gethash base-name devices))) - (unless device-entry - (setf device-entry (cons nil nil)) - (puthash base-name device-entry devices)) - (if is-monitor - (setcdr device-entry device) - (setcar device-entry device)))) - - ;; Convert hash table to alist with user-friendly names - (maphash (lambda (base-name pair) - (when (and (car pair) (cdr pair)) - (let ((friendly-name - (cond - ((string-match-p "usb.*[Jj]abra" base-name) "Jabra SPEAK 510 USB") - ((string-match-p "^usb-" base-name) "USB Audio Device") - ((string-match-p "^pci-" base-name) "Built-in Audio") - ((string-match-p "^[0-9A-Fa-f:]+$" base-name) "Bluetooth Headset") - (t base-name)))) - (push (cons friendly-name pair) result)))) - devices) - (nreverse result))) - -(defun cj/recording--device-sort-key (state muted) - "Return a numeric sort key for a device with STATE and MUTED flag. -Lower values sort first: RUNNING (0) → IDLE (1) → SUSPENDED (2) → muted (3)." - (if (equal muted "yes") - 3 - (pcase (upcase (or state "")) - ("RUNNING" 0) - ("IDLE" 1) - (_ 2)))) - -(defun cj/recording--device-status-label (state muted) - "Return a human-readable status label for a device. -MUTED is \"yes\" or \"no\". STATE is the PulseAudio state string." - (if (equal muted "yes") - "[muted]" - (pcase (upcase (or state "")) - ("RUNNING" "[in use]") - ("IDLE" "[ready]") - (_ "[available]")))) - -(defun cj/recording--label-devices (devices) - "Build labeled (label . name) alist from DEVICES for `completing-read'. -DEVICES is a list of (name description state mute) as returned by -`cj/recording--get-available-mics' or `cj/recording--get-available-sinks'. -Labels are formatted as \"Description [in use]\" etc. -Sorted: in use → ready → available → muted." - (let* ((labeled (mapcar - (lambda (dev) - (let* ((name (nth 0 dev)) - (desc (nth 1 dev)) - (state (nth 2 dev)) - (muted (nth 3 dev)) - (label (concat desc " " - (cj/recording--device-status-label state muted)))) - (list label name (cj/recording--device-sort-key state muted)))) - devices)) - (sorted (sort labeled (lambda (a b) (< (nth 2 a) (nth 2 b)))))) - (mapcar (lambda (entry) (cons (nth 0 entry) (nth 1 entry))) sorted))) - -(defun cj/recording--get-sink-apps () - "Return alist mapping sink index to list of application names. -Parses `pactl list sink-inputs' to find which apps are playing -audio through each sink." - (let ((output (shell-command-to-string "pactl list sink-inputs 2>/dev/null")) - (apps (make-hash-table :test 'equal)) - (current-sink nil)) - (dolist (line (split-string output "\n")) - (cond - ((string-match "^Sink Input #" line) - (setq current-sink nil)) - ((string-match "^[ \t]+Sink:[ \t]+\\([0-9]+\\)" line) - (setq current-sink (match-string 1 line))) - ((and current-sink - (string-match "application\\.name = \"\\([^\"]+\\)\"" line)) - (let ((existing (gethash current-sink apps))) - (unless (member (match-string 1 line) existing) - (puthash current-sink - (append existing (list (match-string 1 line))) - apps)))))) - ;; Convert hash to alist - (let ((result nil)) - (maphash (lambda (k v) (push (cons k v) result)) apps) - result))) - -(defun cj/recording--label-sinks (sinks) - "Build labeled (label . name) alist from SINKS for `completing-read'. -Like `cj/recording--label-devices' but also appends application names -for sinks with active audio streams. E.g. \"JDS Labs [in use] (Firefox)\"." - (let* ((sink-apps (cj/recording--get-sink-apps)) - (sinks-short (shell-command-to-string "pactl list sinks short 2>/dev/null")) - (labeled - (mapcar - (lambda (dev) - (let* ((name (nth 0 dev)) - (desc (nth 1 dev)) - (state (nth 2 dev)) - (muted (nth 3 dev)) - (index (cj/recording--get-sink-index name sinks-short)) - (apps (and index (cdr (assoc index sink-apps)))) - (status (cj/recording--device-status-label state muted)) - (app-str (if apps (concat " (" (string-join apps ", ") ")") "")) - (label (concat desc " " status app-str))) - (list label name (cj/recording--device-sort-key state muted)))) - sinks)) - (sorted (sort labeled (lambda (a b) (< (nth 2 a) (nth 2 b)))))) - (mapcar (lambda (entry) (cons (nth 0 entry) (nth 1 entry))) sorted))) - -(defun cj/recording--select-from-labeled (prompt entries) - "Prompt user with PROMPT to select from labeled ENTRIES. -ENTRIES is an alist of (label . device-name). Appends a Cancel option. -Returns the selected device name, or signals user-error if cancelled." - (let* ((alist (append entries '(("Cancel" . nil)))) - (choice (completing-read prompt - (lambda (string pred action) - (if (eq action 'metadata) - '(metadata (display-sort-function . identity)) - (complete-with-action action alist string pred))) - nil t)) - (device (cdr (assoc choice alist)))) - (unless device - (user-error "Device setup cancelled")) - device)) - -(defun cj/recording-quick-setup () - "Quick device setup for recording — two-step mic + sink selection. -Step 1: Pick a microphone. Each mic shows its status: - [in use] = an app is actively using this mic - [ready] = recently used, still open - [available] = no app has this mic open - [muted] = device is muted in PulseAudio -Step 2: Pick an audio output to capture. Same status labels, plus -application names for outputs with active streams (e.g. \"Firefox\"). -Devices are sorted: in use → ready → available → muted. -The chosen output's .monitor source is set as the system audio device. - -This approach is portable across systems — plug in a new mic, run this -command, and it appears in the list. No hardware-specific configuration -needed." - (interactive) - (let* ((mic-entries (cj/recording--label-devices (cj/recording--get-available-mics)))) - (unless mic-entries - (user-error "No microphones found. Is a mic connected?")) - (let ((mic-device (cj/recording--select-from-labeled "Select microphone: " mic-entries)) - (sink-entries (cj/recording--label-sinks (cj/recording--get-available-sinks)))) - (let ((sink-device (cj/recording--select-from-labeled "Select audio output to capture: " sink-entries))) - (setq cj/recording-mic-device mic-device) - (setq cj/recording-system-device (concat sink-device ".monitor")) - (message "Recording ready!\n Mic: %s\n System audio: %s.monitor" - (car (rassoc mic-device mic-entries)) - (file-name-nondirectory sink-device)))))) - ;;; ============================================================ ;;; Device Testing ;;; ============================================================ -;; -;; These functions record short clips and play them back so you can -;; verify hardware works BEFORE an important recording. (defun cj/recording--test-device (device prefix prompt-action) "Record 5 seconds from DEVICE and play it back. @@ -698,91 +221,6 @@ Run this before important recordings to verify everything works." (message "Device testing complete. If you heard audio in all tests, recording will work!")) ;;; ============================================================ -;;; Device Validation -;;; ============================================================ - -(defun cj/recording-get-devices () - "Get audio devices, prompting user if not already configured. -Returns (mic-device . system-device) cons cell. -If devices aren't set, goes straight into quick setup (mic selection)." - (unless (and cj/recording-mic-device cj/recording-system-device) - (cj/recording-quick-setup)) - (unless (and cj/recording-mic-device cj/recording-system-device) - (user-error "Audio devices not configured. Run C-; r s (quick setup) or C-; r S (manual select)")) - (cj/recording--validate-system-audio) - (cons cj/recording-mic-device cj/recording-system-device)) - -(defun cj/recording--source-exists-p (source-name pactl-output) - "Return non-nil if SOURCE-NAME exists in PACTL-OUTPUT. -PACTL-OUTPUT should be the output of `pactl list sources short'." - (let ((found nil)) - (dolist (line (split-string pactl-output "\n" t)) - (when (string-match "^[0-9]+\t\\([^\t]+\\)\t" line) - (when (equal source-name (match-string 1 line)) - (setq found t)))) - found)) - -(defun cj/recording--get-sink-index (sink-name sinks-output) - "Return the numeric index of SINK-NAME from SINKS-OUTPUT. -SINKS-OUTPUT should be the output of `pactl list sinks short'. -Returns the index as a string, or nil if not found." - (let ((index nil)) - (dolist (line (split-string sinks-output "\n" t)) - (when (string-match "^\\([0-9]+\\)\t\\([^\t]+\\)\t" line) - (when (equal sink-name (match-string 2 line)) - (setq index (match-string 1 line))))) - index)) - -(defun cj/recording--sink-has-active-audio-p (sink-index pactl-output) - "Return non-nil if SINK-INDEX has active audio streams. -PACTL-OUTPUT should be the output of `pactl list sink-inputs'. -SINK-INDEX is the numeric sink index as a string." - (let ((found nil) - (lines (split-string pactl-output "\n"))) - (dolist (line lines) - (when (string-match "^[ \t]+Sink:[ \t]+\\([0-9]+\\)" line) - (when (equal sink-index (match-string 1 line)) - (setq found t)))) - found)) - -(defun cj/recording--validate-system-audio () - "Validate that the configured system audio device will capture audio. -Checks two things: -1. Does the configured device still exist as a PulseAudio source? -2. Is anything currently playing through the monitored sink? - -Auto-fixes stale devices by falling back to the default sink's monitor. -Warns (but doesn't block) if no audio is currently playing. -Respects the user's explicit sink choice from quick-setup." - (when cj/recording-system-device - (let* ((sources-output (shell-command-to-string "pactl list sources short 2>/dev/null")) - (current-default (cj/recording--get-default-sink-monitor)) - (device-exists (cj/recording--source-exists-p - cj/recording-system-device sources-output))) - ;; Check 1: Device no longer exists — auto-update - (unless device-exists - (let ((old cj/recording-system-device)) - (setq cj/recording-system-device current-default) - (message "System audio device updated: %s → %s (old device no longer exists)" - old current-default))) - ;; Check 2: No active audio on the monitored sink — warn - (let* ((sink-name (if (string-suffix-p ".monitor" cj/recording-system-device) - (substring cj/recording-system-device 0 -8) - cj/recording-system-device)) - (sinks-output (shell-command-to-string "pactl list sinks short 2>/dev/null")) - (sink-index (cj/recording--get-sink-index sink-name sinks-output)) - (sink-inputs (shell-command-to-string "pactl list sink-inputs 2>/dev/null")) - (has-audio (and sink-index - (cj/recording--sink-has-active-audio-p sink-index sink-inputs)))) - (unless has-audio - (message "Warning: No audio connected to %s. Run C-; r s to check devices" - sink-name) - (cj/log-silently - (concat "No audio connected to %s. " - "Run C-; r s to see active streams and switch devices") - sink-name)))))) - -;;; ============================================================ ;;; Toggle Commands (User-Facing) ;;; ============================================================ @@ -825,235 +263,6 @@ Otherwise use the default location in `audio-recordings-dir'." (cj/ffmpeg-record-audio directory)))) ;;; ============================================================ -;;; Start Recording -;;; ============================================================ - -(defun cj/recording--build-video-command (mic-device system-device filename on-wayland) - "Build the shell command string for video recording. -MIC-DEVICE and SYSTEM-DEVICE are PulseAudio device names. -FILENAME is the output .mkv path. ON-WAYLAND selects the capture method. - -On Wayland: wf-recorder captures screen as H.264 in matroska container, -piped to ffmpeg which adds mic + system audio, then writes the final MKV. - -On X11: ffmpeg captures screen directly via x11grab with PulseAudio audio." - (if on-wayland - (progn - (cj/recording--check-wf-recorder) - (format (concat "wf-recorder -y -c libx264 -m matroska -f /dev/stdout 2>/dev/null | " - "ffmpeg -i pipe:0 " - "-f pulse -i %s " - "-f pulse -i %s " - "-filter_complex \"[1:a]volume=%.1f[mic];[2:a]volume=%.1f[sys];[mic][sys]amerge=inputs=2[out]\" " - "-map 0:v -map \"[out]\" " - "-c:v copy " - "%s") - (shell-quote-argument mic-device) - (shell-quote-argument system-device) - cj/recording-mic-boost - cj/recording-system-volume - (shell-quote-argument filename))) - (format (concat "ffmpeg -framerate 30 -f x11grab -i :0.0+ " - "-f pulse -i %s " - "-ac 1 " - "-f pulse -i %s " - "-ac 2 " - "-filter_complex \"[1:a]volume=%.1f[mic];[2:a]volume=%.1f[sys];[mic][sys]amerge=inputs=2[out]\" " - "-map 0:v -map \"[out]\" " - "%s") - (shell-quote-argument mic-device) - (shell-quote-argument system-device) - cj/recording-mic-boost - cj/recording-system-volume - (shell-quote-argument filename)))) - -(defun cj/recording--build-audio-command (mic-device system-device filename) - "Build the ffmpeg shell command string for audio-only recording. -MIC-DEVICE and SYSTEM-DEVICE are PulseAudio device names. FILENAME is -the output .m4a path. Mixes mic + system monitor into a single AAC file." - (format (concat "ffmpeg " - "-f pulse -i %s " ; Input 0: microphone - "-f pulse -i %s " ; Input 1: system audio monitor - "-filter_complex \"" - "[0:a]volume=%.1f[mic];" - "[1:a]volume=%.1f[sys];" - "[mic][sys]amix=inputs=2:duration=longest[out]\" " - "-map \"[out]\" " - "-c:a aac " - "-b:a 64k " - "%s") - (shell-quote-argument mic-device) - (shell-quote-argument system-device) - cj/recording-mic-boost - cj/recording-system-volume - (shell-quote-argument filename))) - -(defun cj/ffmpeg-record-video (directory) - "Start a video recording, saving output to DIRECTORY. -Uses wf-recorder on Wayland, x11grab on X11." - (cj/recording-check-ffmpeg) - (unless cj/video-recording-ffmpeg-process - ;; On Wayland, kill any orphan wf-recorder processes left over from - ;; previous crashes. Without this, old wf-recorders hold the compositor - ;; capture and new ones fail silently. This one stays a broad by-name - ;; kill on purpose: the orphans' launching shells are already dead, so - ;; there is no live PID to scope to. The stop path, by contrast, scopes - ;; to our own shell's child (see cj/recording--interrupt-child-wf-recorder). - (when (cj/recording--wayland-p) - (call-process "pkill" nil nil nil "-INT" "wf-recorder") - (sit-for 0.1)) - (let* ((devices (cj/recording-get-devices)) - (mic-device (car devices)) - (system-device (cdr devices)) - (location (expand-file-name directory)) - (name (format-time-string "%Y-%m-%d-%H-%M-%S")) - (filename (expand-file-name (concat name ".mkv") location)) - (on-wayland (cj/recording--wayland-p)) - (record-command (cj/recording--build-video-command - mic-device system-device filename on-wayland))) - (setq cj/video-recording-ffmpeg-process - (start-process-shell-command "ffmpeg-video-recording" - "*ffmpeg-video-recording*" - record-command)) - (set-process-query-on-exit-flag cj/video-recording-ffmpeg-process nil) - (set-process-sentinel cj/video-recording-ffmpeg-process #'cj/recording-process-sentinel) - (force-mode-line-update t) - (message "Started video recording to %s (%s, mic: %.1fx, system: %.1fx)." - filename - (if on-wayland "Wayland/wf-recorder" "X11") - cj/recording-mic-boost cj/recording-system-volume)))) - -(defun cj/ffmpeg-record-audio (directory) - "Start an audio recording, saving output to DIRECTORY. -Records from microphone and system audio monitor (configured device), -mixing them together into a single M4A/AAC file. - -The filter graph mixes two PulseAudio inputs: - [mic] → volume boost → amerge → AAC encoder → .m4a - [sys] → volume boost ↗" - (cj/recording-check-ffmpeg) - (unless cj/audio-recording-ffmpeg-process - (let* ((devices (cj/recording-get-devices)) - (mic-device (car devices)) - (system-device (cdr devices)) - (location (expand-file-name directory)) - (name (format-time-string "%Y-%m-%d-%H-%M-%S")) - (filename (expand-file-name (concat name ".m4a") location)) - (ffmpeg-command - (cj/recording--build-audio-command mic-device system-device filename))) - (message "Recording from mic: %s + ALL system outputs" mic-device) - (cj/log-silently "Audio recording ffmpeg command: %s" ffmpeg-command) - (setq cj/audio-recording-ffmpeg-process - (start-process-shell-command "ffmpeg-audio-recording" - "*ffmpeg-audio-recording*" - ffmpeg-command)) - (set-process-query-on-exit-flag cj/audio-recording-ffmpeg-process nil) - (set-process-sentinel cj/audio-recording-ffmpeg-process #'cj/recording-process-sentinel) - (force-mode-line-update t) - (message "Started recording to %s (mic: %.1fx, all system audio: %.1fx)" - filename cj/recording-mic-boost cj/recording-system-volume)))) - -;;; ============================================================ -;;; Stop Recording -;;; ============================================================ -;; -;; Stopping a recording requires careful process management, especially -;; on Wayland where we have a two-process pipeline (wf-recorder | ffmpeg). -;; -;; Wayland shutdown order (CRITICAL — order matters!): -;; 1. Kill wf-recorder first (the producer). This closes the pipe -;; to ffmpeg, giving ffmpeg a clean EOF on its video input. -;; 2. Signal the process group with SIGINT so ffmpeg begins its -;; graceful shutdown (flushing audio, writing container metadata). -;; 3. Wait for the shell/ffmpeg to actually exit. MKV container -;; finalization (index tables, seek entries) can take several -;; seconds. A fixed `sit-for' is insufficient. -;; 4. Kill any remaining wf-recorder as a safety net. -;; -;; Why producer-first matters: In a `wf-recorder | ffmpeg` pipeline, -;; sending SIGINT to all processes simultaneously causes ffmpeg to -;; abort mid-stream (no clean EOF on pipe:0). The result is no output -;; file at all. Killing the producer first lets ffmpeg see EOF, start -;; its orderly shutdown, and then SIGINT reinforces "stop now." -;; -;; X11 shutdown: simpler — ffmpeg is the only process, so we just -;; send SIGINT to the process group and wait. - -(defun cj/recording--interrupt-child-wf-recorder (shell-pid) - "Send SIGINT to the wf-recorder child of SHELL-PID, if any. -Scopes the producer-first stop to the wf-recorder this module launched -\(a child of our recording shell) via `pkill -P', instead of killing -every wf-recorder on the system by name. Does nothing when SHELL-PID -is nil (the shell already exited, so there is no child to signal)." - (when shell-pid - (call-process "pkill" nil nil nil - "-INT" "-P" (number-to-string shell-pid) "wf-recorder"))) - -(defun cj/video-recording-stop () - "Stop the video recording, waiting for ffmpeg to finalize the file. -On Wayland, kills wf-recorder first so ffmpeg gets a clean EOF on its -video input pipe, then signals the process group. Waits up to 5 seconds -for ffmpeg to write container metadata before giving up." - (interactive) - (if (not cj/video-recording-ffmpeg-process) - (message "No video recording in progress.") - (let ((proc cj/video-recording-ffmpeg-process)) - ;; On Wayland, kill the producer (wf-recorder) FIRST so ffmpeg sees - ;; a clean EOF on pipe:0. This triggers ffmpeg's orderly shutdown: - ;; drain remaining frames, write container metadata, close file. - ;; Without this, simultaneous SIGINT to both causes ffmpeg to abort - ;; without creating a file. - (when (cj/recording--wayland-p) - (cj/recording--interrupt-child-wf-recorder (process-id proc)) - (sit-for 0.3)) ; Brief pause for pipe to close - ;; Now send SIGINT to the process group. On Wayland, this reaches - ;; ffmpeg (which is already shutting down from the pipe EOF) and - ;; reinforces the stop. On X11, this is the primary shutdown signal. - (let ((pid (process-id proc))) - (when pid - (signal-process (- pid) 2))) ; 2 = SIGINT - ;; Wait for ffmpeg to finalize the container. MKV files need index - ;; tables written at the end — without this wait, the file is truncated. - (let ((exited (cj/recording--wait-for-exit proc 5))) - (unless exited - (message "Warning: recording process did not exit within 5 seconds"))) - ;; Safety net: signal our own straggler wf-recorder on Wayland. - ;; If the shell already exited, process-id returns nil and this is - ;; a no-op (the child is already gone with it). - (when (cj/recording--wayland-p) - (cj/recording--interrupt-child-wf-recorder (process-id proc))) - ;; The sentinel handles clearing cj/video-recording-ffmpeg-process - ;; and updating the modeline. If the process already exited during - ;; our wait, the sentinel has already fired. If not, force cleanup. - (when (eq cj/video-recording-ffmpeg-process proc) - (setq cj/video-recording-ffmpeg-process nil) - (force-mode-line-update t)) - (message "Stopped video recording.")))) - -(defun cj/audio-recording-stop () - "Stop the audio recording, waiting for ffmpeg to finalize the file. -Sends SIGINT to the process group and waits up to 3 seconds for ffmpeg -to flush audio frames and write the M4A container trailer." - (interactive) - (if (not cj/audio-recording-ffmpeg-process) - (message "No audio recording in progress.") - (let ((proc cj/audio-recording-ffmpeg-process)) - ;; Send SIGINT to the process group (see video-recording-stop for details) - (let ((pid (process-id proc))) - (when pid - (signal-process (- pid) 2))) - ;; M4A finalization is faster than MKV, but still needs time to write - ;; the AAC trailer and flush the output buffer. - (let ((exited (cj/recording--wait-for-exit proc 3))) - (unless exited - (message "Warning: recording process did not exit within 3 seconds"))) - ;; Fallback cleanup if sentinel hasn't fired yet - (when (eq cj/audio-recording-ffmpeg-process proc) - (setq cj/audio-recording-ffmpeg-process nil) - (force-mode-line-update t)) - (message "Stopped audio recording.")))) - -;;; ============================================================ ;;; Volume Adjustment ;;; ============================================================ @@ -1106,5 +315,6 @@ Changes take effect on the next recording (not the current one)." "C-; r t s" "test system audio" "C-; r t b" "test both (guided)")) + (provide 'video-audio-recording) ;;; video-audio-recording.el ends here. diff --git a/modules/weather-config.el b/modules/weather-config.el index 93b0a6148..017d9e31b 100644 --- a/modules/weather-config.el +++ b/modules/weather-config.el @@ -1,4 +1,4 @@ -;;; weather-config.el --- -*- lexical-binding: t; coding: utf-8; -*- +;;; weather-config.el --- wttrin weather display and modeline setup -*- lexical-binding: t; coding: utf-8; -*- ;; author: Craig Jennings <c@cjennings.net> ;;; Commentary: ;; @@ -11,19 +11,23 @@ ;; Runtime requires: none (configures packages via use-package). ;; Direct test load: yes. ;; -;; Call M-W to open wttrin with your preferred location list immediately. -;; Adjust the city list by editing `wttrin-default-locations` or answering wttrin prompts when asked. -;; Forecasts arrive in an Emacs buffer, so you can stay keyboard-only while checking weather. +;; Configures wttrin for favorite-location forecasts, mode-line weather, and +;; whereami-backed geolocation. M-S-w opens the weather buffer. ;; ;;; Code: +(defvar wttrin-geolocation-command) + ;; ----------------------------------- Wttrin ---------------------------------- (use-package wttrin - :vc (:url "git@cjennings.net:emacs-wttrin.git" - :branch "main" - :rev :newest) - ;; :load-path "~/code/emacs-wttrin" ;; uncomment + comment :vc above for local dev + ;; Load from the local checkout (currently release/0.4.0) so recent wttrin + ;; changes are testable without a package pull. Swap back to :vc below for + ;; production tracking. + :load-path "~/code/emacs-wttrin" + ;; :vc (:url "git@cjennings.net:emacs-wttrin.git" + ;; :branch "release/0.4.0" + ;; :rev :newest) :demand t ;; REQUIRED: mode-line must start at Emacs startup :preface ;; Change this to t to enable debug logging @@ -32,7 +36,21 @@ ("M-S-w" . wttrin) ;; was M-W, overrides kill-ring-save :config (setopt wttrin-unit-system "u") + ;; Drop the "Follow @igor_chubin for wttr.in updates" footer. "F" is the + ;; wttr.in flag for "no Follow line"; everything else (forecast, header, + ;; colors) is unchanged. + (setopt wttrin-display-options "F") (setopt wttrin-favorite-location "New Orleans, LA") + ;; Scale the weather font to fit the window width, clamped to a floor/cap + ;; (wttrin-font-height-min/-max, default 100/200). + (setopt wttrin-auto-fit-font t) + ;; Higher-accuracy geolocation via the whereami WiFi-scan script (Google-backed), + ;; far better than IP behind a VPN or cellular hotspot. Used by the picker's + ;; "Current location (detect)" entry; wttrin falls back to its IP provider if the + ;; command is missing or fails. setq (not setopt): wttrin-geolocation-command is + ;; defined in the lazily-loaded wttrin-geolocation sub-module, so it may be unbound + ;; at :config time; the later defcustom won't clobber an already-set value. + (setq wttrin-geolocation-command "/home/cjennings/.local/bin/whereami --json") (setopt wttrin-mode-line-refresh-interval (* 30 60)) ;; thirty minutes (setq wttrin-default-locations '( "New Orleans, LA" diff --git a/modules/wrap-up.el b/modules/wrap-up.el index 503d4a6b0..e28ba8458 100644 --- a/modules/wrap-up.el +++ b/modules/wrap-up.el @@ -1,4 +1,4 @@ -;;; wrapup --- Functions Run Before Init Completion -*- lexical-binding: t; coding: utf-8; -*- +;;; wrap-up.el --- Functions Run Before Init Completion -*- lexical-binding: t; coding: utf-8; -*- ;; author Craig Jennings <c@cjennings.net> ;;; Commentary: diff --git a/scripts/theme-studio/WIP.json b/scripts/theme-studio/WIP.json index 23a0ff46e..5a54729bb 100644 --- a/scripts/theme-studio/WIP.json +++ b/scripts/theme-studio/WIP.json @@ -287,22 +287,27 @@ "ground" ], [ - "#050801", + "#1f2217", + "olive-drab-5", + "olive-drab" + ], + [ + "#2e361d", "olive-drab-4", "olive-drab" ], [ - "#1b2506", + "#3f4c23", "olive-drab-3", "olive-drab" ], [ - "#374712", + "#506328", "olive-drab-2", "olive-drab" ], [ - "#546c20", + "#627b2c", "olive-drab-1", "olive-drab" ], @@ -312,26 +317,31 @@ "olive-drab" ], [ - "#8ea85e", + "#809c50", "olive-drab+1", "olive-drab" ], [ - "#a9be87", + "#8ca46c", "olive-drab+2", "olive-drab" ], [ - "#c5d4ae", + "#98ac86", "olive-drab+3", "olive-drab" ], [ - "#e2e9d6", + "#a5b49f", "olive-drab+4", "olive-drab" ], [ + "#b2bcb7", + "olive-drab+5", + "olive-drab" + ], + [ "#bfc4d0", "fg", "ground" @@ -427,7 +437,7 @@ "sky" ], [ - "#5f8bf9", + "#5178db", "link", "link" ] @@ -788,8 +798,8 @@ "height": null }, "region": { - "fg": "#100f0f", - "bg": "#ab8d2e", + "fg": null, + "bg": "#424f5e", "distant-fg": null, "family": null, "weight": null, @@ -820,11 +830,11 @@ "height": null }, "highlight": { - "fg": "#eddba7", - "bg": null, - "distant-fg": null, + "fg": "#dab53d", + "bg": "#424f5e", + "distant-fg": "#100f0f", "family": null, - "weight": "bold", + "weight": null, "slant": null, "underline": null, "strike": null, @@ -873,7 +883,7 @@ }, "mode-line-inactive": { "fg": "#100f0f", - "bg": "#100f0f", + "bg": null, "distant-fg": null, "family": null, "weight": null, @@ -893,7 +903,7 @@ }, "fringe": { "fg": "#f3e7c5", - "bg": "#100f0f", + "bg": null, "distant-fg": null, "family": null, "weight": "bold", @@ -909,7 +919,7 @@ }, "line-number": { "fg": "#54677d", - "bg": "#100f0f", + "bg": null, "distant-fg": null, "family": null, "weight": null, @@ -925,7 +935,7 @@ }, "line-number-current-line": { "fg": "#e6ce88", - "bg": "#100f0f", + "bg": null, "distant-fg": null, "family": null, "weight": null, @@ -941,7 +951,7 @@ }, "minibuffer-prompt": { "fg": "#899bb1", - "bg": "#100f0f", + "bg": null, "distant-fg": null, "family": null, "weight": "bold", @@ -989,7 +999,7 @@ }, "isearch-fail": { "fg": "#cb6b4d", - "bg": "#100f0f", + "bg": null, "distant-fg": null, "family": null, "weight": "bold", @@ -1036,8 +1046,8 @@ "height": null }, "link": { - "fg": "#0000ee", - "bg": "#100f0f", + "fg": "#5178db", + "bg": null, "distant-fg": null, "family": null, "weight": null, @@ -1056,7 +1066,7 @@ }, "error": { "fg": "#cb6b4d", - "bg": "#100f0f", + "bg": null, "distant-fg": null, "family": null, "weight": "bold", @@ -1072,7 +1082,7 @@ }, "warning": { "fg": "#ab8d2e", - "bg": "#100f0f", + "bg": null, "distant-fg": null, "family": null, "weight": "bold", @@ -1088,7 +1098,7 @@ }, "success": { "fg": "#74932f", - "bg": "#100f0f", + "bg": null, "distant-fg": null, "family": null, "weight": "bold", @@ -1104,7 +1114,7 @@ }, "vertical-border": { "fg": "#4a4b4f", - "bg": "#100f0f", + "bg": null, "distant-fg": null, "family": null, "weight": null, @@ -1130,32 +1140,17 @@ "ty", "cmd", "cm", - "ui:cursor", - "ui:fringe", - "ui:line-number", - "ui:line-number-current-line", - "ui:minibuffer-prompt", - "ui:isearch-fail", - "ui:show-paren-match", - "ui:error", - "ui:warning", - "ui:success", "con", "pkg:git-gutter:git-gutter:deleted", "pkg:git-gutter:git-gutter:modified", "pkg:git-gutter:git-gutter:added", "pkg:git-gutter:git-gutter:unchanged", "pkg:git-gutter:git-gutter:separator", - "ui:link", "p", "pp", "op", "punc", "num", - "ui:lazy-highlight", - "ui:isearch", - "ui:hl-line", - "ui:highlight", "str", "esc", "re", @@ -1321,19 +1316,6 @@ "pkg:company:company-tooltip-search-selection", "pkg:org-noter:org-noter-notes-exist-face", "pkg:org-noter:org-noter-no-notes-exist-face", - "pkg:elfeed:elfeed-search-date-face", - "pkg:elfeed:elfeed-search-title-face", - "pkg:elfeed:elfeed-search-tag-face", - "pkg:elfeed:elfeed-search-unread-count-face", - "pkg:elfeed:elfeed-search-filter-face", - "pkg:elfeed:elfeed-search-last-update-face", - "pkg:elfeed:elfeed-log-date-face", - "pkg:elfeed:elfeed-log-error-level-face", - "pkg:elfeed:elfeed-log-warn-level-face", - "pkg:elfeed:elfeed-log-info-level-face", - "pkg:elfeed:elfeed-log-debug-level-face", - "pkg:elfeed:elfeed-search-unread-title-face", - "pkg:elfeed:elfeed-search-feed-face", "pkg:org-mode:org-scheduled-today", "pkg:ghostel:ghostel-default", "pkg:ghostel:ghostel-fake-cursor", @@ -1360,7 +1342,6 @@ "pkg:shr:shr-h4", "pkg:shr:shr-h5", "pkg:shr:shr-h6", - "pkg:shr:shr-text", "pkg:shr:shr-code", "pkg:shr:shr-mark", "pkg:shr:shr-sup", @@ -1408,32 +1389,12 @@ "pkg:pearl:pearl-modified-unknown", "pkg:pearl:pearl-readonly-comment", "pkg:pearl:pearl-editable-comment", - "ui:mode-line", - "ui:mode-line-highlight", "pkg:alert:alert-high-face", "pkg:alert:alert-normal-face", "pkg:alert:alert-trivial-face", "pkg:alert:alert-urgent-face", "pkg:alert:alert-moderate-face", "pkg:alert:alert-low-face", - "ui:show-paren-mismatch", - "ui:vertical-border", - "pkg:ansi-color:ansi-color-black", - "pkg:ansi-color:ansi-color-red", - "pkg:ansi-color:ansi-color-green", - "pkg:ansi-color:ansi-color-yellow", - "pkg:ansi-color:ansi-color-blue", - "pkg:ansi-color:ansi-color-magenta", - "pkg:ansi-color:ansi-color-cyan", - "pkg:ansi-color:ansi-color-white", - "pkg:ansi-color:ansi-color-bright-black", - "pkg:ansi-color:ansi-color-bright-red", - "pkg:ansi-color:ansi-color-bright-green", - "pkg:ansi-color:ansi-color-bright-yellow", - "pkg:ansi-color:ansi-color-bright-blue", - "pkg:ansi-color:ansi-color-bright-magenta", - "pkg:ansi-color:ansi-color-bright-cyan", - "pkg:ansi-color:ansi-color-bright-white", "pkg:dashboard:dashboard-banner-logo-title", "pkg:json-mode:json-mode-object-name-face", "pkg:malyon:malyon-face-bold", @@ -1497,8 +1458,86 @@ "pkg:dired:dired-flagged", "pkg:dired:dired-ignored", "pkg:dired:dired-warning", - "ui:region", + "pkg:eat:eat-term-color-white", + "pkg:eat:eat-term-color-green", + "pkg:eat:eat-shell-prompt-annotation-failure", + "pkg:eat:eat-shell-prompt-annotation-success", + "pkg:eat:eat-shell-prompt-annotation-running", + "pkg:eat:eat-term-bold", + "pkg:eat:eat-term-italic", + "pkg:eat:eat-term-color-yellow", + "pkg:eat:eat-term-color-blue", + "pkg:eat:eat-term-color-red", + "pkg:eat:eat-term-faint", + "pkg:eat:eat-term-color-magenta", + "pkg:eat:eat-term-color-cyan", + "pkg:eat:eat-term-color-bright-black", + "pkg:eat:eat-term-color-black", + "pkg:eat:eat-term-color-bright-white", + "pkg:eat:eat-term-color-bright-cyan", + "pkg:eat:eat-term-color-bright-magenta", + "pkg:eat:eat-term-color-bright-blue", + "pkg:eat:eat-term-color-bright-yellow", + "pkg:eat:eat-term-color-bright-green", + "pkg:eat:eat-term-color-bright-red", + "pkg:eat:eat-term-slow-blink", + "pkg:eat:eat-term-fast-blink", + "pkg:shr:shr-text", + "pkg:ansi-color:ansi-color-black", + "pkg:ansi-color:ansi-color-red", + "pkg:ansi-color:ansi-color-yellow", + "pkg:ansi-color:ansi-color-blue", + "pkg:ansi-color:ansi-color-magenta", + "pkg:ansi-color:ansi-color-cyan", + "pkg:ansi-color:ansi-color-bright-black", + "pkg:ansi-color:ansi-color-bright-red", + "pkg:ansi-color:ansi-color-bright-yellow", + "pkg:ansi-color:ansi-color-bright-blue", + "pkg:ansi-color:ansi-color-bright-magenta", + "pkg:ansi-color:ansi-color-bright-cyan", + "pkg:ansi-color:ansi-color-green", + "pkg:ansi-color:ansi-color-bright-green", + "pkg:ansi-color:ansi-color-white", + "pkg:ansi-color:ansi-color-bright-white", + "pkg:elfeed:elfeed-search-date-face", + "pkg:elfeed:elfeed-search-title-face", + "pkg:elfeed:elfeed-search-unread-title-face", + "pkg:elfeed:elfeed-search-feed-face", + "pkg:elfeed:elfeed-search-tag-face", + "pkg:elfeed:elfeed-search-unread-count-face", + "pkg:elfeed:elfeed-search-filter-face", + "pkg:elfeed:elfeed-search-last-update-face", + "pkg:elfeed:elfeed-log-date-face", + "pkg:elfeed:elfeed-log-error-level-face", + "pkg:elfeed:elfeed-log-warn-level-face", + "pkg:elfeed:elfeed-log-info-level-face", + "pkg:elfeed:elfeed-log-debug-level-face", + "ui:cursor", + "ui:hl-line", + "ui:highlight", + "ui:mode-line", + "ui:mode-line-highlight", "ui:mode-line-inactive", + "ui:fringe", + "ui:line-number", + "ui:line-number-current-line", + "ui:minibuffer-prompt", + "ui:isearch", + "ui:lazy-highlight", + "ui:isearch-fail", + "ui:show-paren-match", + "ui:show-paren-mismatch", + "ui:link", + "ui:error", + "ui:warning", + "ui:success", + "ui:vertical-border", + "ui:region", + "pkg:dirvish:dirvish-free-space", + "pkg:dirvish:dirvish-hl-line", + "pkg:dirvish:dirvish-hl-line-inactive", + "pkg:dirvish:dirvish-inactive", + "pkg:dirvish:dirvish-file-modes", "pkg:nerd-icons:nerd-icons-blue", "pkg:nerd-icons:nerd-icons-blue-alt", "pkg:nerd-icons:nerd-icons-cyan", @@ -1519,6 +1558,7 @@ "pkg:nerd-icons:nerd-icons-lgreen", "pkg:nerd-icons:nerd-icons-lmaroon", "pkg:nerd-icons:nerd-icons-lorange", + "pkg:nerd-icons:nerd-icons-lpink", "pkg:nerd-icons:nerd-icons-lpurple", "pkg:nerd-icons:nerd-icons-lred", "pkg:nerd-icons:nerd-icons-lsilver", @@ -1532,7 +1572,15 @@ "pkg:nerd-icons:nerd-icons-red-alt", "pkg:nerd-icons:nerd-icons-silver", "pkg:nerd-icons:nerd-icons-yellow", - "pkg:nerd-icons:nerd-icons-lpink" + "pkg:nov-reading:cj/nov-reading-light", + "pkg:nov-reading:cj/nov-reading-dark", + "pkg:nov-reading:cj/nov-reading-sepia", + "pkg:nov-reading:cj/nov-reading-sepia-heading", + "pkg:nov-reading:cj/nov-reading-sepia-link", + "pkg:nov-reading:cj/nov-reading-dark-heading", + "pkg:nov-reading:cj/nov-reading-dark-link", + "pkg:nov-reading:cj/nov-reading-light-heading", + "pkg:nov-reading:cj/nov-reading-light-link" ], "packages": { "org-mode": { @@ -1766,13 +1814,13 @@ "source": "cleared" }, "org-block-begin-line": { - "fg": "#8ea85e", + "fg": "#809c50", "bg": "#100f0f", "inherit": null, "source": "user" }, "org-block-end-line": { - "fg": "#8ea85e", + "fg": "#809c50", "bg": "#100f0f", "inherit": null, "source": "user" @@ -2768,47 +2816,47 @@ }, "elfeed": { "elfeed-search-date-face": { - "fg": "#74932f", + "fg": "#606267", "bg": null, "slant": "italic", "inherit": null, "source": "user" }, "elfeed-search-title-face": { - "fg": "#7c838a", + "fg": "#606267", "bg": null, "slant": "italic", "inherit": null, "source": "user" }, "elfeed-search-unread-title-face": { - "fg": "#e6ce88", + "fg": "#cbd0d6", "bg": null, "inherit": null, "source": "user" }, "elfeed-search-feed-face": { - "fg": "#9f80c9", + "fg": "#7ba1c5", "bg": null, "inherit": null, "source": "user" }, "elfeed-search-tag-face": { - "fg": "#899bb1", + "fg": "#67809c", "bg": null, "slant": "italic", "inherit": null, "source": "user" }, "elfeed-search-unread-count-face": { - "fg": "#ab8d2e", + "fg": "#777980", "bg": null, "slant": "italic", "inherit": null, "source": "user" }, "elfeed-search-filter-face": { - "fg": "#ab8d2e", + "fg": "#777980", "bg": null, "weight": "bold", "slant": "italic", @@ -2816,39 +2864,39 @@ "source": "user" }, "elfeed-search-last-update-face": { - "fg": "#ab8d2e", + "fg": "#777980", "bg": null, "slant": "italic", "inherit": null, "source": "user" }, "elfeed-log-date-face": { - "fg": "#74932f", + "fg": "#777980", "bg": null, "inherit": null, "source": "user" }, "elfeed-log-error-level-face": { - "fg": "#cb6b4d", + "fg": "#a85b42", "bg": null, "weight": "bold", "inherit": null, - "source": "default" + "source": "user" }, "elfeed-log-warn-level-face": { - "fg": "#dab53d", + "fg": "#ab8d2e", "bg": null, "inherit": null, - "source": "default" + "source": "user" }, "elfeed-log-info-level-face": { - "fg": "#74932f", + "fg": "#627b2c", "bg": null, "inherit": null, "source": "user" }, "elfeed-log-debug-level-face": { - "fg": "#a9b2bb", + "fg": "#7c838a", "bg": null, "inherit": null, "source": "user" @@ -2875,7 +2923,7 @@ "source": "user" }, "mu4e-ok-face": { - "fg": "#8ea85e", + "fg": "#809c50", "bg": null, "inherit": null, "source": "user" @@ -3030,7 +3078,7 @@ }, "mu4e-compose-separator-face": { "fg": "#100f0f", - "bg": "#546c20", + "bg": "#627b2c", "weight": "bold", "inherit": null, "source": "user" @@ -3050,7 +3098,7 @@ "source": "user" }, "gnus-header-subject": { - "fg": "#8ea85e", + "fg": "#809c50", "bg": null, "inherit": null, "source": "user" @@ -3184,19 +3232,19 @@ }, "org-faces": { "org-faces-todo": { - "fg": "#8ea85e", + "fg": "#809c50", "bg": null, "inherit": null, "source": "user" }, "org-faces-project": { - "fg": "#8ea85e", + "fg": "#809c50", "bg": null, "inherit": null, "source": "user" }, "org-faces-doing": { - "fg": "#8ea85e", + "fg": "#809c50", "bg": null, "inherit": null, "source": "user" @@ -3220,7 +3268,7 @@ "source": "user" }, "org-faces-delegated": { - "fg": "#8ea85e", + "fg": "#809c50", "bg": null, "inherit": null, "source": "user" @@ -3281,19 +3329,19 @@ "source": "user" }, "org-faces-todo-dim": { - "fg": "#546c20", + "fg": "#627b2c", "bg": "#100f0f", "inherit": null, "source": "user" }, "org-faces-project-dim": { - "fg": "#546c20", + "fg": "#627b2c", "bg": "#100f0f", "inherit": null, "source": "user" }, "org-faces-doing-dim": { - "fg": "#546c20", + "fg": "#627b2c", "bg": "#100f0f", "inherit": null, "source": "user" @@ -3317,7 +3365,7 @@ "source": "user" }, "org-faces-delegated-dim": { - "fg": "#546c20", + "fg": "#627b2c", "bg": "#100f0f", "inherit": null, "source": "user" @@ -3378,225 +3426,269 @@ "source": "user" } }, - "ghostel": { - "ghostel-default": { - "fg": "#edeff1", - "bg": null, - "inherit": null, - "source": "default" - }, - "ghostel-fake-cursor": { - "fg": "#100f0f", + "ansi-color": { + "ansi-color-black": { + "fg": "#222223", "bg": "#a9b2bb", "inherit": null, "source": "user" }, - "ghostel-fake-cursor-box": { - "fg": "#bac1c8", + "ansi-color-red": { + "fg": "#cb6b4d", "bg": null, "inherit": null, - "source": "default" + "source": "user" }, - "ghostel-color-black": { - "fg": "#8e919a", + "ansi-color-green": { + "fg": "#627b2c", "bg": null, "inherit": null, - "source": "default" + "source": "user" }, - "ghostel-color-red": { - "fg": "#cb6b4d", + "ansi-color-yellow": { + "fg": "#ab8d2e", "bg": null, "inherit": null, "source": "user" }, - "ghostel-color-green": { - "fg": "#8ea85e", + "ansi-color-blue": { + "fg": "#67809c", "bg": null, "inherit": null, "source": "user" }, - "ghostel-color-yellow": { - "fg": "#ab8d2e", + "ansi-color-magenta": { + "fg": "#8255b5", "bg": null, "inherit": null, - "source": "default" + "source": "user" }, - "ghostel-color-blue": { - "fg": "#899bb1", + "ansi-color-cyan": { + "fg": "#18788c", "bg": null, "inherit": null, "source": "user" }, - "ghostel-color-magenta": { - "fg": "#9f80c9", + "ansi-color-white": { + "fg": "#bac1c8", "bg": null, "inherit": null, - "source": "default" + "source": "user" }, - "ghostel-color-cyan": { - "fg": "#0096b0", + "ansi-color-bright-black": { + "fg": "#100f0f", "bg": null, - "inherit": null, + "inherit": "ansi-color-black", "source": "user" }, - "ghostel-color-white": { - "fg": "#bac1c8", + "ansi-color-bright-red": { + "fg": "#cb8b7a", "bg": null, - "inherit": null, - "source": "default" + "inherit": "ansi-color-red", + "source": "user" }, - "ghostel-color-bright-black": { - "fg": "#bfc4d0", + "ansi-color-bright-green": { + "fg": "#809c50", + "bg": null, + "inherit": "ansi-color-green", + "source": "user" + }, + "ansi-color-bright-yellow": { + "fg": "#e0c266", + "bg": null, + "inherit": "ansi-color-yellow", + "source": "user" + }, + "ansi-color-bright-blue": { + "fg": "#899bb1", + "bg": null, + "inherit": "ansi-color-blue", + "source": "user" + }, + "ansi-color-bright-magenta": { + "fg": "#bea9dc", + "bg": null, + "inherit": "ansi-color-magenta", + "source": "user" + }, + "ansi-color-bright-cyan": { + "fg": "#47a0b7", + "bg": null, + "inherit": "ansi-color-cyan", + "source": "user" + }, + "ansi-color-bright-white": { + "fg": "#dce0e3", + "bg": null, + "inherit": "ansi-color-white", + "source": "user" + } + }, + "eat": { + "eat-term-color-black": { + "fg": "#100f0f", "bg": null, "inherit": null, - "source": "default" + "source": "user" }, - "ghostel-color-bright-red": { - "fg": "#cb8b7a", + "eat-term-color-red": { + "fg": "#cb6b4d", "bg": null, "inherit": null, "source": "user" }, - "ghostel-color-bright-green": { - "fg": "#8ea85e", + "eat-term-color-green": { + "fg": "#74932f", "bg": null, "inherit": null, "source": "user" }, - "ghostel-color-bright-yellow": { + "eat-term-color-yellow": { "fg": "#e6ce88", "bg": null, "inherit": null, - "source": "default" + "source": "user" }, - "ghostel-color-bright-blue": { - "fg": "#adb6c6", + "eat-term-color-blue": { + "fg": "#67809c", "bg": null, "inherit": null, "source": "user" }, - "ghostel-color-bright-magenta": { - "fg": "#bea9dc", + "eat-term-color-magenta": { + "fg": "#8255b5", "bg": null, "inherit": null, - "source": "default" + "source": "user" }, - "ghostel-color-bright-cyan": { - "fg": "#6ba9bd", + "eat-term-color-cyan": { + "fg": "#88b2c3", "bg": null, "inherit": null, "source": "user" }, - "ghostel-color-bright-white": { - "fg": "#edeff1", + "eat-term-color-white": { + "fg": "#bfc4d0", "bg": null, "inherit": null, - "source": "default" - } - }, - "ansi-color": { - "ansi-color-black": { - "fg": "#100f0f", - "bg": "#bfc4d0", + "source": "user" + }, + "eat-term-color-bright-black": { + "fg": "#8e919a", + "bg": null, + "weight": "bold", "inherit": null, "source": "user" }, - "ansi-color-red": { + "eat-term-color-bright-red": { "fg": "#cb6b4d", "bg": null, + "weight": "bold", "inherit": null, "source": "user" }, - "ansi-color-green": { - "fg": "#8ea85e", + "eat-term-color-bright-green": { + "fg": "#74932f", "bg": null, + "weight": "bold", "inherit": null, "source": "user" }, - "ansi-color-yellow": { - "fg": "#e0c266", + "eat-term-color-bright-yellow": { + "fg": "#e6ce88", "bg": null, + "weight": "bold", "inherit": null, "source": "user" }, - "ansi-color-blue": { + "eat-term-color-bright-blue": { "fg": "#899bb1", "bg": null, + "weight": "bold", "inherit": null, "source": "user" }, - "ansi-color-magenta": { - "fg": "#9f80c9", + "eat-term-color-bright-magenta": { + "fg": "#8255b5", "bg": null, + "weight": "bold", "inherit": null, "source": "user" }, - "ansi-color-cyan": { - "fg": "#47a0b7", + "eat-term-color-bright-cyan": { + "fg": "#6ba9bd", "bg": null, + "weight": "bold", "inherit": null, "source": "user" }, - "ansi-color-white": { - "fg": null, + "eat-term-color-bright-white": { + "fg": "#a9b2bb", "bg": null, + "weight": "bold", "inherit": null, - "source": "default" + "source": "user" }, - "ansi-color-bright-black": { - "fg": "#363638", + "eat-term-bold": { + "fg": null, "bg": null, "weight": "bold", - "inherit": "ansi-color-black", + "inherit": null, "source": "user" }, - "ansi-color-bright-red": { - "fg": null, + "eat-term-faint": { + "fg": "#777980", "bg": null, - "weight": "bold", - "inherit": "ansi-color-red", + "inherit": null, "source": "user" }, - "ansi-color-bright-green": { + "eat-term-italic": { "fg": null, "bg": null, - "weight": "bold", - "inherit": "ansi-color-green", + "slant": "italic", + "inherit": null, "source": "user" }, - "ansi-color-bright-yellow": { + "eat-term-slow-blink": { "fg": null, "bg": null, - "weight": "bold", - "inherit": "ansi-color-yellow", + "inherit": null, "source": "user" }, - "ansi-color-bright-blue": { + "eat-term-fast-blink": { "fg": null, "bg": null, - "weight": "bold", - "inherit": "ansi-color-blue", + "inherit": null, + "source": "default" + }, + "eat-shell-prompt-annotation-success": { + "fg": "#74932f", + "bg": null, + "inherit": null, "source": "user" }, - "ansi-color-bright-magenta": { - "fg": null, + "eat-shell-prompt-annotation-running": { + "fg": "#dab53d", "bg": null, - "weight": "bold", - "inherit": "ansi-color-bright-magenta", + "inherit": null, "source": "user" }, - "ansi-color-bright-cyan": { - "fg": null, + "eat-shell-prompt-annotation-failure": { + "fg": "#a85b42", "bg": null, - "weight": "bold", - "inherit": "ansi-color-cyan", + "inherit": null, "source": "user" }, - "ansi-color-bright-white": { - "fg": null, + "eat-term-color-22": { + "fg": "#002f00", "bg": null, - "weight": "bold", - "inherit": "ansi-color-bright-white", + "inherit": null, + "source": "user" + }, + "eat-term-color-52": { + "fg": "#2f0000", + "bg": null, + "inherit": null, "source": "user" } }, @@ -3935,7 +4027,7 @@ "source": "user" }, "dired-symlink": { - "fg": "#8ea85e", + "fg": "#809c50", "bg": null, "inherit": null, "source": "user" @@ -4005,34 +4097,34 @@ }, "dirvish": { "dirvish-inactive": { - "fg": "#5e6770", + "fg": "#606267", "bg": null, "inherit": null, - "source": "default" + "source": "user" }, "dirvish-free-space": { - "fg": "#5d9b86", + "fg": "#8ca46c", "bg": null, "inherit": null, - "source": "default" + "source": "user" }, "dirvish-hl-line": { - "fg": null, - "bg": "#2f343a", + "fg": "#a9b2bb", + "bg": "#4a4b4f", "inherit": null, - "source": "default" + "source": "user" }, "dirvish-hl-line-inactive": { "fg": null, - "bg": "#1a1714", + "bg": null, "inherit": null, - "source": "default" + "source": "user" }, "dirvish-file-modes": { - "fg": "#838d97", + "fg": "#777980", "bg": null, "inherit": null, - "source": "default" + "source": "user" }, "dirvish-file-link-number": { "fg": "#5e6770", @@ -4294,7 +4386,7 @@ "source": "user" }, "calibredb-author-face": { - "fg": "#8ea85e", + "fg": "#809c50", "bg": null, "inherit": null, "source": "user" @@ -4420,6 +4512,75 @@ "source": "user" } }, + "nov-reading": { + "cj/nov-reading-sepia": { + "fg": "#ab8d2e", + "bg": null, + "inherit": null, + "source": "user" + }, + "cj/nov-reading-dark": { + "fg": "#7c838a", + "bg": null, + "inherit": null, + "source": "user" + }, + "cj/nov-reading-light": { + "fg": "#100f0f", + "bg": "#7c838a", + "inherit": null, + "source": "user" + }, + "cj/nov-reading-sepia-heading": { + "fg": "#54677d", + "bg": null, + "inherit": "cj/nov-reading-sepia", + "height": 1.2, + "source": "user" + }, + "cj/nov-reading-sepia-link": { + "fg": "#5178db", + "bg": null, + "underline": { + "color": null, + "style": "line" + }, + "inherit": null, + "source": "user" + }, + "cj/nov-reading-dark-heading": { + "fg": null, + "bg": null, + "inherit": null, + "source": "default" + }, + "cj/nov-reading-dark-link": { + "fg": "#5178db", + "bg": null, + "underline": { + "color": null, + "style": "line" + }, + "inherit": "cj/nov-reading-dark", + "source": "user" + }, + "cj/nov-reading-light-heading": { + "fg": null, + "bg": null, + "inherit": null, + "source": "default" + }, + "cj/nov-reading-light-link": { + "fg": "#5178db", + "bg": null, + "underline": { + "color": null, + "style": "line" + }, + "inherit": null, + "source": "user" + } + }, "erc": { "erc-header-line": { "fg": "#e4eaf8", @@ -4649,7 +4810,7 @@ }, "org-noter": { "org-noter-notes-exist-face": { - "fg": "#8ea85e", + "fg": "#809c50", "bg": null, "inherit": null, "source": "user" @@ -4669,7 +4830,7 @@ "source": "user" }, "signel-my-msg-face": { - "fg": "#8ea85e", + "fg": "#809c50", "bg": null, "inherit": null, "source": "user" @@ -4698,7 +4859,7 @@ }, "pearl-editable-comment": { "fg": "#dce0e3", - "bg": "#374712", + "bg": "#506328", "inherit": null, "source": "user" }, @@ -5726,13 +5887,13 @@ "source": "user" }, "shr-text": { - "fg": "#bfc4d0", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "shr-link": { - "fg": "#5f8bf9", + "fg": "#5178db", "bg": null, "underline": { "style": "line", @@ -5795,193 +5956,193 @@ }, "nerd-icons": { "nerd-icons-blue": { - "fg": "#67809c", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-blue-alt": { - "fg": "#788da6", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-cyan": { - "fg": "#0096b0", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-cyan-alt": { - "fg": "#47a0b7", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-dblue": { - "fg": "#67809c", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-dcyan": { - "fg": "#18788c", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-dgreen": { - "fg": "#546c20", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-dmaroon": { - "fg": "#a85b42", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-dorange": { - "fg": "#cb8b7a", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-dpink": { - "fg": "#c7a8a5", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-dpurple": { - "fg": "#4a1876", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-dred": { - "fg": "#a85b42", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-dsilver": { - "fg": "#7c838a", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-dyellow": { - "fg": "#e6ce88", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-green": { - "fg": "#74932f", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-lblue": { - "fg": "#aac9ea", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-lcyan": { - "fg": "#88b2c3", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-lgreen": { - "fg": "#a9be87", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-lmaroon": { - "fg": "#a85b42", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-lorange": { - "fg": "#cb8b7a", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-lpink": { - "fg": "#c99990", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-lpurple": { - "fg": "#9f80c9", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-lred": { - "fg": "#cb7b64", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-lsilver": { - "fg": "#bac1c8", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-lyellow": { - "fg": "#eddba7", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-maroon": { - "fg": "#a85b42", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-orange": { - "fg": "#cb7b64", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-pink": { - "fg": "#c7a8a5", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-purple": { - "fg": "#6624a0", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-purple-alt": { - "fg": "#6624a0", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-red": { - "fg": "#cb6b4d", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" }, "nerd-icons-red-alt": { - "fg": "#cb6b4d", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" @@ -5993,7 +6154,7 @@ "source": "user" }, "nerd-icons-yellow": { - "fg": "#e0c266", + "fg": "#a9b2bb", "bg": null, "inherit": null, "source": "user" @@ -6001,7 +6162,7 @@ }, "2048-game": { "twentyfortyeight-face-1024": { - "fg": "#a9be87", + "fg": "#8ca46c", "bg": null, "inherit": null, "source": "user" @@ -6085,7 +6246,7 @@ "source": "user" }, "alert-moderate-face": { - "fg": "#a9be87", + "fg": "#8ca46c", "bg": null, "inherit": null, "source": "user" @@ -6683,7 +6844,7 @@ }, "emms": { "emms-browser-album-face": { - "fg": "#8ea85e", + "fg": "#809c50", "bg": null, "inherit": null, "source": "user" @@ -6758,6 +6919,122 @@ "source": "user" } }, + "ghostel": { + "ghostel-color-black": { + "fg": "#8e919a", + "bg": null, + "inherit": null, + "source": "default" + }, + "ghostel-color-blue": { + "fg": "#899bb1", + "bg": null, + "inherit": null, + "source": "user" + }, + "ghostel-color-bright-black": { + "fg": "#bfc4d0", + "bg": null, + "inherit": null, + "source": "default" + }, + "ghostel-color-bright-blue": { + "fg": "#adb6c6", + "bg": null, + "inherit": null, + "source": "user" + }, + "ghostel-color-bright-cyan": { + "fg": "#6ba9bd", + "bg": null, + "inherit": null, + "source": "user" + }, + "ghostel-color-bright-green": { + "fg": "#809c50", + "bg": null, + "inherit": null, + "source": "user" + }, + "ghostel-color-bright-magenta": { + "fg": "#bea9dc", + "bg": null, + "inherit": null, + "source": "default" + }, + "ghostel-color-bright-red": { + "fg": "#cb8b7a", + "bg": null, + "inherit": null, + "source": "user" + }, + "ghostel-color-bright-white": { + "fg": "#edeff1", + "bg": null, + "inherit": null, + "source": "default" + }, + "ghostel-color-bright-yellow": { + "fg": "#e6ce88", + "bg": null, + "inherit": null, + "source": "default" + }, + "ghostel-color-cyan": { + "fg": "#0096b0", + "bg": null, + "inherit": null, + "source": "user" + }, + "ghostel-color-green": { + "fg": "#809c50", + "bg": null, + "inherit": null, + "source": "user" + }, + "ghostel-color-magenta": { + "fg": "#9f80c9", + "bg": null, + "inherit": null, + "source": "default" + }, + "ghostel-color-red": { + "fg": "#cb6b4d", + "bg": null, + "inherit": null, + "source": "user" + }, + "ghostel-color-white": { + "fg": "#bac1c8", + "bg": null, + "inherit": null, + "source": "default" + }, + "ghostel-color-yellow": { + "fg": "#ab8d2e", + "bg": null, + "inherit": null, + "source": "default" + }, + "ghostel-default": { + "fg": "#edeff1", + "bg": null, + "inherit": null, + "source": "default" + }, + "ghostel-fake-cursor": { + "fg": "#100f0f", + "bg": "#a9b2bb", + "inherit": null, + "source": "user" + }, + "ghostel-fake-cursor-box": { + "fg": "#bac1c8", + "bg": null, + "inherit": null, + "source": "default" + } + }, "highlight-indent-guides": { "highlight-indent-guides-character-face": { "fg": null, @@ -7423,10 +7700,10 @@ }, "nerd-icons-completion": { "nerd-icons-completion-dir-face": { - "fg": null, + "fg": "#dab53d", "bg": null, "inherit": null, - "source": "default" + "source": "user" } }, "orderless": { @@ -7439,7 +7716,7 @@ "source": "user" }, "orderless-match-face-1": { - "fg": "#8ea85e", + "fg": "#809c50", "bg": null, "weight": "bold", "slant": "italic", @@ -7585,7 +7862,7 @@ "source": "user" }, "rainbow-delimiters-depth-3-face": { - "fg": "#a9be87", + "fg": "#8ca46c", "bg": null, "inherit": "rainbow-delimiters-base-face", "source": "user" @@ -8479,6 +8756,32 @@ "source": "default" } }, + "wttrin": { + "wttrin-instructions": { + "fg": null, + "bg": null, + "inherit": null, + "source": "default" + }, + "wttrin-key": { + "fg": null, + "bg": null, + "inherit": null, + "source": "default" + }, + "wttrin-mode-line-stale": { + "fg": null, + "bg": null, + "inherit": null, + "source": "default" + }, + "wttrin-staleness-header": { + "fg": null, + "bg": null, + "inherit": null, + "source": "default" + } + }, "yasnippet": { "yas--field-debug-face": { "fg": null, diff --git a/scripts/theme-studio/app.js b/scripts/theme-studio/app.js index 2f26e138a..75ff9f581 100644 --- a/scripts/theme-studio/app.js +++ b/scripts/theme-studio/app.js @@ -558,9 +558,10 @@ function buildPkgTable(){ PREVIEWS_J const PACKAGE_PREVIEWS={ autodim:renderAutodimPreview,markdown:renderMarkdownPreview, - org:renderOrgPreview,magit:renderMagitPreview,elfeed:renderElfeedPreview,ghostel:renderGhostelPreview,eat:renderEatPreview, + org:renderOrgPreview,magit:renderMagitPreview,elfeed:renderElfeedPreview,eat:renderEatPreview, dashboard:renderDashboardPreview,mu4e:renderMu4ePreview,gnus:renderGnusPreview,orgfaces:renderOrgFacesPreview,lsp:renderLspPreview,gitgutter:renderGitGutterPreview, flycheck:renderFlycheckPreview,dired:renderDiredPreview,dirvish:renderDirvishPreview,calibredb:renderCalibredbPreview, + novreading:renderNovReadingPreview, erc:renderErcPreview,orgdrill:renderOrgdrillPreview,orgnoter:renderOrgnoterPreview,signel:renderSignelPreview, pearl:renderPearlPreview,slack:renderSlackPreview,telega:renderTelegaPreview,shr:renderShrPreview, nerdicons:renderNerdIconsPreview diff --git a/scripts/theme-studio/build-inventory.el b/scripts/theme-studio/build-inventory.el index 04d821453..4455c4096 100644 --- a/scripts/theme-studio/build-inventory.el +++ b/scripts/theme-studio/build-inventory.el @@ -13,8 +13,11 @@ (let ((h (make-hash-table :test 'equal))) (dolist (f (face-list)) (let* ((file (ignore-errors (symbol-file f 'defface))) + ;; Match /elpa/PKG-VERSION/ and also /elpa/PKG/ (unversioned local dev + ;; checkouts cloned in place), so locally-developed packages are + ;; captured too. The version suffix is optional. (pkg (and (stringp file) - (string-match "/\\(?:elpa\\|straight/build\\|site-lisp\\)/\\([a-zA-Z0-9._-]+?\\)-[0-9][^/]*/" file) + (string-match "/\\(?:elpa\\|straight/build\\|site-lisp\\)/\\([a-zA-Z0-9._-]+?\\)\\(?:-[0-9][^/]*\\)?/" file) (match-string 1 file)))) (when pkg (push (symbol-name f) (gethash pkg h))))) (let (al) diff --git a/scripts/theme-studio/build-theme.el b/scripts/theme-studio/build-theme.el index 4432ef57c..e37214991 100644 --- a/scripts/theme-studio/build-theme.el +++ b/scripts/theme-studio/build-theme.el @@ -241,7 +241,7 @@ Empty-attr entries emit nothing (cleared faces drop out)." (format ";;; %s-theme.el --- Generated by theme-studio -*- lexical-binding: t -*-\n" name) "\n;;; Commentary:\n" (format ";; Generated from %s.json by scripts/theme-studio/build-theme.el.\n" name) - ";; Do not hand-edit; re-run the converter.\n" + ";; Treat the JSON as authoritative; regenerate instead of hand-editing this file.\n" "\n;;; Code:\n\n" (format "(deftheme %s\n \"Generated by theme-studio.\")\n\n" name) (format "(custom-theme-set-faces\n '%s\n" name) diff --git a/scripts/theme-studio/capture-default-faces.py b/scripts/theme-studio/capture-default-faces.py index a5214fd5a..b9104c9d7 100644 --- a/scripts/theme-studio/capture-default-faces.py +++ b/scripts/theme-studio/capture-default-faces.py @@ -52,6 +52,11 @@ SYNTAX = { "font-lock-delimiter-face", "font-lock-misc-punctuation-face", ], + "warn": ["font-lock-warning-face"], + "dmark": ["font-lock-doc-markup-face"], + "neg": ["font-lock-negation-char-face"], + "rxgb": ["font-lock-regexp-grouping-backslash"], + "rxgc": ["font-lock-regexp-grouping-construct"], } UI = [ diff --git a/scripts/theme-studio/emacs-default-faces.json b/scripts/theme-studio/emacs-default-faces.json index d68f6798e..2fe97a3f4 100644 --- a/scripts/theme-studio/emacs-default-faces.json +++ b/scripts/theme-studio/emacs-default-faces.json @@ -9217,6 +9217,45 @@ "underline": "nil", "weight": "normal" }, + "font-lock-doc-markup-face": { + "background": "unspecified-bg", + "box": "nil", + "chosenGuiLight": { + "inherit": "font-lock-constant-face" + }, + "default-spec": [ + [ + "t", + ":inherit", + "font-lock-constant-face" + ] + ], + "effectiveGuiLight": { + "background": "white", + "backgroundHex": "#ffffff", + "box": null, + "foreground": "LightGray", + "foregroundHex": "#d3d3d3", + "height": 1, + "inherit": "font-lock-constant-face", + "selectedInherits": [ + "font-lock-constant-face" + ], + "slant": "normal", + "strike": null, + "underline": "t", + "weight": "bold" + }, + "exists": true, + "foreground": "unspecified-fg", + "height": 1, + "inherit": "font-lock-constant-face", + "overline": "nil", + "slant": "normal", + "strike": "nil", + "underline": "t", + "weight": "bold" + }, "font-lock-escape-face": { "background": "unspecified-bg", "box": "nil", @@ -9617,6 +9656,38 @@ "underline": "nil", "weight": "normal" }, + "font-lock-negation-char-face": { + "background": "unspecified-bg", + "box": "nil", + "chosenGuiLight": {}, + "default-spec": [ + [ + "t", + "nil" + ] + ], + "effectiveGuiLight": { + "background": "white", + "backgroundHex": "#ffffff", + "box": null, + "foreground": "black", + "foregroundHex": "#000000", + "height": 1, + "slant": "normal", + "strike": null, + "underline": null, + "weight": "normal" + }, + "exists": true, + "foreground": "unspecified-fg", + "height": 1, + "inherit": "nil", + "overline": "nil", + "slant": "normal", + "strike": "nil", + "underline": "nil", + "weight": "normal" + }, "font-lock-number-face": { "background": "unspecified-bg", "box": "nil", @@ -9869,6 +9940,84 @@ "underline": "nil", "weight": "normal" }, + "font-lock-regexp-grouping-backslash": { + "background": "unspecified-bg", + "box": "nil", + "chosenGuiLight": { + "inherit": "bold" + }, + "default-spec": [ + [ + "t", + ":inherit", + "bold" + ] + ], + "effectiveGuiLight": { + "background": "white", + "backgroundHex": "#ffffff", + "box": null, + "foreground": "black", + "foregroundHex": "#000000", + "height": 1, + "inherit": "bold", + "selectedInherits": [ + "bold" + ], + "slant": "normal", + "strike": null, + "underline": null, + "weight": "normal" + }, + "exists": true, + "foreground": "unspecified-fg", + "height": 1, + "inherit": "bold", + "overline": "nil", + "slant": "normal", + "strike": "nil", + "underline": "nil", + "weight": "bold" + }, + "font-lock-regexp-grouping-construct": { + "background": "unspecified-bg", + "box": "nil", + "chosenGuiLight": { + "inherit": "bold" + }, + "default-spec": [ + [ + "t", + ":inherit", + "bold" + ] + ], + "effectiveGuiLight": { + "background": "white", + "backgroundHex": "#ffffff", + "box": null, + "foreground": "black", + "foregroundHex": "#000000", + "height": 1, + "inherit": "bold", + "selectedInherits": [ + "bold" + ], + "slant": "normal", + "strike": null, + "underline": null, + "weight": "normal" + }, + "exists": true, + "foreground": "unspecified-fg", + "height": 1, + "inherit": "bold", + "overline": "nil", + "slant": "normal", + "strike": "nil", + "underline": "nil", + "weight": "bold" + }, "font-lock-string-face": { "background": "unspecified-bg", "box": "nil", @@ -10384,6 +10533,45 @@ "underline": "nil", "weight": "bold" }, + "font-lock-warning-face": { + "background": "unspecified-bg", + "box": "nil", + "chosenGuiLight": { + "inherit": "error" + }, + "default-spec": [ + [ + "t", + ":inherit", + "error" + ] + ], + "effectiveGuiLight": { + "background": "white", + "backgroundHex": "#ffffff", + "box": null, + "foreground": "Red1", + "foregroundHex": "#ff0000", + "height": 1, + "inherit": "error", + "selectedInherits": [ + "error" + ], + "slant": "normal", + "strike": null, + "underline": null, + "weight": "bold" + }, + "exists": true, + "foreground": "unspecified-fg", + "height": 1, + "inherit": "error", + "overline": "nil", + "slant": "normal", + "strike": "nil", + "underline": "nil", + "weight": "bold" + }, "fringe": { "background": "gray", "box": "nil", @@ -34148,6 +34336,9 @@ "font-lock-constant-face" ], "dec": null, + "dmark": [ + "font-lock-doc-markup-face" + ], "doc": [ "font-lock-doc-face" ], @@ -34163,6 +34354,9 @@ "kw": [ "font-lock-keyword-face" ], + "neg": [ + "font-lock-negation-char-face" + ], "num": [ "font-lock-number-face" ], @@ -34188,6 +34382,12 @@ "re": [ "font-lock-regexp-face" ], + "rxgb": [ + "font-lock-regexp-grouping-backslash" + ], + "rxgc": [ + "font-lock-regexp-grouping-construct" + ], "str": [ "font-lock-string-face" ], @@ -34197,6 +34397,9 @@ "var": [ "font-lock-variable-name-face", "font-lock-variable-use-face" + ], + "warn": [ + "font-lock-warning-face" ] }, "ui-faces": [ diff --git a/scripts/theme-studio/face-coverage.org b/scripts/theme-studio/face-coverage.org index b5f8b795b..4ec9cf285 100644 --- a/scripts/theme-studio/face-coverage.org +++ b/scripts/theme-studio/face-coverage.org @@ -1,5 +1,5 @@ #+TITLE: theme-studio — face coverage master list -#+DATE: 2026-06-18 +#+DATE: 2026-06-27 #+TODO: TODO DOING | DONE #+STARTUP: overview @@ -12,13 +12,13 @@ Tier is decided by where each face's defface lives: /usr/share/emacs = built-in, The line under each bucket is its group/package description; the line under each face is its Emacs docstring (first line), where one exists. -Totals: 690 / 1293 faces covered; 1129 carry a docstring. Tiers: core 1, general 75, packages 43. +Totals: 690 / 1750 faces covered; 1709 carry a docstring. Tiers: core 1, general 75, packages 51. Coverage tiers in the studio: syntax font-lock=23, UI tier=21, package inventory=643 (39 packages). Mechanism to close a TODO: core/UI faces -> UI_FACES in generate.py; package + subsystem faces -> package-inventory.json (regenerable via build-inventory.el / app_inventory.py). -* DOING emacs-core [24/74] +* DOING emacs-core [24/75] Standalone built-in faces: frame chrome, cursor, region, mode line, search, line numbers, base typography. ** TODO blink-matching-paren-offscreen Face for showing in the echo area matched open paren that is off-screen. @@ -168,8 +168,10 @@ Mechanism to close a TODO: core/UI faces -> UI_FACES in generate.py; package + s Basic face for first pixel line/column of window dividers. ** TODO window-divider-last-pixel Basic face for last pixel line/column of window dividers. +** TODO wttrin-instructions-header + Face for the two column headers in the weather buffer footer. -* DOING emacs-general [23/563] +* DOING emacs-general [23/523] Built-in Emacs subsystems, one child per subsystem. ** TODO abbrev [0/1] Abbreviation handling, typing shortcuts, macros. @@ -375,10 +377,16 @@ Mechanism to close a TODO: core/UI faces -> UI_FACES in generate.py; package + s Face used for unpushable variable tags. *** TODO custom-visibility Face for the 'custom-visibility' widget. -** TODO diary [0/1] - Faces for diary entries in the calendar. +** TODO diary [0/4] + Emacs diary. *** TODO diary Face for highlighting diary entries. +*** TODO diary-anniversary + Face used for anniversaries in the fancy diary display. +*** TODO diary-button + Face used for buttons in the fancy diary display. +*** TODO diary-time + Face used for times of day in the fancy diary display. ** TODO diff [0/18] Comparing files with `diff'. *** TODO diff-added @@ -475,136 +483,6 @@ Mechanism to close a TODO: core/UI faces -> UI_FACES in generate.py; package + s Face used for displaying the low validity. *** TODO epa-validity-medium Face for medium validity EPA information. -** TODO erc [0/31] - Emacs Internet Relay Chat client. -*** TODO erc-action-face - ERC face for actions generated by /ME. -*** TODO erc-bold-face - ERC bold face. -*** TODO erc-button - ERC button face. -*** TODO erc-button-nick-default-face - Default face for a buttonized nickname. -*** TODO erc-command-indicator-face - Face for echoed command lines, including the prompt. -*** TODO erc-current-nick-face - ERC face for occurrences of your current nickname. -*** TODO erc-dangerous-host-face - ERC face for people on dangerous hosts. -*** TODO erc-default-face - ERC default face. -*** TODO erc-direct-msg-face - ERC face used for messages you receive in the main erc buffer. -*** TODO erc-error-face - ERC face for errors. -*** TODO erc-fill-wrap-merge-indicator-face - ERC 'fill-wrap' merge-indicator face. -*** TODO erc-fool-face - ERC face for fools on the channel. -*** TODO erc-header-line - ERC face used for the header line. -*** TODO erc-information - Face for local administrative messages of low to moderate importance. -*** TODO erc-input-face - ERC face used for your input. -*** TODO erc-inverse-face - ERC inverse face. -*** TODO erc-italic-face - ERC italic face. -*** TODO erc-keep-place-indicator-arrow - Face for arrow value of option 'erc-keep-place-indicator-style'. -*** TODO erc-keep-place-indicator-line - Face for option 'erc-keep-place-indicator-style'. -*** TODO erc-keyword-face - ERC face for your keywords. -*** TODO erc-my-nick-face - ERC face for your current nickname in messages sent by you. -*** TODO erc-my-nick-prefix-face - ERC face used for my user mode prefix. -*** TODO erc-nick-default-face - ERC nickname default face. -*** TODO erc-nick-msg-face - ERC nickname face for private messages. -*** TODO erc-nick-prefix-face - ERC face used for user mode prefix. -*** TODO erc-notice-face - ERC face for notices. -*** TODO erc-pal-face - ERC face for your pals. -*** TODO erc-prompt-face - ERC face for the prompt. -*** TODO erc-spoiler-face - ERC spoiler face. -*** TODO erc-timestamp-face - ERC timestamp face. -*** TODO erc-underline-face - ERC underline face. -** TODO erc-ansi [0/32] - Emacs Internet Relay Chat client. -*** TODO bg:erc-color-face0 - ERC face. -*** TODO bg:erc-color-face1 - ERC face. -*** TODO bg:erc-color-face10 - ERC face. -*** TODO bg:erc-color-face11 - ERC face. -*** TODO bg:erc-color-face12 - ERC face. -*** TODO bg:erc-color-face13 - ERC face. -*** TODO bg:erc-color-face14 - ERC face. -*** TODO bg:erc-color-face15 - ERC face. -*** TODO bg:erc-color-face2 - ERC face. -*** TODO bg:erc-color-face3 - ERC face. -*** TODO bg:erc-color-face4 - ERC face. -*** TODO bg:erc-color-face5 - ERC face. -*** TODO bg:erc-color-face6 - ERC face. -*** TODO bg:erc-color-face7 - ERC face. -*** TODO bg:erc-color-face8 - ERC face. -*** TODO bg:erc-color-face9 - ERC face. -*** TODO fg:erc-color-face0 - ERC face. -*** TODO fg:erc-color-face1 - ERC face. -*** TODO fg:erc-color-face10 - ERC face. -*** TODO fg:erc-color-face11 - ERC face. -*** TODO fg:erc-color-face12 - ERC face. -*** TODO fg:erc-color-face13 - ERC face. -*** TODO fg:erc-color-face14 - ERC face. -*** TODO fg:erc-color-face15 - ERC face. -*** TODO fg:erc-color-face2 - ERC face. -*** TODO fg:erc-color-face3 - ERC face. -*** TODO fg:erc-color-face4 - ERC face. -*** TODO fg:erc-color-face5 - ERC face. -*** TODO fg:erc-color-face6 - ERC face. -*** TODO fg:erc-color-face7 - ERC face. -*** TODO fg:erc-color-face8 - ERC face. -*** TODO fg:erc-color-face9 - ERC face. ** TODO ert [0/2] ERT, the Emacs Lisp regression testing tool. *** TODO ert-test-result-expected @@ -637,6 +515,12 @@ Mechanism to close a TODO: core/UI faces -> UI_FACES in generate.py; package + s Support for editing files. *** TODO file-name-shadow Face used by 'file-name-shadow-mode' for the shadow. +** TODO flyspell [0/2] + Spell checking on the fly. +*** TODO flyspell-duplicate + Flyspell face for words that appear twice in a row. +*** TODO flyspell-incorrect + Flyspell face for misspelled words. ** DOING font-lock [23/28] Font Lock mode text highlighting package. *** DONE font-lock-bracket-face @@ -850,20 +734,6 @@ Mechanism to close a TODO: core/UI faces -> UI_FACES in generate.py; package + s Face for buttons. *** TODO icon-button Face for buttons. -** TODO image-dired [0/6] - Use Dired to browse your images as thumbnails, and more. -*** TODO image-dired-thumb-flagged - Face for images flagged for deletion in thumbnail buffer. -*** TODO image-dired-thumb-header-directory-name - Face for the directory name in the header line of the thumbnail buffer. -*** TODO image-dired-thumb-header-file-name - Face for the file name in the header line of the thumbnail buffer. -*** TODO image-dired-thumb-header-file-size - Face for the file size in the header line of the thumbnail buffer. -*** TODO image-dired-thumb-header-image-count - Face for the image count in the header line of the thumbnail buffer. -*** TODO image-dired-thumb-mark - Face for marked images in thumbnail buffer. ** TODO info [0/13] Info subsystem. *** TODO Info-quoted @@ -1357,6 +1227,58 @@ Mechanism to close a TODO: core/UI faces -> UI_FACES in generate.py; package + s Tabulated-list customization group. *** TODO tabulated-list-fake-header Face used on fake header lines. +** TODO term [0/23] + General command interpreter in a window. +*** TODO term + Default face to use in Term mode. +*** TODO term-bold + Default face to use for bold text. +*** TODO term-color-black + Face used to render black color code. +*** TODO term-color-blue + Face used to render blue color code. +*** TODO term-color-bright-black + Face used to render bright black color code. +*** TODO term-color-bright-blue + Face used to render bright blue color code. +*** TODO term-color-bright-cyan + Face used to render bright cyan color code. +*** TODO term-color-bright-green + Face used to render bright green color code. +*** TODO term-color-bright-magenta + Face used to render bright magenta color code. +*** TODO term-color-bright-red + Face used to render bright red color code. +*** TODO term-color-bright-white + Face used to render bright white color code. +*** TODO term-color-bright-yellow + Face used to render bright yellow color code. +*** TODO term-color-cyan + Face used to render cyan color code. +*** TODO term-color-green + Face used to render green color code. +*** TODO term-color-magenta + Face used to render magenta color code. +*** TODO term-color-red + Face used to render red color code. +*** TODO term-color-white + Face used to render white color code. +*** TODO term-color-yellow + Face used to render yellow color code. +*** TODO term-faint + Default face to use for faint text. +*** TODO term-fast-blink + Default face to use for rapidly blinking text. +*** TODO term-italic + Default face to use for italic text. +*** TODO term-slow-blink + Default face to use for slowly blinking text. +*** TODO term-underline + Default face to use for underlined text. +** TODO textsec-check.elc [0/1] + Suspicious text identification. +*** TODO textsec-suspicious + Face used to highlight suspicious strings. ** TODO treesit [0/2] Incremental parser. *** TODO treesit-explorer-anonymous-node @@ -1364,7 +1286,7 @@ Mechanism to close a TODO: core/UI faces -> UI_FACES in generate.py; package + s *** TODO treesit-explorer-field-name Face for field names in tree-sitter explorer. ** TODO vc [0/12] - Faces used in the mode line by the VC state indicator. + Emacs interface to version control systems. *** TODO vc-conflict-state Face for VC modeline state when the file contains merge conflicts. *** TODO vc-edited-state @@ -1537,6 +1459,80 @@ Mechanism to close a TODO: core/UI faces -> UI_FACES in generate.py; package + s ** TODO auto-dim-other-buffers-hide Face with a (presumably) dimmed background and matching foreground. +* TODO calibredb [0/28] + Calibredb group. +** TODO calibredb-archive-face + Face used for archive. +** TODO calibredb-author-face + Face used for author. +** TODO calibredb-comment-face + Face used for comment. +** TODO calibredb-current-page-button-face + Face used for current page button +** TODO calibredb-date-face + Face for the date (last_modified). +** TODO calibredb-edit-annotation-header-title-face + Face used for *calibredb-edit-annotation* header title face. +** TODO calibredb-favorite-face + Face used for title. +** TODO calibredb-file-face + Face for the file path. +** TODO calibredb-format-face + Face used for format. +** TODO calibredb-highlight-face + Face used for hightlight. +** TODO calibredb-id-face + Face used for id. +** TODO calibredb-ids-face + Face used for ids. +** TODO calibredb-language-face + Face for the language. +** TODO calibredb-mark-face + Face for the mark candidate. +** TODO calibredb-mouse-face + Face used for *calibredb-search* mouse face. +** TODO calibredb-pubdate-face + Face for the publish date. +** TODO calibredb-publisher-face + Face for the publisher. +** TODO calibredb-search-header-filter-face + Face used for filter field in *calibredb-search* header. +** TODO calibredb-search-header-highlight-face + Face for the header at point. +** TODO calibredb-search-header-library-name-face + Face used for library name in *calibredb-search* header. +** TODO calibredb-search-header-library-path-face + Face used for library path in *calibredb-search* header. +** TODO calibredb-search-header-sort-face + Face used for sort field in *calibredb-search* header. +** TODO calibredb-search-header-total-face + Face used for total count in *calibredb-search* header. +** TODO calibredb-series-face + Face for the series. +** TODO calibredb-size-face + Face used for size. +** TODO calibredb-tag-face + Face used for tag. +** TODO calibredb-title-detailed-view-face + Face used for title on detailed view. +** TODO calibredb-title-face + Face used for title on compact view. + +* TODO circe [0/6] + Client for IRC in Emacs. +** TODO lui-button-face + Default face used for LUI buttons. +** TODO lui-deleted-face + Face for deleted messages +** TODO lui-emphasis-face + Face for emphasis markup. +** TODO lui-highlight-face + Lui mode face used for highlighting. +** TODO lui-strong-face + Face used for strong markup. +** TODO lui-time-stamp-face + Lui mode face used for time stamps. + * DONE company [19/19] Extensible inline text completion mechanism. ** DONE company-echo @@ -1667,14 +1663,23 @@ Mechanism to close a TODO: core/UI faces -> UI_FACES in generate.py; package + s ** DONE dirvish-emerge-group-title Face used for emerge group title. ** DONE dirvish-file-device-number + Face used for filesystem device number mode-line segment. ** DONE dirvish-file-group-id + Face used for file group id mode-line segment. ** DONE dirvish-file-inode-number + Face used for file inode number mode-line segment. ** DONE dirvish-file-link-number + Face used for file link number mode-line segment. ** DONE dirvish-file-modes + Face used for 'file-modes' attribute and mode line segment. ** DONE dirvish-file-size + Face used for 'file-size' attribute and mode-line segment. ** DONE dirvish-file-time + Face used for 'file-time' attribute and mode line segment. ** DONE dirvish-file-user-id + Face used for file size attributes / mode-line segment. ** DONE dirvish-free-space + Face used for 'free-space' mode-line segment. ** DONE dirvish-git-commit-message-face Face for commit message overlays. ** DONE dirvish-hl-line @@ -1684,7 +1689,9 @@ Mechanism to close a TODO: core/UI faces -> UI_FACES in generate.py; package + s ** DONE dirvish-inactive Face used for mode-line segments in unfocused Dirvish windows. ** DONE dirvish-media-info-heading + Face used for heading of media property groups. ** DONE dirvish-media-info-property-key + Face used for emerge group title. ** DONE dirvish-narrow-match-face-0 Face for matches of components numbered 0 mod 4. ** DONE dirvish-narrow-match-face-1 @@ -1724,6 +1731,557 @@ Mechanism to close a TODO: core/UI faces -> UI_FACES in generate.py; package + s ** DONE dirvish-vc-unregistered-face Face used for 'unregistered' vc state in the Dirvish buffer. +* TODO eat [0/274] + Emulate A Terminal. +** TODO eat-shell-prompt-annotation-failure + Face used in annotation to indicate the command has failed. +** TODO eat-shell-prompt-annotation-running + Face used in annotation to indicate the command is running. +** TODO eat-shell-prompt-annotation-success + Face used in annotation to indicate the command has succeeded. +** TODO eat-term-bold + Face used to render bold text. +** TODO eat-term-color-0 + Face used to render black color text. +** TODO eat-term-color-1 + Face used to render red color text. +** TODO eat-term-color-10 + Face used to render bright green color text. +** TODO eat-term-color-100 + Face used to render text with 100th color of 256 color palette. +** TODO eat-term-color-101 + Face used to render text with 101st color of 256 color palette. +** TODO eat-term-color-102 + Face used to render text with 102nd color of 256 color palette. +** TODO eat-term-color-103 + Face used to render text with 103rd color of 256 color palette. +** TODO eat-term-color-104 + Face used to render text with 104th color of 256 color palette. +** TODO eat-term-color-105 + Face used to render text with 105th color of 256 color palette. +** TODO eat-term-color-106 + Face used to render text with 106th color of 256 color palette. +** TODO eat-term-color-107 + Face used to render text with 107th color of 256 color palette. +** TODO eat-term-color-108 + Face used to render text with 108th color of 256 color palette. +** TODO eat-term-color-109 + Face used to render text with 109th color of 256 color palette. +** TODO eat-term-color-11 + Face used to render bright yellow color text. +** TODO eat-term-color-110 + Face used to render text with 110th color of 256 color palette. +** TODO eat-term-color-111 + Face used to render text with 111th color of 256 color palette. +** TODO eat-term-color-112 + Face used to render text with 112th color of 256 color palette. +** TODO eat-term-color-113 + Face used to render text with 113th color of 256 color palette. +** TODO eat-term-color-114 + Face used to render text with 114th color of 256 color palette. +** TODO eat-term-color-115 + Face used to render text with 115th color of 256 color palette. +** TODO eat-term-color-116 + Face used to render text with 116th color of 256 color palette. +** TODO eat-term-color-117 + Face used to render text with 117th color of 256 color palette. +** TODO eat-term-color-118 + Face used to render text with 118th color of 256 color palette. +** TODO eat-term-color-119 + Face used to render text with 119th color of 256 color palette. +** TODO eat-term-color-12 + Face used to render bright blue color text. +** TODO eat-term-color-120 + Face used to render text with 120th color of 256 color palette. +** TODO eat-term-color-121 + Face used to render text with 121st color of 256 color palette. +** TODO eat-term-color-122 + Face used to render text with 122nd color of 256 color palette. +** TODO eat-term-color-123 + Face used to render text with 123rd color of 256 color palette. +** TODO eat-term-color-124 + Face used to render text with 124th color of 256 color palette. +** TODO eat-term-color-125 + Face used to render text with 125th color of 256 color palette. +** TODO eat-term-color-126 + Face used to render text with 126th color of 256 color palette. +** TODO eat-term-color-127 + Face used to render text with 127th color of 256 color palette. +** TODO eat-term-color-128 + Face used to render text with 128th color of 256 color palette. +** TODO eat-term-color-129 + Face used to render text with 129th color of 256 color palette. +** TODO eat-term-color-13 + Face used to render bright magenta color text. +** TODO eat-term-color-130 + Face used to render text with 130th color of 256 color palette. +** TODO eat-term-color-131 + Face used to render text with 131st color of 256 color palette. +** TODO eat-term-color-132 + Face used to render text with 132nd color of 256 color palette. +** TODO eat-term-color-133 + Face used to render text with 133rd color of 256 color palette. +** TODO eat-term-color-134 + Face used to render text with 134th color of 256 color palette. +** TODO eat-term-color-135 + Face used to render text with 135th color of 256 color palette. +** TODO eat-term-color-136 + Face used to render text with 136th color of 256 color palette. +** TODO eat-term-color-137 + Face used to render text with 137th color of 256 color palette. +** TODO eat-term-color-138 + Face used to render text with 138th color of 256 color palette. +** TODO eat-term-color-139 + Face used to render text with 139th color of 256 color palette. +** TODO eat-term-color-14 + Face used to render bright cyan color text. +** TODO eat-term-color-140 + Face used to render text with 140th color of 256 color palette. +** TODO eat-term-color-141 + Face used to render text with 141st color of 256 color palette. +** TODO eat-term-color-142 + Face used to render text with 142nd color of 256 color palette. +** TODO eat-term-color-143 + Face used to render text with 143rd color of 256 color palette. +** TODO eat-term-color-144 + Face used to render text with 144th color of 256 color palette. +** TODO eat-term-color-145 + Face used to render text with 145th color of 256 color palette. +** TODO eat-term-color-146 + Face used to render text with 146th color of 256 color palette. +** TODO eat-term-color-147 + Face used to render text with 147th color of 256 color palette. +** TODO eat-term-color-148 + Face used to render text with 148th color of 256 color palette. +** TODO eat-term-color-149 + Face used to render text with 149th color of 256 color palette. +** TODO eat-term-color-15 + Face used to render bright white color text. +** TODO eat-term-color-150 + Face used to render text with 150th color of 256 color palette. +** TODO eat-term-color-151 + Face used to render text with 151st color of 256 color palette. +** TODO eat-term-color-152 + Face used to render text with 152nd color of 256 color palette. +** TODO eat-term-color-153 + Face used to render text with 153rd color of 256 color palette. +** TODO eat-term-color-154 + Face used to render text with 154th color of 256 color palette. +** TODO eat-term-color-155 + Face used to render text with 155th color of 256 color palette. +** TODO eat-term-color-156 + Face used to render text with 156th color of 256 color palette. +** TODO eat-term-color-157 + Face used to render text with 157th color of 256 color palette. +** TODO eat-term-color-158 + Face used to render text with 158th color of 256 color palette. +** TODO eat-term-color-159 + Face used to render text with 159th color of 256 color palette. +** TODO eat-term-color-16 + Face used to render text with 16th color of 256 color palette. +** TODO eat-term-color-160 + Face used to render text with 160th color of 256 color palette. +** TODO eat-term-color-161 + Face used to render text with 161st color of 256 color palette. +** TODO eat-term-color-162 + Face used to render text with 162nd color of 256 color palette. +** TODO eat-term-color-163 + Face used to render text with 163rd color of 256 color palette. +** TODO eat-term-color-164 + Face used to render text with 164th color of 256 color palette. +** TODO eat-term-color-165 + Face used to render text with 165th color of 256 color palette. +** TODO eat-term-color-166 + Face used to render text with 166th color of 256 color palette. +** TODO eat-term-color-167 + Face used to render text with 167th color of 256 color palette. +** TODO eat-term-color-168 + Face used to render text with 168th color of 256 color palette. +** TODO eat-term-color-169 + Face used to render text with 169th color of 256 color palette. +** TODO eat-term-color-17 + Face used to render text with 17th color of 256 color palette. +** TODO eat-term-color-170 + Face used to render text with 170th color of 256 color palette. +** TODO eat-term-color-171 + Face used to render text with 171st color of 256 color palette. +** TODO eat-term-color-172 + Face used to render text with 172nd color of 256 color palette. +** TODO eat-term-color-173 + Face used to render text with 173rd color of 256 color palette. +** TODO eat-term-color-174 + Face used to render text with 174th color of 256 color palette. +** TODO eat-term-color-175 + Face used to render text with 175th color of 256 color palette. +** TODO eat-term-color-176 + Face used to render text with 176th color of 256 color palette. +** TODO eat-term-color-177 + Face used to render text with 177th color of 256 color palette. +** TODO eat-term-color-178 + Face used to render text with 178th color of 256 color palette. +** TODO eat-term-color-179 + Face used to render text with 179th color of 256 color palette. +** TODO eat-term-color-18 + Face used to render text with 18th color of 256 color palette. +** TODO eat-term-color-180 + Face used to render text with 180th color of 256 color palette. +** TODO eat-term-color-181 + Face used to render text with 181st color of 256 color palette. +** TODO eat-term-color-182 + Face used to render text with 182nd color of 256 color palette. +** TODO eat-term-color-183 + Face used to render text with 183rd color of 256 color palette. +** TODO eat-term-color-184 + Face used to render text with 184th color of 256 color palette. +** TODO eat-term-color-185 + Face used to render text with 185th color of 256 color palette. +** TODO eat-term-color-186 + Face used to render text with 186th color of 256 color palette. +** TODO eat-term-color-187 + Face used to render text with 187th color of 256 color palette. +** TODO eat-term-color-188 + Face used to render text with 188th color of 256 color palette. +** TODO eat-term-color-189 + Face used to render text with 189th color of 256 color palette. +** TODO eat-term-color-19 + Face used to render text with 19th color of 256 color palette. +** TODO eat-term-color-190 + Face used to render text with 190th color of 256 color palette. +** TODO eat-term-color-191 + Face used to render text with 191st color of 256 color palette. +** TODO eat-term-color-192 + Face used to render text with 192nd color of 256 color palette. +** TODO eat-term-color-193 + Face used to render text with 193rd color of 256 color palette. +** TODO eat-term-color-194 + Face used to render text with 194th color of 256 color palette. +** TODO eat-term-color-195 + Face used to render text with 195th color of 256 color palette. +** TODO eat-term-color-196 + Face used to render text with 196th color of 256 color palette. +** TODO eat-term-color-197 + Face used to render text with 197th color of 256 color palette. +** TODO eat-term-color-198 + Face used to render text with 198th color of 256 color palette. +** TODO eat-term-color-199 + Face used to render text with 199th color of 256 color palette. +** TODO eat-term-color-2 + Face used to render green color text. +** TODO eat-term-color-20 + Face used to render text with 20th color of 256 color palette. +** TODO eat-term-color-200 + Face used to render text with 200th color of 256 color palette. +** TODO eat-term-color-201 + Face used to render text with 201st color of 256 color palette. +** TODO eat-term-color-202 + Face used to render text with 202nd color of 256 color palette. +** TODO eat-term-color-203 + Face used to render text with 203rd color of 256 color palette. +** TODO eat-term-color-204 + Face used to render text with 204th color of 256 color palette. +** TODO eat-term-color-205 + Face used to render text with 205th color of 256 color palette. +** TODO eat-term-color-206 + Face used to render text with 206th color of 256 color palette. +** TODO eat-term-color-207 + Face used to render text with 207th color of 256 color palette. +** TODO eat-term-color-208 + Face used to render text with 208th color of 256 color palette. +** TODO eat-term-color-209 + Face used to render text with 209th color of 256 color palette. +** TODO eat-term-color-21 + Face used to render text with 21st color of 256 color palette. +** TODO eat-term-color-210 + Face used to render text with 210th color of 256 color palette. +** TODO eat-term-color-211 + Face used to render text with 211th color of 256 color palette. +** TODO eat-term-color-212 + Face used to render text with 212th color of 256 color palette. +** TODO eat-term-color-213 + Face used to render text with 213th color of 256 color palette. +** TODO eat-term-color-214 + Face used to render text with 214th color of 256 color palette. +** TODO eat-term-color-215 + Face used to render text with 215th color of 256 color palette. +** TODO eat-term-color-216 + Face used to render text with 216th color of 256 color palette. +** TODO eat-term-color-217 + Face used to render text with 217th color of 256 color palette. +** TODO eat-term-color-218 + Face used to render text with 218th color of 256 color palette. +** TODO eat-term-color-219 + Face used to render text with 219th color of 256 color palette. +** TODO eat-term-color-22 + Face used to render text with 22nd color of 256 color palette. +** TODO eat-term-color-220 + Face used to render text with 220th color of 256 color palette. +** TODO eat-term-color-221 + Face used to render text with 221st color of 256 color palette. +** TODO eat-term-color-222 + Face used to render text with 222nd color of 256 color palette. +** TODO eat-term-color-223 + Face used to render text with 223rd color of 256 color palette. +** TODO eat-term-color-224 + Face used to render text with 224th color of 256 color palette. +** TODO eat-term-color-225 + Face used to render text with 225th color of 256 color palette. +** TODO eat-term-color-226 + Face used to render text with 226th color of 256 color palette. +** TODO eat-term-color-227 + Face used to render text with 227th color of 256 color palette. +** TODO eat-term-color-228 + Face used to render text with 228th color of 256 color palette. +** TODO eat-term-color-229 + Face used to render text with 229th color of 256 color palette. +** TODO eat-term-color-23 + Face used to render text with 23rd color of 256 color palette. +** TODO eat-term-color-230 + Face used to render text with 230th color of 256 color palette. +** TODO eat-term-color-231 + Face used to render text with 231st color of 256 color palette. +** TODO eat-term-color-232 + Face used to render text with 232nd color of 256 color palette. +** TODO eat-term-color-233 + Face used to render text with 233rd color of 256 color palette. +** TODO eat-term-color-234 + Face used to render text with 234th color of 256 color palette. +** TODO eat-term-color-235 + Face used to render text with 235th color of 256 color palette. +** TODO eat-term-color-236 + Face used to render text with 236th color of 256 color palette. +** TODO eat-term-color-237 + Face used to render text with 237th color of 256 color palette. +** TODO eat-term-color-238 + Face used to render text with 238th color of 256 color palette. +** TODO eat-term-color-239 + Face used to render text with 239th color of 256 color palette. +** TODO eat-term-color-24 + Face used to render text with 24th color of 256 color palette. +** TODO eat-term-color-240 + Face used to render text with 240th color of 256 color palette. +** TODO eat-term-color-241 + Face used to render text with 241st color of 256 color palette. +** TODO eat-term-color-242 + Face used to render text with 242nd color of 256 color palette. +** TODO eat-term-color-243 + Face used to render text with 243rd color of 256 color palette. +** TODO eat-term-color-244 + Face used to render text with 244th color of 256 color palette. +** TODO eat-term-color-245 + Face used to render text with 245th color of 256 color palette. +** TODO eat-term-color-246 + Face used to render text with 246th color of 256 color palette. +** TODO eat-term-color-247 + Face used to render text with 247th color of 256 color palette. +** TODO eat-term-color-248 + Face used to render text with 248th color of 256 color palette. +** TODO eat-term-color-249 + Face used to render text with 249th color of 256 color palette. +** TODO eat-term-color-25 + Face used to render text with 25th color of 256 color palette. +** TODO eat-term-color-250 + Face used to render text with 250th color of 256 color palette. +** TODO eat-term-color-251 + Face used to render text with 251st color of 256 color palette. +** TODO eat-term-color-252 + Face used to render text with 252nd color of 256 color palette. +** TODO eat-term-color-253 + Face used to render text with 253rd color of 256 color palette. +** TODO eat-term-color-254 + Face used to render text with 254th color of 256 color palette. +** TODO eat-term-color-255 + Face used to render text with 255th color of 256 color palette. +** TODO eat-term-color-26 + Face used to render text with 26th color of 256 color palette. +** TODO eat-term-color-27 + Face used to render text with 27th color of 256 color palette. +** TODO eat-term-color-28 + Face used to render text with 28th color of 256 color palette. +** TODO eat-term-color-29 + Face used to render text with 29th color of 256 color palette. +** TODO eat-term-color-3 + Face used to render yellow color text. +** TODO eat-term-color-30 + Face used to render text with 30th color of 256 color palette. +** TODO eat-term-color-31 + Face used to render text with 31st color of 256 color palette. +** TODO eat-term-color-32 + Face used to render text with 32nd color of 256 color palette. +** TODO eat-term-color-33 + Face used to render text with 33rd color of 256 color palette. +** TODO eat-term-color-34 + Face used to render text with 34th color of 256 color palette. +** TODO eat-term-color-35 + Face used to render text with 35th color of 256 color palette. +** TODO eat-term-color-36 + Face used to render text with 36th color of 256 color palette. +** TODO eat-term-color-37 + Face used to render text with 37th color of 256 color palette. +** TODO eat-term-color-38 + Face used to render text with 38th color of 256 color palette. +** TODO eat-term-color-39 + Face used to render text with 39th color of 256 color palette. +** TODO eat-term-color-4 + Face used to render blue color text. +** TODO eat-term-color-40 + Face used to render text with 40th color of 256 color palette. +** TODO eat-term-color-41 + Face used to render text with 41st color of 256 color palette. +** TODO eat-term-color-42 + Face used to render text with 42nd color of 256 color palette. +** TODO eat-term-color-43 + Face used to render text with 43rd color of 256 color palette. +** TODO eat-term-color-44 + Face used to render text with 44th color of 256 color palette. +** TODO eat-term-color-45 + Face used to render text with 45th color of 256 color palette. +** TODO eat-term-color-46 + Face used to render text with 46th color of 256 color palette. +** TODO eat-term-color-47 + Face used to render text with 47th color of 256 color palette. +** TODO eat-term-color-48 + Face used to render text with 48th color of 256 color palette. +** TODO eat-term-color-49 + Face used to render text with 49th color of 256 color palette. +** TODO eat-term-color-5 + Face used to render magenta color text. +** TODO eat-term-color-50 + Face used to render text with 50th color of 256 color palette. +** TODO eat-term-color-51 + Face used to render text with 51st color of 256 color palette. +** TODO eat-term-color-52 + Face used to render text with 52nd color of 256 color palette. +** TODO eat-term-color-53 + Face used to render text with 53rd color of 256 color palette. +** TODO eat-term-color-54 + Face used to render text with 54th color of 256 color palette. +** TODO eat-term-color-55 + Face used to render text with 55th color of 256 color palette. +** TODO eat-term-color-56 + Face used to render text with 56th color of 256 color palette. +** TODO eat-term-color-57 + Face used to render text with 57th color of 256 color palette. +** TODO eat-term-color-58 + Face used to render text with 58th color of 256 color palette. +** TODO eat-term-color-59 + Face used to render text with 59th color of 256 color palette. +** TODO eat-term-color-6 + Face used to render cyan color text. +** TODO eat-term-color-60 + Face used to render text with 60th color of 256 color palette. +** TODO eat-term-color-61 + Face used to render text with 61st color of 256 color palette. +** TODO eat-term-color-62 + Face used to render text with 62nd color of 256 color palette. +** TODO eat-term-color-63 + Face used to render text with 63rd color of 256 color palette. +** TODO eat-term-color-64 + Face used to render text with 64th color of 256 color palette. +** TODO eat-term-color-65 + Face used to render text with 65th color of 256 color palette. +** TODO eat-term-color-66 + Face used to render text with 66th color of 256 color palette. +** TODO eat-term-color-67 + Face used to render text with 67th color of 256 color palette. +** TODO eat-term-color-68 + Face used to render text with 68th color of 256 color palette. +** TODO eat-term-color-69 + Face used to render text with 69th color of 256 color palette. +** TODO eat-term-color-7 + Face used to render white color text. +** TODO eat-term-color-70 + Face used to render text with 70th color of 256 color palette. +** TODO eat-term-color-71 + Face used to render text with 71st color of 256 color palette. +** TODO eat-term-color-72 + Face used to render text with 72nd color of 256 color palette. +** TODO eat-term-color-73 + Face used to render text with 73rd color of 256 color palette. +** TODO eat-term-color-74 + Face used to render text with 74th color of 256 color palette. +** TODO eat-term-color-75 + Face used to render text with 75th color of 256 color palette. +** TODO eat-term-color-76 + Face used to render text with 76th color of 256 color palette. +** TODO eat-term-color-77 + Face used to render text with 77th color of 256 color palette. +** TODO eat-term-color-78 + Face used to render text with 78th color of 256 color palette. +** TODO eat-term-color-79 + Face used to render text with 79th color of 256 color palette. +** TODO eat-term-color-8 + Face used to render bright black color text. +** TODO eat-term-color-80 + Face used to render text with 80th color of 256 color palette. +** TODO eat-term-color-81 + Face used to render text with 81st color of 256 color palette. +** TODO eat-term-color-82 + Face used to render text with 82nd color of 256 color palette. +** TODO eat-term-color-83 + Face used to render text with 83rd color of 256 color palette. +** TODO eat-term-color-84 + Face used to render text with 84th color of 256 color palette. +** TODO eat-term-color-85 + Face used to render text with 85th color of 256 color palette. +** TODO eat-term-color-86 + Face used to render text with 86th color of 256 color palette. +** TODO eat-term-color-87 + Face used to render text with 87th color of 256 color palette. +** TODO eat-term-color-88 + Face used to render text with 88th color of 256 color palette. +** TODO eat-term-color-89 + Face used to render text with 89th color of 256 color palette. +** TODO eat-term-color-9 + Face used to render bright red color text. +** TODO eat-term-color-90 + Face used to render text with 90th color of 256 color palette. +** TODO eat-term-color-91 + Face used to render text with 91st color of 256 color palette. +** TODO eat-term-color-92 + Face used to render text with 92nd color of 256 color palette. +** TODO eat-term-color-93 + Face used to render text with 93rd color of 256 color palette. +** TODO eat-term-color-94 + Face used to render text with 94th color of 256 color palette. +** TODO eat-term-color-95 + Face used to render text with 95th color of 256 color palette. +** TODO eat-term-color-96 + Face used to render text with 96th color of 256 color palette. +** TODO eat-term-color-97 + Face used to render text with 97th color of 256 color palette. +** TODO eat-term-color-98 + Face used to render text with 98th color of 256 color palette. +** TODO eat-term-color-99 + Face used to render text with 99th color of 256 color palette. +** TODO eat-term-faint + Face used to render faint text. +** TODO eat-term-fast-blink + Face used to render rapidly blinking text. +** TODO eat-term-font-0 + Default font. +** TODO eat-term-font-1 + Alternative font 1. +** TODO eat-term-font-2 + Alternative font 2. +** TODO eat-term-font-3 + Alternative font 3. +** TODO eat-term-font-4 + Alternative font 4. +** TODO eat-term-font-5 + Alternative font 5. +** TODO eat-term-font-6 + Alternative font 6. +** TODO eat-term-font-7 + Alternative font 7. +** TODO eat-term-font-8 + Alternative font 8. +** TODO eat-term-font-9 + Alternative font 9. +** TODO eat-term-italic + Face used to render italic text. +** TODO eat-term-slow-blink + Face used to render slowly blinking text. + * TODO edit-indirect [0/1] Editing regions in separate buffers. ** TODO edit-indirect-edited-region @@ -1786,86 +2344,152 @@ Mechanism to close a TODO: core/UI faces -> UI_FACES in generate.py; package + s Face used by the verbose action indicator for the title. * DONE emms [11/11] - The Emacs Multimedia System + *The Emacs Multimedia System. ** DONE emms-browser-album-face + Face for album in a browser/playlist buffer. ** DONE emms-browser-albumartist-face + Face for albumartist in a browser/playlist buffer. ** DONE emms-browser-artist-face + Face for artist in a browser/playlist buffer. ** DONE emms-browser-composer-face + Face for composer in a browser/playlist buffer. ** DONE emms-browser-performer-face + Face for performer in a browser/playlist buffer. ** DONE emms-browser-track-face + Face for track in a browser/playlist buffer. ** DONE emms-browser-year/genre-face + Face for year/genre in a browser/playlist buffer. ** DONE emms-metaplaylist-mode-current-face + Face for the current buffer name in the playlists buffer. ** DONE emms-metaplaylist-mode-face + Face for the buffer names in the playlists buffer. ** DONE emms-playlist-selected-face + Face for highlighting the selected track. ** DONE emms-playlist-track-face + Face for the tracks in a playlist buffer. + +* TODO eshell [0/26] + Command shell implemented entirely in Emacs Lisp. +** TODO eshell-ls-archive + The face used for highlighting archived and compressed file names. +** TODO eshell-ls-backup + The face used for highlighting backup file names. +** TODO eshell-ls-clutter + The face used for highlighting junk file names. +** TODO eshell-ls-directory + The face used for highlighting directories. +** TODO eshell-ls-executable + The face used for highlighting executables (not directories, though). +** TODO eshell-ls-missing + The face used for highlighting non-existent file names. +** TODO eshell-ls-product + The face used for highlighting files that are build products. +** TODO eshell-ls-readonly + The face used for highlighting read-only files. +** TODO eshell-ls-special + The face used for highlighting non-regular files. +** TODO eshell-ls-symlink + The face used for highlighting symbolic links. +** TODO eshell-ls-unreadable + The face used for highlighting unreadable files. +** TODO eshell-prompt + The face used to highlight prompt strings. +** TODO eshell-syntax-highlighting-alias-face + Face used for Eshell aliases. +** TODO eshell-syntax-highlighting-builtin-command-face + Face used for a builtin Eshell command. +** TODO eshell-syntax-highlighting-command-substitution-face + Face for $ command substitution delimiters. +** TODO eshell-syntax-highlighting-comment-face + Face used for comments in an Eshell command. +** TODO eshell-syntax-highlighting-default-face + Default face for Eshell commands. +** TODO eshell-syntax-highlighting-delimiter-face + Face used for delimiters in an Eshell command. +** TODO eshell-syntax-highlighting-directory-face + Face used for directories in command position if 'eshell-cd-on-directory' is t. +** TODO eshell-syntax-highlighting-envvar-face + Face used for environment variables in an Eshell command. +** TODO eshell-syntax-highlighting-file-arg-face + Face used for command arguments which are existing files. +** TODO eshell-syntax-highlighting-invalid-face + Face used for invalid Eshell commands. +** TODO eshell-syntax-highlighting-lisp-function-face + Face used for Emacs Lisp functions. +** TODO eshell-syntax-highlighting-option-face + Face used for options in an Eshell command. +** TODO eshell-syntax-highlighting-shell-command-face + Face used for valid shell in an Eshell command. +** TODO eshell-syntax-highlighting-string-face + Face used for quoted strings in Eshell arguments. * DONE flycheck [20/20] - On-the-fly syntax checking + Modern on-the-fly syntax checking for GNU Emacs. ** DONE flycheck-delimited-error + Flycheck face for errors spanning multiple lines. ** DONE flycheck-error + Flycheck face for errors. ** DONE flycheck-error-delimiter + Flycheck face for errors spanning multiple lines. ** DONE flycheck-error-list-checker-name + Face for the syntax checker name in the error list. ** DONE flycheck-error-list-column-number + Face for column numbers in the error list. ** DONE flycheck-error-list-error + Flycheck face for error messages in the error list. ** DONE flycheck-error-list-error-message + Face for the error message in the error list. ** DONE flycheck-error-list-filename + Face for filenames in the error list. ** DONE flycheck-error-list-highlight + Flycheck face to highlight errors in the error list. ** DONE flycheck-error-list-id + Face for the error ID in the error list. ** DONE flycheck-error-list-id-with-explainer + Face for the error ID in the error list, for errors that have an explainer. ** DONE flycheck-error-list-info + Flycheck face for info messages in the error list. ** DONE flycheck-error-list-line-number + Face for line numbers in the error list. ** DONE flycheck-error-list-warning + Flycheck face for warning messages in the error list. ** DONE flycheck-fringe-error + Flycheck face for fringe error indicators. ** DONE flycheck-fringe-info + Flycheck face for fringe info indicators. ** DONE flycheck-fringe-warning + Flycheck face for fringe warning indicators. ** DONE flycheck-info + Flycheck face for informational messages. ** DONE flycheck-verify-select-checker + Flycheck face for the 'select' button in the verify setup buffer. ** DONE flycheck-warning + Flycheck face for warnings. * DONE flyspell-correct [1/1] Correcting words with flyspell via custom interface. ** DONE flyspell-correct-highlight-face * DONE ghostel [19/19] - Terminal emulator powered by libghostty. ** DONE ghostel-color-black - Face used to render black color code. ** DONE ghostel-color-blue - Face used to render blue color code. ** DONE ghostel-color-bright-black - Face used to render bright black color code. ** DONE ghostel-color-bright-blue - Face used to render bright blue color code. ** DONE ghostel-color-bright-cyan - Face used to render bright cyan color code. ** DONE ghostel-color-bright-green - Face used to render bright green color code. ** DONE ghostel-color-bright-magenta - Face used to render bright magenta color code. ** DONE ghostel-color-bright-red - Face used to render bright red color code. ** DONE ghostel-color-bright-white - Face used to render bright white color code. ** DONE ghostel-color-bright-yellow - Face used to render bright yellow color code. ** DONE ghostel-color-cyan - Face used to render cyan color code. ** DONE ghostel-color-green - Face used to render green color code. ** DONE ghostel-color-magenta - Face used to render magenta color code. ** DONE ghostel-color-red - Face used to render red color code. ** DONE ghostel-color-white - Face used to render white color code. ** DONE ghostel-color-yellow - Face used to render yellow color code. ** DONE ghostel-default - Base face used to derive ghostel terminal default fg/bg colors. ** DONE ghostel-fake-cursor - Face for the hollow hint cursor drawn in copy and Emacs modes. ** DONE ghostel-fake-cursor-box - Face for the solid hint cursor drawn for box-style cursors. * DONE git-commit [12/12] Edit Git commit messages. @@ -1895,24 +2519,38 @@ Mechanism to close a TODO: core/UI faces -> UI_FACES in generate.py; package + s Face used for Git trailer values in commit messages. * DONE git-gutter [5/5] - Port of Sublime Text plugin GitGutter. + Port GitGutter ** DONE git-gutter:added + Face of added ** DONE git-gutter:deleted + Face of deleted ** DONE git-gutter:modified + Face of modified ** DONE git-gutter:separator + Face of separator ** DONE git-gutter:unchanged + Face of unchanged * DONE highlight-indent-guides [9/9] - Minor mode to highlight indentation. + Indentation highlighting. ** DONE highlight-indent-guides-character-face + Face to highlight guide line characters and bitmaps. ** DONE highlight-indent-guides-even-face + Face to highlight even indent levels. ** DONE highlight-indent-guides-odd-face + Face to highlight odd indent levels. ** DONE highlight-indent-guides-stack-character-face + Face to highlight guide line characters and bitmaps. ** DONE highlight-indent-guides-stack-even-face + Face to highlight even indent levels. ** DONE highlight-indent-guides-stack-odd-face + Face to highlight odd indent levels. ** DONE highlight-indent-guides-top-character-face + Face to highlight guide line characters and bitmaps. ** DONE highlight-indent-guides-top-even-face + Face to highlight even indent levels. ** DONE highlight-indent-guides-top-odd-face + Face to highlight odd indent levels. * DONE hl-todo [2/2] Highlight TODO and similar keywords in comments and strings. @@ -2177,17 +2815,12 @@ Mechanism to close a TODO: core/UI faces -> UI_FACES in generate.py; package + s Face for section headings of some secondary headings. * DONE malyon [5/5] - Play Z-machine interactive fiction games. + Mode to execute Z-code files version 3, 5, 8. ** DONE malyon-face-bold - Bold face for game text. ** DONE malyon-face-error - Face for game errors. ** DONE malyon-face-italic - Italic face for game text. ** DONE malyon-face-plain - Basic face for game text. ** DONE malyon-face-reverse - Face for reverse-video text. * DONE marginalia [32/32] Enrich existing commands with completion annotations. @@ -2345,7 +2978,7 @@ Mechanism to close a TODO: core/UI faces -> UI_FACES in generate.py; package + s ** DONE markdown-url-face Face for URLs that are part of markup. -* DONE nerd-icons [34/34] +* DOING nerd-icons [34/39] Manage how Nerd Fonts formats icons. ** DONE nerd-icons-blue Face for blue icons. @@ -2377,6 +3010,16 @@ Mechanism to close a TODO: core/UI faces -> UI_FACES in generate.py; package + s Face for dyellow icons. ** DONE nerd-icons-green Face for green icons. +** TODO nerd-icons-ibuffer-dir-face + Face used for the directory icon. +** TODO nerd-icons-ibuffer-file-face + Face used for the filename/process. +** TODO nerd-icons-ibuffer-icon-face + Face used for the icons while 'nerd-icons-ibuffer-color-icon' is nil. +** TODO nerd-icons-ibuffer-mode-face + Face used for the major mode. +** TODO nerd-icons-ibuffer-size-face + Face used for the size. ** DONE nerd-icons-lblue Face for lblue icons. ** DONE nerd-icons-lcyan @@ -2474,32 +3117,355 @@ Mechanism to close a TODO: core/UI faces -> UI_FACES in generate.py; package + s Additional face used to highlight parts of candidates. * DONE rainbow-delimiters [13/13] - Highlight brackets according to their depth + Highlight nested parentheses, brackets, and braces according to their depth. ** DONE rainbow-delimiters-base-error-face + Face inherited by all other rainbow-delimiter error faces. ** DONE rainbow-delimiters-base-face + Face inherited by all other rainbow-delimiter faces. ** DONE rainbow-delimiters-depth-1-face + Nested delimiter face, depth 1. ** DONE rainbow-delimiters-depth-2-face + Nested delimiter face, depth 2. ** DONE rainbow-delimiters-depth-3-face + Nested delimiter face, depth 3. ** DONE rainbow-delimiters-depth-4-face + Nested delimiter face, depth 4. ** DONE rainbow-delimiters-depth-5-face + Nested delimiter face, depth 5. ** DONE rainbow-delimiters-depth-6-face + Nested delimiter face, depth 6. ** DONE rainbow-delimiters-depth-7-face + Nested delimiter face, depth 7. ** DONE rainbow-delimiters-depth-8-face + Nested delimiter face, depth 8. ** DONE rainbow-delimiters-depth-9-face + Nested delimiter face, depth 9. ** DONE rainbow-delimiters-mismatched-face + Face to highlight mismatched closing delimiters in. ** DONE rainbow-delimiters-unmatched-face + Face to highlight unmatched closing delimiters in. + +* TODO slack [0/57] + Emacs Slack Client +** TODO slack-all-thread-buffer-thread-header-face + Face used to All Threads buffer's each threads header. +** TODO slack-attachment-field-title + Face used to attachment field title. +** TODO slack-attachment-footer + Face used to shared message footer. +** TODO slack-attachment-header + Face used to shared message header. +** TODO slack-attachment-pad + Face used to shared message pad. +** TODO slack-block-highlight-source-overlay-face + If non-nil, highlight source blocks in messages. +** TODO slack-button-block-element-face + Used to button block element +** TODO slack-button-danger-block-element-face + Used to danger button block element +** TODO slack-button-primary-block-element-face + Used to primary button block element +** TODO slack-channel-button-face + Face used to channel button. +** TODO slack-date-picker-block-element-face + Used to date picker block element +** TODO slack-dialog-cancel-button-face + Used to dialog's cancel button +** TODO slack-dialog-element-error-face + Used to dialog's element error message +** TODO slack-dialog-element-hint-face + Used to dialog's element hint +** TODO slack-dialog-element-label-face + Used to dialog's element label +** TODO slack-dialog-element-placeholder-face + Used to dialog's element placeholder +** TODO slack-dialog-select-element-input-face + Used to dialog's select element input +** TODO slack-dialog-submit-button-face + Used to dialog's submit button +** TODO slack-dialog-title-face + Used to dialog's title +** TODO slack-message-action-danger-face + Face used to danger action. +** TODO slack-message-action-face + Face used to action. +** TODO slack-message-action-primary-face + Face used to primary action. +** TODO slack-message-attachment-preview-header-face + Used to attachment preview header +** TODO slack-message-deleted-face + Face used to deleted message. +** TODO slack-message-mention-face + Face used to mention. +** TODO slack-message-mention-keyword-face + Face used to @here, @channel, @everyone mention. +** TODO slack-message-mention-me-face + Face used to mention. +** TODO slack-message-output-header + Face used to text message. +** TODO slack-message-output-reaction + Face used to reactions. +** TODO slack-message-output-reaction-pressed + Face used to reactions pressed by user. +** TODO slack-message-output-text + Face used to text message. +** TODO slack-modeline-channel-has-unreads-face + Face used to channel has unreads message in modeline +** TODO slack-modeline-has-unreads-face + Face used to team has unreads message in modeline +** TODO slack-modeline-thread-has-unreads-face + Face used to thread has unreads message in modeline +** TODO slack-mrkdwn-blockquote-face + Face used to '>' +** TODO slack-mrkdwn-bold-face + Face used to between '*' +** TODO slack-mrkdwn-code-block-face + Face used to between ''''' +** TODO slack-mrkdwn-code-face + Face used to between ''' +** TODO slack-mrkdwn-italic-face + Face used to between '_' +** TODO slack-mrkdwn-list-face + Face used to mrkdwn list +** TODO slack-mrkdwn-strike-face + Face used to between '~' +** TODO slack-new-message-marker-face + Face used to New Message Marker. +** TODO slack-overflow-block-element-face + Used to overflow block element +** TODO slack-preview-face + Used preview text and code blocks +** TODO slack-profile-image-face + Face used to profile image. +** TODO slack-room-info-section-label-face + Used to room info section title. +** TODO slack-room-info-section-title-face + Used to room info section title. +** TODO slack-room-info-title-face + Used to room info title. +** TODO slack-room-info-title-room-name-face + Used to room info title. +** TODO slack-room-unread-face + Face used to mark a room as unread when selecting channels. +** TODO slack-search-result-message-header-face + Face used to search message header. +** TODO slack-search-result-message-username-face +** TODO slack-select-block-element-face + Used to select block element +** TODO slack-user-active-face + Used to 'slack-user-active-string' +** TODO slack-user-dnd-face + Used to 'slack-user-dnd-sign' +** TODO slack-user-profile-header-face + Face used to user profile header. +** TODO slack-user-profile-property-name-face + Face used to user property. * DONE symbol-overlay [9/9] - Highlight symbols with keymap-enabled overlays + Highlight symbols with keymap-enabled overlays. ** DONE symbol-overlay-default-face + Symbol Overlay default face ** DONE symbol-overlay-face-1 + Symbol Overlay default candidate 1 ** DONE symbol-overlay-face-2 + Symbol Overlay default candidate 2 ** DONE symbol-overlay-face-3 + Symbol Overlay default candidate 3 ** DONE symbol-overlay-face-4 + Symbol Overlay default candidate 4 ** DONE symbol-overlay-face-5 + Symbol Overlay default candidate 5 ** DONE symbol-overlay-face-6 + Symbol Overlay default candidate 6 ** DONE symbol-overlay-face-7 + Symbol Overlay default candidate 7 ** DONE symbol-overlay-face-8 + Symbol Overlay default candidate 8 + +* TODO telega [0/91] + Telegram client. +** TODO telega-blue + *Official blue color of telegram. +** TODO telega-box-button + Face used for telega buttons. +** TODO telega-box-button-active + Face used for active (cursor inside) telega buttons. +** TODO telega-box-button-danger-active + Face for active button of TL buttonStyleDanger style. +** TODO telega-box-button-danger-passive + Face for passive button of TL buttonStyleDanger style. +** TODO telega-box-button-default-active + Face for active button of TL buttonStyleDefault style. +** TODO telega-box-button-default-passive + Face for passive button of TL buttonStyleDefault style. +** TODO telega-box-button-primary-active + Face for active button of TL buttonStylePrimary style. +** TODO telega-box-button-primary-passive + Face for passive button of TL buttonStylePrimary style. +** TODO telega-box-button-success-active + Face for active button of TL buttonStyleSuccess style. +** TODO telega-box-button-success-passive + Face for passive button of TL buttonStyleSuccess style. +** TODO telega-box-button-ui-active + Face used for active (cursor inside) telega UI buttons. +** TODO telega-box-button-ui-passive + Face used for telega UI buttons. +** TODO telega-box-button2-active + Face to display passive buttons. +** TODO telega-box-button2-passive + Face to display passive buttons. +** TODO telega-box-button2-white-foreground + Face for white foreground. +** TODO telega-button-highlight + Face used to highlight active button. +** TODO telega-chat-input-attachment + Face for chat input attachments. +** TODO telega-chat-prompt + Face for chat input prompt +** TODO telega-chat-prompt-aux + Face to use in the 'telega-chatbuf-footer-ins-aux-plist' inserter. +** TODO telega-checklist-stats-done + Face for checklist stats when all tasks are done. +** TODO telega-checklist-stats-todo + Face for checklist stats when some tasks are undone. +** TODO telega-contact-birthdays-today + Face to use if contact birthday is today. +** TODO telega-delim-face + Face used to display horizontal delimiters. +** TODO telega-describe-item-title + Face used for item title in help buffers. +** TODO telega-describe-section-title + Face used for section title in help buffers. +** TODO telega-describe-subsection-title + Face used for subsection title in help buffers. +** TODO telega-enckey-00 + Face used for encryption key +** TODO telega-enckey-01 + Face used for encryption key +** TODO telega-enckey-10 + Face used for encryption key +** TODO telega-enckey-11 + Face used for encryption key +** TODO telega-entity-type-blockquote + Face to display block quote formatting. +** TODO telega-entity-type-bold + Face to display bold text. +** TODO telega-entity-type-botcommand + Face to display /command if there is bot in chat. +** TODO telega-entity-type-cashtag + Face to display $USD cashtags +** TODO telega-entity-type-code + Face to display code. +** TODO telega-entity-type-hashtag + Face to display #hashtags. +** TODO telega-entity-type-italic + Face to display italic text. +** TODO telega-entity-type-mention + Face to display @mentions. +** TODO telega-entity-type-pre + Face to display text ala <pre> HTML tag. +** TODO telega-entity-type-spoiler + Face to display spoilers in the text. +** TODO telega-entity-type-strikethrough + Face to display strikethrough text. +** TODO telega-entity-type-texturl + Face to display urls. +** TODO telega-entity-type-underline + Face to display underline text. +** TODO telega-filter-active + Face to emphasize active chat filter other then 'telega-filter-default'. +** TODO telega-filter-button-active + *Face to use for active custom filters. +** TODO telega-filter-button-inactive + *Face to use for inactive custom filters. +** TODO telega-has-chatbuf-brackets + Face to emphasize brackets for chats having corresponding chatbuf. +** TODO telega-highlight-text-face + Face used to highlight text in 'telega-highlight-text-mode'. +** TODO telega-link + Face to display various links. +** TODO telega-link-preview-sitename + Face to display link preview site_name. +** TODO telega-link-preview-title + Face to display link preview title. +** TODO telega-mention-count + Face to display count of the mentions. +** TODO telega-msg-deleted + Face used to display deleted messages. +** TODO telega-msg-heading + Face to display messages header. +** TODO telega-msg-inline-forward + Face to highlight message forwarding header. +** TODO telega-msg-inline-other + Face to highlight other message headers, such as translate/summarize. +** TODO telega-msg-inline-reply + Face to highlight replies to messages. +** TODO telega-msg-self-title + Face to display title of myself in chat buffers. +** TODO telega-msg-sponsored + Face to display sponsored message. +** TODO telega-msg-user-title + Face to display user title in chat buffers. +** TODO telega-muted-count + Face to display count of messages in muted chats. +** TODO telega-palette-builtin-blue + Face for builtin blue. +** TODO telega-palette-builtin-green + Face for builtin green. +** TODO telega-palette-builtin-orange + Face for builtin orange. +** TODO telega-palette-builtin-purple + Face for builtin purple/violet. +** TODO telega-reaction + Face used to display reaction. +** TODO telega-reaction-chosen + Face used to display chosen reaction. +** TODO telega-reaction-paid + Face used to display reaction. +** TODO telega-reaction-paid-chosen + Face used to display chosen paid reaction +** TODO telega-red + *Face for dangerous actions, such as deletion. +** TODO telega-root-heading + Face used to display headings, such as GLOBAL SEARCH, in root buffer. +** TODO telega-secret-title + Face to display title of secret chat in root buffer. +** TODO telega-shadow + Face used to display shadowed text in telega. +** TODO telega-topic-button + Face to display topic button in the rootbuf. +** TODO telega-tracking + Face to display tracking mode-line notifications. +** TODO telega-unmuted-count + Face to display count messages in unmuted chats. +** TODO telega-unread-unmuted-modeline + Face used to display number of unread/unmuted messages in modeline. +** TODO telega-user-non-online-status + Face to display user status if non-online. +** TODO telega-user-online-status + Face to display user status if online. +** TODO telega-username + Face to display username for chats/users. +** TODO telega-webpage-chat-link + Face to display 'pageBlockChatLink' web page blocks +** TODO telega-webpage-fixed + Face to display fixed text in webpage instant view. +** TODO telega-webpage-header + Face to display header in webpage instant view. +** TODO telega-webpage-marked + Face to display marked rich text in a webpage instant view. +** TODO telega-webpage-outline + Face to display text with different background. +** TODO telega-webpage-preformatted + Face to display preformatted text in webpage instant view. +** TODO telega-webpage-strike-through + Face to display strike through RichText. +** TODO telega-webpage-subheader + Face to display subheader in webpage instant view. +** TODO telega-webpage-subtitle + Face to display subtitle in webpage instant view. +** TODO telega-webpage-title + Face to display title in webpage instant view. * DOING tmr [12/17] TMR May Ring: set timers using a simple notation. @@ -2590,27 +3556,16 @@ Mechanism to close a TODO: core/UI faces -> UI_FACES in generate.py; package + s * DONE twentyfortyeight [11/11] Tile faces for the 2048 game. ** DONE twentyfortyeight-face-1024 - Face for the tile 1024. ** DONE twentyfortyeight-face-128 - Face for the tile 128. ** DONE twentyfortyeight-face-16 - Face for the tile 16. ** DONE twentyfortyeight-face-2 - Face for the tile 2. ** DONE twentyfortyeight-face-2048 - Face for the tile 2048. ** DONE twentyfortyeight-face-256 - Face for the tile 256. ** DONE twentyfortyeight-face-32 - Face for the tile 32. ** DONE twentyfortyeight-face-4 - Face for the tile 4. ** DONE twentyfortyeight-face-512 - Face for the tile 512. ** DONE twentyfortyeight-face-64 - Face for the tile 64. ** DONE twentyfortyeight-face-8 - Face for the tile 8. * DONE vertico [4/4] VERTical Interactive COmpletion. @@ -2624,88 +3579,193 @@ Mechanism to close a TODO: core/UI faces -> UI_FACES in generate.py; package + s Face used to highlight multiline replacement characters. * DONE web-mode [81/81] - major mode for editing web templates + Major mode for editing web templates ** DONE web-mode-annotation-face + Face for code annotations. ** DONE web-mode-annotation-html-face + Face for HTML tags in code annotations. ** DONE web-mode-annotation-tag-face + Face for @tags in code annotations. ** DONE web-mode-annotation-type-face + Face for types in code annotations. ** DONE web-mode-annotation-value-face + Face for values in code annotations. ** DONE web-mode-block-attr-name-face + Face for block attribute names. ** DONE web-mode-block-attr-value-face + Face for block attribute values. ** DONE web-mode-block-comment-face + Face for server comments. ** DONE web-mode-block-control-face + Face for preprocessor. ** DONE web-mode-block-delimiter-face + Face for block delimiters. ** DONE web-mode-block-face + Face for blocks (useful for setting a background for example). ** DONE web-mode-block-string-face + Face for block strings. ** DONE web-mode-bold-face + bold face. ** DONE web-mode-builtin-face + Face for builtins. ** DONE web-mode-comment-face + Face for comments. ** DONE web-mode-comment-keyword-face + Comment keywords. ** DONE web-mode-constant-face + Face for language constants. ** DONE web-mode-css-at-rule-face + Face for CSS at-rules. ** DONE web-mode-css-color-face + Face for CSS colors (#xxx). ** DONE web-mode-css-comment-face + Face for css comments. ** DONE web-mode-css-function-face + Face for CSS functions. ** DONE web-mode-css-priority-face + Face for CSS priority (!important). ** DONE web-mode-css-property-name-face + Face for CSS props. ** DONE web-mode-css-pseudo-class-face + Face for CSS pseudo-classes. ** DONE web-mode-css-selector-class-face + Face for CSS class rules. ** DONE web-mode-css-selector-face + Face for CSS rules. ** DONE web-mode-css-selector-tag-face + Face for CSS tag rules. ** DONE web-mode-css-string-face + Face for css strings. ** DONE web-mode-css-variable-face + Face for CSS vars. ** DONE web-mode-current-column-highlight-face + Overlay face for current column. ** DONE web-mode-current-element-highlight-face + Overlay face for element highlight. ** DONE web-mode-doctype-face + Face for html doctype. ** DONE web-mode-error-face + Face for warning. ** DONE web-mode-filter-face + Face for function names. ** DONE web-mode-folded-face + Overlay face for folded. ** DONE web-mode-function-call-face + Face for function calls. ** DONE web-mode-function-name-face + Face for function names. ** DONE web-mode-html-attr-custom-face + Face for custom attribute names (e.g. data-*). ** DONE web-mode-html-attr-engine-face + Face for custom engine attribute names (e.g. ng-*). ** DONE web-mode-html-attr-equal-face + Face for the = character between name and value. ** DONE web-mode-html-attr-name-face + Face for html attribute names. ** DONE web-mode-html-attr-value-face + Face for html attribute values. ** DONE web-mode-html-entity-face + Face html entities (e.g. –, é). ** DONE web-mode-html-tag-bracket-face + Face for html tags angle brackets (<, > and />). ** DONE web-mode-html-tag-custom-face + Face for html custom tags (e.g. <polymer-element>). ** DONE web-mode-html-tag-face + Face for html tags. ** DONE web-mode-html-tag-namespaced-face + Face for html namespaced tags (e.g. <c:forEach>). ** DONE web-mode-html-tag-unclosed-face + Face for unclosed tags. ** DONE web-mode-inlay-face + Face for inlays. Must be used in conjunction with web-mode-enable-inlays. ** DONE web-mode-interpolate-color1-face + Face for element interpolation strings. ** DONE web-mode-interpolate-color2-face + Face for element interpolation strings. ** DONE web-mode-interpolate-color3-face + Face for element interpolation strings. ** DONE web-mode-interpolate-color4-face + Face for element interpolation strings. ** DONE web-mode-italic-face + bold face. ** DONE web-mode-javascript-comment-face + Face for javascript comments. ** DONE web-mode-javascript-string-face + Face for javascript strings. ** DONE web-mode-json-comment-face + Face for json comments. ** DONE web-mode-json-context-face + Face for json context strings. ** DONE web-mode-json-key-face + Face for json key strings. ** DONE web-mode-json-string-face + Face for json strings. ** DONE web-mode-jsx-depth-1-face + jsx depth 1 ** DONE web-mode-jsx-depth-2-face + jsx ** DONE web-mode-jsx-depth-3-face + jsx ** DONE web-mode-jsx-depth-4-face + jsx ** DONE web-mode-jsx-depth-5-face + jsx ** DONE web-mode-keyword-face + Face for language keywords. ** DONE web-mode-param-name-face + Face for server attribute names. ** DONE web-mode-part-comment-face + Face for part comments. ** DONE web-mode-part-face + Face for parts. ** DONE web-mode-part-string-face + Face for part strings. ** DONE web-mode-preprocessor-face + Face for preprocessor commands. ** DONE web-mode-script-face + Face for javascript inside a script element. ** DONE web-mode-sql-keyword-face + Sql keywords. ** DONE web-mode-string-face + Face for strings. ** DONE web-mode-style-face + Face for css inside a style element. ** DONE web-mode-symbol-face + Face for symbols. ** DONE web-mode-type-face + Face for language types. ** DONE web-mode-underline-face + bold face. ** DONE web-mode-variable-name-face + Face for variable names. ** DONE web-mode-warning-face + Face for warning. ** DONE web-mode-whitespace-face + Face for whitespaces. + +* TODO wgrep [0/5] + Customize wgrep +** TODO wgrep-delete-face + *Face used for the deleted whole line in the grep buffer. +** TODO wgrep-done-face + *Face used for the line in the grep buffer that can be applied to a file. +** TODO wgrep-face + *Face used for the changed text in the grep buffer. +** TODO wgrep-file-face + *Face used for the changed text in the file buffer. +** TODO wgrep-reject-face + *Face used for the line in the grep buffer that can not be applied to + +* TODO wttrin [0/4] + Emacs frontend for the weather web service wttr.in. +** TODO wttrin-instructions + Face for the key-hint footer prose in the weather buffer. +** TODO wttrin-key + Face for the bracketed key chords in the weather buffer footer. +** TODO wttrin-mode-line-stale + Face for the mode-line weather emoji when its data is stale. +** TODO wttrin-staleness-header + Face for the "Last updated: ..." line in the weather buffer. * DONE yas [2/2] Faces for YASnippet template fields. diff --git a/scripts/theme-studio/face_data.py b/scripts/theme-studio/face_data.py index 56a660b82..3eb471d7f 100644 --- a/scripts/theme-studio/face_data.py +++ b/scripts/theme-studio/face_data.py @@ -131,18 +131,6 @@ ELFEED_SEED={ "elfeed-log-date-face":{"fg":"steel"},"elfeed-log-error-level-face":{"fg":"terracotta","bold":True}, "elfeed-log-warn-level-face":{"fg":"gold"},"elfeed-log-info-level-face":{"fg":"sage"}, "elfeed-log-debug-level-face":{"fg":"pewter"}} -# ghostel (terminal): the 16 ANSI colors plus default and the fake cursor. -GHOSTEL_FACES=("ghostel-default ghostel-fake-cursor ghostel-fake-cursor-box " - "ghostel-color-black ghostel-color-red ghostel-color-green ghostel-color-yellow " - "ghostel-color-blue ghostel-color-magenta ghostel-color-cyan ghostel-color-white " - "ghostel-color-bright-black ghostel-color-bright-red ghostel-color-bright-green ghostel-color-bright-yellow " - "ghostel-color-bright-blue ghostel-color-bright-magenta ghostel-color-bright-cyan ghostel-color-bright-white").split() -GHOSTEL_SEED={ - "ghostel-default":{"fg":"#cdced1"},"ghostel-fake-cursor":{"fg":"#000000","bg":"silver"},"ghostel-fake-cursor-box":{"fg":"silver"}, - "ghostel-color-black":{"fg":"pewter"},"ghostel-color-red":{"fg":"terracotta"},"ghostel-color-green":{"fg":"emerald"},"ghostel-color-yellow":{"fg":"gold"}, - "ghostel-color-blue":{"fg":"blue"},"ghostel-color-magenta":{"fg":"regal"},"ghostel-color-cyan":{"fg":"sage"},"ghostel-color-white":{"fg":"silver"}, - "ghostel-color-bright-black":{"fg":"steel"},"ghostel-color-bright-red":{"fg":"#de4949"},"ghostel-color-bright-green":{"fg":"#84b068"},"ghostel-color-bright-yellow":{"fg":"#eed376"}, - "ghostel-color-bright-blue":{"fg":"#7a9abe"},"ghostel-color-bright-magenta":{"fg":"#b07fd0"},"ghostel-color-bright-cyan":{"fg":"#7fc0a8"},"ghostel-color-bright-white":{"fg":"white"}} # eat (F12 terminal, pure-elisp): the 16 named ANSI palette faces (which :inherit # ansi-color-*), the SGR attribute faces, and the shell-prompt annotation faces. # No seed -- the faces are exposed editable but left at their own defaults until @@ -156,11 +144,11 @@ EAT_FACES=("eat-term-color-black eat-term-color-red eat-term-color-green eat-ter "eat-shell-prompt-annotation-success eat-shell-prompt-annotation-running eat-shell-prompt-annotation-failure").split() EAT_SEED={} # ansi-color (built-in, not in the inventory): the 16 ANSI palette faces that every -# ANSI consumer resolves -- vterm, eshell, compilation, and ghostel (whose -# ghostel-color-* faces :inherit these). Theming ansi-color-* drives the 16 -# colors everywhere at once. Seed mirrors the ghostel palette so the two agree. +# ANSI consumer resolves -- vterm, eshell, compilation, and eat (whose +# eat-term-color-* faces :inherit these). Theming ansi-color-* drives the 16 +# colors everywhere at once. # Note: a face left unset here inherits nothing extra; a consumer that sets its -# own color directly (e.g. a seeded ghostel-color-red) overrides this inheritance. +# own color directly (e.g. a seeded ansi-color-red) overrides this inheritance. ANSI_COLOR_FACES=("ansi-color-black ansi-color-red ansi-color-green ansi-color-yellow " "ansi-color-blue ansi-color-magenta ansi-color-cyan ansi-color-white " "ansi-color-bright-black ansi-color-bright-red ansi-color-bright-green ansi-color-bright-yellow " @@ -355,6 +343,23 @@ GNUS_SEED={ "gnus-cite-1":{"fg":"sage"},"gnus-cite-2":{"fg":"steel"},"gnus-cite-3":{"fg":"gold"},"gnus-cite-4":{"fg":"blue"},"gnus-cite-5":{"fg":"sage"},"gnus-cite-6":{"fg":"steel"},"gnus-cite-7":{"fg":"gold"},"gnus-cite-8":{"fg":"blue"},"gnus-cite-9":{"fg":"sage"},"gnus-cite-10":{"fg":"steel"},"gnus-cite-11":{"fg":"gold"},"gnus-cite-attribution":{"fg":"silver","italic":True}, "gnus-signature":{"fg":"pewter","italic":True},"gnus-button":{"fg":"blue","underline":True}, "gnus-emphasis-bold":{"bold":True},"gnus-emphasis-italic":{"italic":True},"gnus-emphasis-underline":{"underline":True},"gnus-emphasis-strikethru":{"fg":"pewter","strike":True},"gnus-emphasis-highlight-words":{"fg":"gold","bold":True}} +# nov-reading: the EPUB reading-view palettes (config faces, not a package). Each +# is the buffer-local default bg+fg for a reading mode; seeded with the module's +# starting hex so the studio shows sepia/dark/light from the first render. +NOV_READING_FACES=("cj/nov-reading-sepia cj/nov-reading-dark cj/nov-reading-light " + "cj/nov-reading-sepia-heading cj/nov-reading-sepia-link " + "cj/nov-reading-dark-heading cj/nov-reading-dark-link " + "cj/nov-reading-light-heading cj/nov-reading-light-link").split() +NOV_READING_SEED={ + "cj/nov-reading-sepia":{"bg":"#1f1b16","fg":"#c9b187"}, + "cj/nov-reading-dark":{"bg":"#15140f","fg":"#cfc8b8"}, + "cj/nov-reading-light":{"bg":"#ece3cf","fg":"#2a2622"}, + "cj/nov-reading-sepia-heading":{"fg":"#e6c98a"}, + "cj/nov-reading-sepia-link":{"fg":"#c98f5a","underline":True}, + "cj/nov-reading-dark-heading":{"fg":"#e8e0cc"}, + "cj/nov-reading-dark-link":{"fg":"#8fb0c4","underline":True}, + "cj/nov-reading-light-heading":{"fg":"#5a3d28"}, + "cj/nov-reading-light-link":{"fg":"#8a5a2a","underline":True}} # The bespoke package apps, single-sourced here. Each row is # (key, label, preview, FACES, prefix, SEED); add an app by adding one row. @@ -367,7 +372,6 @@ BESPOKE_APP_SPECS=[ ("mu4e","mu4e","mu4e",MU4E_FACES,"mu4e-",MU4E_SEED), ("gnus","gnus","gnus",GNUS_FACES,"gnus-",GNUS_SEED), ("org-faces","org-faces","orgfaces",ORGFACES_FACES,"org-faces-",ORGFACES_SEED), - ("ghostel","ghostel","ghostel",GHOSTEL_FACES,"ghostel-",GHOSTEL_SEED), ("ansi-color","ansi-color","ansicolor",ANSI_COLOR_FACES,"ansi-color-",ANSI_COLOR_SEED), ("eat","emulate a terminal (eat)","eat",EAT_FACES,"eat-",EAT_SEED), ("auto-dim-other-buffers","auto-dim","autodim",AUTODIM_FACES,"auto-dim-other-buffers-",AUTODIM_SEED), @@ -378,6 +382,7 @@ BESPOKE_APP_SPECS=[ ("dired","dired","dired",DIRED_FACES,"dired-",DIRED_SEED), ("dirvish","dirvish","dirvish",DIRVISH_FACES,"dirvish-",DIRVISH_SEED), ("calibredb","calibredb","calibredb",CALIBREDB_FACES,"calibredb-",CALIBREDB_SEED), + ("nov-reading","nov reading view","novreading",NOV_READING_FACES,"cj/nov-reading-",NOV_READING_SEED), ("erc","erc","erc",ERC_FACES,"erc-",ERC_SEED), ("org-drill","org-drill","orgdrill",ORGDRILL_FACES,"org-drill-",ORGDRILL_SEED), ("org-noter","org-noter","orgnoter",ORGNOTER_FACES,"org-noter-",ORGNOTER_SEED), @@ -392,7 +397,7 @@ BESPOKE_APP_SPECS=[ # the app label can stay clean and the "who reuses this" context rides the app # dropdown's tooltip instead. Apps not listed here get no hover. APP_HOVERS={ - "ansi-color":"The 16 ANSI palette faces. Reused by vterm, eshell, compilation, ghostel, and eat, whose own color faces inherit these.", + "ansi-color":"The 16 ANSI palette faces. Reused by vterm, eshell, compilation, and eat, whose own color faces inherit these.", "shr":"Simple HTML Renderer. Reused by eww, nov (epub reading), and mu4e / message for HTML mail.", "gnus":"Article-view faces, reused by mu4e's article view.", "dired":"Directory-listing faces, reused by dirvish (a dired frontend).", diff --git a/scripts/theme-studio/generate.py b/scripts/theme-studio/generate.py index e50d102de..dc6d0a8ef 100644 --- a/scripts/theme-studio/generate.py +++ b/scripts/theme-studio/generate.py @@ -312,9 +312,12 @@ CATS=[["bg","bg (ground)","Aa Bb 123"],["p","fg","other / whitespace"],["kw","ke ["ty","type / class","int str Order Queue"],["prop","property / field","id name items"], ["con","constant","None nil NULL true"],["num","number","8080 100 -1"], ["str","string",'"dupre" "fmt"'],["esc","escape","\\n \\t"],["re","regexp","/^#[0-9a-f]+/"], - ["doc","docstring",'"""..."""'],["cm","comment","# reject nil"],["cmd","comment delim","# // ;;"], + ["rxgb","regexp backslash","\\\\("],["rxgc","regexp construct","\\( \\)"], + ["doc","docstring",'"""..."""'],["dmark","doc mark","\\[cmd] `sym'"], + ["cm","comment","# reject nil"],["cmd","comment delim","# // ;;"], ["var","variable / use","value key self"],["op","operator",": = -> =="], - ["punc","punctuation","{ } ( ) ;"]] + ["neg","negation char","!"],["punc","punctuation","{ } ( ) ;"], + ["warn","warn","TODO FIXME"]] UI_FACES=[["cursor","cursor","Aa|"],["region","region (selection)","selected text"], ["hl-line","hl-line (current line)","current line"],["highlight","highlight","hover"], ["mode-line","mode-line","status active"], diff --git a/scripts/theme-studio/package-inventory.json b/scripts/theme-studio/package-inventory.json index 18fd7aa25..ec82f664b 100644 --- a/scripts/theme-studio/package-inventory.json +++ b/scripts/theme-studio/package-inventory.json @@ -716,6 +716,12 @@ "web-mode-warning-face", "web-mode-whitespace-face" ], + "wttrin": [ + "wttrin-instructions", + "wttrin-key", + "wttrin-mode-line-stale", + "wttrin-staleness-header" + ], "yasnippet": [ "yas--field-debug-face", "yas-field-highlight-face" diff --git a/scripts/theme-studio/previews.js b/scripts/theme-studio/previews.js index afba6b0c9..658da3700 100644 --- a/scripts/theme-studio/previews.js +++ b/scripts/theme-studio/previews.js @@ -151,14 +151,6 @@ function renderElfeedPreview(){const a='elfeed',L=[]; L.push(os(a,'elfeed-log-date-face','02:24:03')+' '+os(a,'elfeed-log-error-level-face','ERROR')+' failed: bad.example'); L.push(os(a,'elfeed-log-date-face','02:24:04')+' '+os(a,'elfeed-log-debug-level-face','DEBUG')+' parsed 340 entries'); return previewLines(L);} -function renderGhostelPreview(){const a='ghostel',L=[]; - L.push(os(a,'ghostel-default','craig@host')+' '+os(a,'ghostel-color-green','~/code')+' $ ls'+os(a,'ghostel-fake-cursor',' ')+os(a,'ghostel-fake-cursor-box','[ ]')); - L.push(''); - L.push(os(a,'ghostel-default','normal:')+' '+os(a,'ghostel-color-black','black')+' '+os(a,'ghostel-color-red','red')+' '+os(a,'ghostel-color-green','green')+' '+os(a,'ghostel-color-yellow','yellow')+' '+os(a,'ghostel-color-blue','blue')+' '+os(a,'ghostel-color-magenta','magenta')+' '+os(a,'ghostel-color-cyan','cyan')+' '+os(a,'ghostel-color-white','white')); - L.push(os(a,'ghostel-default','bright:')+' '+os(a,'ghostel-color-bright-black','black')+' '+os(a,'ghostel-color-bright-red','red')+' '+os(a,'ghostel-color-bright-green','green')+' '+os(a,'ghostel-color-bright-yellow','yellow')+' '+os(a,'ghostel-color-bright-blue','blue')+' '+os(a,'ghostel-color-bright-magenta','magenta')+' '+os(a,'ghostel-color-bright-cyan','cyan')+' '+os(a,'ghostel-color-bright-white','white')); - L.push(''); - L.push(os(a,'ghostel-default','default terminal output, 256-color text and a blinking ')+os(a,'ghostel-fake-cursor','cursor')+'.'); - return previewLines(L);} function renderDashboardPreview(){const a='dashboard',L=[]; L.push(os(a,'dashboard-text-banner',' [ dashboard banner image ]')); L.push(os(a,'dashboard-banner-logo-title','Emacs: The Editor That Saves Your Soul')); @@ -293,17 +285,60 @@ function renderGitGutterPreview(){const a='git-gutter',L=[]; L.push(os(a,'git-gutter:deleted','_')+os(a,'git-gutter:separator','|')+' (deleted lines marker)'); L.push(os(a,'git-gutter:unchanged',' ')+os(a,'git-gutter:separator','|')+' '+os(a,'git-gutter:unchanged','unchanged line of code')); return previewLines(L);} -function renderEatPreview(){const a='eat',L=[]; - L.push(os(a,'eat-shell-prompt-annotation-success','✔')+' ~/projects $ ls --color'); - L.push(os(a,'eat-term-color-blue','build/')+' '+os(a,'eat-term-color-blue','src/')+' '+os(a,'eat-term-color-green','run.sh')+' README.md'); - L.push(''); - L.push('palette '+os(a,'eat-term-color-black','■')+os(a,'eat-term-color-red','■')+os(a,'eat-term-color-green','■')+os(a,'eat-term-color-yellow','■')+os(a,'eat-term-color-blue','■')+os(a,'eat-term-color-magenta','■')+os(a,'eat-term-color-cyan','■')+os(a,'eat-term-color-white','■')+' normal'); - L.push(' '+os(a,'eat-term-color-bright-black','■')+os(a,'eat-term-color-bright-red','■')+os(a,'eat-term-color-bright-green','■')+os(a,'eat-term-color-bright-yellow','■')+os(a,'eat-term-color-bright-blue','■')+os(a,'eat-term-color-bright-magenta','■')+os(a,'eat-term-color-bright-cyan','■')+os(a,'eat-term-color-bright-white','■')+' bright'); - L.push(''); - L.push(os(a,'eat-term-bold','bold')+' '+os(a,'eat-term-faint','faint')+' '+os(a,'eat-term-italic','italic')+' '+os(a,'eat-term-slow-blink','slow-blink')+' '+os(a,'eat-term-fast-blink','fast-blink')); - L.push(''); - L.push(os(a,'eat-shell-prompt-annotation-running','…')+' running tests'); - L.push(os(a,'eat-shell-prompt-annotation-failure','✘')+' build failed'); +function renderEatPreview(){const a='eat',L=[],c=(f,t)=>os(a,'eat-term-color-'+f,t),x=(f,t)=>os(a,'eat-term-'+f,t),an=(g,t)=>os(a,'eat-shell-prompt-annotation-'+g,t); + const p=g=>an(g,g==='success'?'✔':g==='failure'?'✘':'…')+' ~/projects/app $ '; + // 1. directory listing -- the widest palette block (dircolors) + L.push(p('success')+'eza -la --color'); + L.push('drwxr-xr-x - 14:02 '+c('blue','.git/')); + L.push('.rw-r--r-- 120 09:11 .gitignore'); + L.push('drwxr-xr-x - 14:02 '+c('blue','src/')); + L.push('drwxr-xr-x - 13:48 '+c('blue','tests/')); + L.push('.rwxr-xr-x 2.1k 14:00 '+c('bright-green','run.sh')); + L.push('lrwxr-xr-x - 14:01 '+c('cyan','latest')+' -> '+c('blue','v2.1/')); + L.push('.rw-r--r-- 4.5M 22:30 '+c('red','backup.tar.gz')); + L.push('.rw-r--r-- 88k 18:05 '+c('magenta','logo.png')); + L.push('.rw-r--r-- 3.2k 14:02 README.md'); + L.push(''); + // 2. git status -- staged green, unstaged/untracked red + L.push(p('success')+'git status -sb'); + L.push(c('bright-cyan','## main...origin/main [ahead 2]')); + L.push(c('green','A src/eat-preview.js')); + L.push(c('green','A src/cache.el')); + L.push(c('green','M README.md')); + L.push(c('red',' M init.el')); + L.push(c('red',' M modules/term-config.el')); + L.push(c('red',' D modules/old-vterm.el')); + L.push(c('red','?? docs/design/eat.org')); + L.push(c('red','?? scratch.txt')); + L.push(''); + // 3. git log --decorate -- yellow hashes, colored refs, a merge + L.push(p('success')+'git log --oneline --graph --decorate'); + L.push(c('bright-black','* ')+c('yellow','a1b2c3d')+' '+c('bright-cyan','(HEAD -> ')+c('bright-green','main')+c('bright-cyan',')')+' richer eat preview blocks'); + L.push(c('bright-black','* ')+c('yellow','9f8e7d6')+' '+c('bright-yellow','(tag: v2.1, ')+c('bright-red','origin/main')+c('bright-yellow',')')+' lowercase the labels'); + L.push(c('bright-black','* ')+c('yellow','3c4d5e6')+' Merge branch '+c('green',"'eat-faces'")); + L.push(c('bright-black','|\\ ')); + L.push(c('bright-black','| * ')+c('yellow','7a8b9c0')+' expose eat faces to studio'); + L.push(c('bright-black','| * ')+c('yellow','1d2e3f4')+' add eat-term-color docstrings'); + L.push(c('bright-black','|/ ')); + L.push(c('bright-black','* ')+c('yellow','5f6a7b8')+' default video player to mpv'); + L.push(c('bright-black','* ')+c('yellow','2c3d4e5')+' calendar-sync robustness fixes'); + L.push(''); + // 4. test run -- pass green, skip yellow, fail red, bold summary, faint detail + L.push(p('failure')+'make test'); + L.push(c('green','✔ PASS')+' term-toggle '+x('faint','(19 tests)')); + L.push(c('green','✔ PASS')+' ai-term '+x('faint','(158 tests)')); + L.push(c('green','✔ PASS')+' calendar-sync '+x('faint','(575 tests)')); + L.push(c('green','✔ PASS')+' dashboard '+x('faint','(18 tests)')); + L.push(c('yellow','⚠ SKIP')+' network-sync '+x('faint','(2 tests, offline)')); + L.push(c('green','✔ PASS')+' transcription '+x('faint','(44 tests)')); + L.push(c('red','✘ FAIL')+' org-roam-refile '+x('faint','(1 test)')); + L.push(' '+x('italic','expected 3 refile targets, got 0')); + L.push(x('bold','Ran 817 tests, 815 passed, ')+c('yellow','1 skipped, ')+c('red','1 failed')+' '+x('faint','0.84s')); + L.push(''); + // swatch reference key, below the realistic blocks + L.push(x('faint','palette')+' '+c('black','■')+c('red','■')+c('green','■')+c('yellow','■')+c('blue','■')+c('magenta','■')+c('cyan','■')+c('white','■')+' '+c('bright-black','■')+c('bright-red','■')+c('bright-green','■')+c('bright-yellow','■')+c('bright-blue','■')+c('bright-magenta','■')+c('bright-cyan','■')+c('bright-white','■')); + L.push(x('faint','attrs')+' '+x('bold','bold')+' '+x('faint','faint')+' '+x('italic','italic')+' '+x('slow-blink','slow-blink')+' '+x('fast-blink','fast-blink')); + L.push(x('faint','prompt')+' '+an('success','✔ ok')+' '+an('running','… running')+' '+an('failure','✘ failed')); return previewLines(L);} function renderFlycheckPreview(){const a='flycheck',L=[]; L.push(os(a,'flycheck-fringe-error','E')+os(a,'flycheck-fringe-warning','W')+os(a,'flycheck-fringe-info','I')+' x = '+os(a,'flycheck-error','undefined_name')+'('+os(a,'flycheck-warning','unused_arg')+') '+os(a,'flycheck-info','# note')); @@ -327,18 +362,59 @@ function renderDiredPreview(){const a='dired',L=[]; L.push(' '+os(a,'dired-special','prw-r--r--')+' craig 0 fifo.pipe'); L.push(os(a,'dired-warning','! disk space low on /home')); return previewLines(L);} -function renderDirvishPreview(){const a='dirvish',L=[]; - L.push(os(a,'dirvish-inactive','~/code')+' '+os(a,'dirvish-free-space','[free 24G]')); - L.push(os(a,'dirvish-hl-line',' '+os(a,'dirvish-file-modes','-rw-r--r--')+' '+os(a,'dirvish-file-link-number','1')+' '+os(a,'dirvish-file-user-id','craig')+' '+os(a,'dirvish-file-group-id','staff')+' '+os(a,'dirvish-file-size','4.0K')+' '+os(a,'dirvish-file-time','Jun 8 02:24')+' init.el ')); - L.push(' '+os(a,'dirvish-file-modes','drwxr-xr-x')+' '+os(a,'dirvish-file-link-number','5')+' '+os(a,'dirvish-file-user-id','craig')+' '+os(a,'dirvish-file-group-id','staff')+' '+os(a,'dirvish-file-size',' - ')+' '+os(a,'dirvish-file-time','Jun 7 18:00')+' '+os(a,'dirvish-collapse-dir-face','src')+os(a,'dirvish-subtree-state','+')+os(a,'dirvish-subtree-guide',' |')); - L.push(os(a,'dirvish-hl-line-inactive',' inactive-window current line ')); - L.push(' inode '+os(a,'dirvish-file-inode-number','1048576')+' dev '+os(a,'dirvish-file-device-number','8,1')+' '+os(a,'dirvish-collapse-empty-dir-face','empty/')+' '+os(a,'dirvish-collapse-file-face','file.txt')); - L.push(' VC '+os(a,'dirvish-vc-added-state','A')+os(a,'dirvish-vc-edited-state','M')+os(a,'dirvish-vc-removed-state','D')+os(a,'dirvish-vc-conflict-state','C')+os(a,'dirvish-vc-locked-state','L')+os(a,'dirvish-vc-missing-state','!')+os(a,'dirvish-vc-needs-merge-face','m')+os(a,'dirvish-vc-needs-update-state','u')+os(a,'dirvish-vc-unregistered-face','?')); - L.push(' git '+os(a,'dirvish-git-commit-message-face','feat: enlarge the picker')); - L.push(' '+os(a,'dirvish-media-info-heading','Media')+' '+os(a,'dirvish-media-info-property-key','Dimensions:')+' 1920x1080'); - L.push(' proc '+os(a,'dirvish-proc-running','running')+' / '+os(a,'dirvish-proc-finished','finished')+' / '+os(a,'dirvish-proc-failed','failed')); - L.push(' narrow '+os(a,'dirvish-narrow-match-face-0','m0')+' '+os(a,'dirvish-narrow-match-face-1','m1')+' '+os(a,'dirvish-narrow-match-face-2','m2')+' '+os(a,'dirvish-narrow-match-face-3','m3')+os(a,'dirvish-narrow-split',' | ')+os(a,'dirvish-emerge-group-title','Group: images')); - return previewLines(L);} +// A believable two-pane dirvish: an active directory listing on the left +// (nerd-icon per file type, dir-entry counts / file sizes, the hl-line on the +// selected row, a dimmed backup) and the selected dir's ls-l preview on the +// right. Faces that don't fit a calm listing (vc, git, subtree, media, proc, +// narrow, emerge) live in a labeled extras strip below so theme coverage stays +// complete. Glyphs/colors mirror what nerd-icons actually emits per type. +function renderDirvishPreview(){ + const D='dirvish', N='nerd-icons', DR='dired'; + // foreground-only span, so a row background (the hl-line) shows through it + const fg=(app,face,t)=>`<span style="color:${effFg(pkgEffFg(app,face))}">${t}</span>`; + const ic=(face,g)=>os(N,face,g); + const pad=(name,w)=>esc(name)+' '.repeat(Math.max(1,w-name.length)); + const HL=pkgEffBg(D,'dirvish-hl-line')||MAP['bg']; + + // ---- left pane: the active directory ---- + const left=[os(DR,'dired-header','~/code/emacs-wttrin:')]; + for(const [name,cnt,sel] of [['assets','4',true],['examples','1'],['githooks','1'], + ['inbox','3'],['scripts','1'],['tests','71']]){ + if(sel) left.push(`<span style="background:${HL}">`+fg(N,'nerd-icons-yellow','')+' ' + +fg(DR,'dired-directory',pad(name,21))+fg(D,'dirvish-file-size',cnt)+`</span>`); + else left.push(ic('nerd-icons-yellow','')+' '+os(DR,'dired-directory',pad(name,21)) + +os(D,'dirvish-file-size',cnt)); + } + for(const [face,g,name,size] of [['nerd-icons-lblue','','CLAUDE.md','4.9k'], + ['nerd-icons-blue','','Eask','518'],['nerd-icons-blue','','LICENSE','34k'], + ['nerd-icons-dorange','','Makefile','12k'],['nerd-icons-lcyan','','README.org','24k'], + ['nerd-icons-lgreen','','todo.org','23k'],['nerd-icons-purple','','wttrin.el','69k'], + ['nerd-icons-dsilver','','wttrin.elc','4.3k']]) + left.push(ic(face,g)+' '+pad(name,21)+os(D,'dirvish-file-size',size)); + left.push(ic('nerd-icons-lgreen','')+' '+os(DR,'dired-ignored',pad('todo.org~',21)) + +os(D,'dirvish-file-size','8.8k')); + + // ---- right pane: ls -l preview of the selected dir ---- + const ll=(size,time,name)=>os(D,'dirvish-file-modes','-rw-r--r--')+' ' + +os(D,'dirvish-file-link-number','1')+' '+os(D,'dirvish-file-user-id','cjennings')+' ' + +os(D,'dirvish-file-group-id','cjennings')+' '+os(D,'dirvish-file-size',size)+' ' + +os(D,'dirvish-file-time',time)+' '+ic('nerd-icons-orange','\u{F0E2D}')+' '+esc(name); + const right=[os(DR,'dired-header','assets:'), + ll('54K','Jun 26 10:53','geolocation.png'),ll('52K','Jun 26 10:53','location-menu.png'), + ll('3.1K','Apr 10 12:03','made-for-emacs.svg'),ll('346K','Jun 26 10:53','wttrin.png')]; + + // ---- extras: remaining dirvish faces, kept for theme coverage ---- + const ex=[ + os(D,'dirvish-inactive','inactive pane')+' '+os(D,'dirvish-hl-line-inactive',' inactive current line ')+' '+os(D,'dirvish-free-space','[free 24G]'), + 'vc '+os(D,'dirvish-vc-added-state','A')+os(D,'dirvish-vc-edited-state','M')+os(D,'dirvish-vc-removed-state','D')+os(D,'dirvish-vc-conflict-state','C')+os(D,'dirvish-vc-locked-state','L')+os(D,'dirvish-vc-missing-state','!')+os(D,'dirvish-vc-needs-merge-face','m')+os(D,'dirvish-vc-needs-update-state','u')+os(D,'dirvish-vc-unregistered-face','?')+' git '+os(D,'dirvish-git-commit-message-face','feat: enlarge the picker'), + 'subtree '+os(D,'dirvish-collapse-dir-face','src')+os(D,'dirvish-subtree-state','+')+os(D,'dirvish-subtree-guide',' | ')+os(D,'dirvish-collapse-empty-dir-face','empty/')+' '+os(D,'dirvish-collapse-file-face','file.txt')+' inode '+os(D,'dirvish-file-inode-number','1048576')+' dev '+os(D,'dirvish-file-device-number','8,1'), + 'media '+os(D,'dirvish-media-info-heading','Media')+' '+os(D,'dirvish-media-info-property-key','Dimensions:')+' 1920x1080 proc '+os(D,'dirvish-proc-running','running')+'/'+os(D,'dirvish-proc-finished','finished')+'/'+os(D,'dirvish-proc-failed','failed'), + 'narrow '+os(D,'dirvish-narrow-match-face-0','m0')+' '+os(D,'dirvish-narrow-match-face-1','m1')+' '+os(D,'dirvish-narrow-match-face-2','m2')+' '+os(D,'dirvish-narrow-match-face-3','m3')+os(D,'dirvish-narrow-split',' | ')+os(D,'dirvish-emerge-group-title','Group: images')]; + + const col=(lines)=>`<div style="white-space:pre">${lines.join('\n')}</div>`; + return `<div style="padding:12px 16px;font:12pt/1.7 ${PREVIEW_FONT}">` + +`<div style="display:flex;gap:2.5em">${col(left)}${col(right)}</div>` + +`<div style="margin-top:1.2em;opacity:0.9">${col(ex)}</div></div>`;} function renderCalibredbPreview(){const a='calibredb',L=[]; L.push(os(a,'calibredb-search-header-library-name-face','Calibre')+' '+os(a,'calibredb-search-header-library-path-face','~/books')+' '+os(a,'calibredb-search-header-total-face','412 books')+' '+os(a,'calibredb-search-header-filter-face','tag:scifi')+' '+os(a,'calibredb-search-header-sort-face','sort:date')+' '+os(a,'calibredb-search-header-highlight-face','[*]')); L.push(''); @@ -392,6 +468,38 @@ function renderShrPreview(){const a='shr',L=[]; L.push(os(a,'shr-text','some ')+os(a,'shr-code','inline_code()')+os(a,'shr-text',', a ')+os(a,'shr-mark','highlighted mark')+os(a,'shr-text',', ')+os(a,'shr-strike-through','struck out')+os(a,'shr-text',', a footnote')+os(a,'shr-sup','[1]')+os(a,'shr-text',',')); L.push(os(a,'shr-text','an ')+os(a,'shr-abbreviation','HTML')+os(a,'shr-text',' abbreviation, and an ')+os(a,'shr-sliced-image','[image]')+os(a,'shr-text',' slice.')); return previewLines(L);} +// nov-reading: a realistic book page per palette, not the line-based format. +// Each palette face supplies the page bg+fg (via ofs); the serif typography and +// hierarchy are CSS so the preview reads like an actual novel page. Tuning a +// palette face repaints its page. data-owner-app/-face keep face-locate working. +function novReadingPage(a,face,label){ + const cls=isLocateOnPane(a,curApp())?' class="locate-onpane"':''; + const title=attresc(formatLocateTitle(locateFaceMeta(a,face,LOCATE_REG))); + const page=ofs(a,face)+";width:34em;max-width:100%;border-radius:6px;box-shadow:0 1px 8px #0007;padding:24px 30px 18px;font:13pt/1.62 Georgia,'Times New Roman',serif"; + // Structural faces recolor the title (heading) and an inline link, derived by + // suffix from the palette face so tuning them in the studio repaints the page. + const hface=face+'-heading',lface=face+'-link'; + const htitle=attresc(formatLocateTitle(locateFaceMeta(a,hface,LOCATE_REG))); + const hfg=effFg(pkgEffFg(a,hface)); + return `<div data-owner-app="${a}" data-face="${face}"${cls} title="${title}" style="${page}">` + +`<div style="text-align:center;font-variant:small-caps;letter-spacing:.08em;font-size:10pt;opacity:.72;margin-bottom:3px">Nathaniel Hawthorne · Twice-Told Tales</div>` + +`<div data-owner-app="${a}" data-face="${hface}"${cls} title="${htitle}" style="text-align:center;font:italic 600 16pt/1.3 Georgia,serif;margin:.15em 0 1em;color:${hfg}">Dr. Heidegger’s Experiment</div>` + +`<p style="margin:0 0 .75em">` + +`<span style="float:left;font:600 320%/.74 Georgia,serif;padding:6px 8px 0 0">T</span>` + +`hat very singular man, old Dr. Heidegger, once invited four venerable friends to meet him in his study. There were three white-bearded gentlemen, Mr. Medbourne, Colonel Killigrew, and Mr. Gascoigne, and a withered gentlewoman whose name was the Widow Wycherly.</p>` + +`<p style="margin:0 0 .75em;text-indent:1.4em">They were all melancholy old creatures, who had been unfortunate in life. <em>If the powder be genuine,</em> said the doctor, `+os(a,lface,'the rose of half a century')+` should bloom again.</p>` + +`<div style="text-align:center;font-size:9.5pt;opacity:.6;margin-top:.7em">${esc(label)} · 12</div>` + +`</div>`;} +function renderNovReadingPreview(){ + const a='nov-reading',faces=(APPS[a]&&APPS[a].faces)||[]; + if(!faces.length)return genericPreview(a); + // One book page per base palette (the bg/fg faces); the per-palette heading + // and link faces color the title and inline link within each page rather than + // getting a page of their own. + const base=faces.filter(r=>!/-heading$|-link$/.test(r[0])); + let h='<div style="padding:14px 16px;display:flex;flex-direction:column;gap:18px;align-items:center">'; + for(const row of base)h+=novReadingPage(a,row[0],row[1]); + return h+'</div>';} function renderSlackPreview(){const a='slack',L=[]; L.push(os(a,'slack-room-info-title-room-name-face','#general')+' '+os(a,'slack-room-info-title-face','Acme Workspace')); L.push(os(a,'slack-room-info-section-title-face','Topic')+' '+os(a,'slack-room-info-section-label-face','daily standup')+' '+os(a,'slack-room-unread-face','3 unread')); diff --git a/scripts/theme-studio/samples.py b/scripts/theme-studio/samples.py index 585fff04c..feebd1b71 100644 --- a/scripts/theme-studio/samples.py +++ b/scripts/theme-studio/samples.py @@ -43,6 +43,7 @@ PYS=[ ] ELS=[ [('cmd',';;'),('cm',' cache.el')], + [('cmd',';;'),('cm',' '),('warn','TODO'),('cm',': add an LRU eviction policy')], [('punc','('),('kw','require'),('p',' '),('con',"'cl-lib"),('punc',')')], [], [('punc','('),('kw','defvar'),('p',' '),('var','cache--tbl'),('p',' '),('punc','('),('fnc','make-hash-table'),('p',' '),('con',':test'),('p',' '),('con',"'equal"),('punc','))')], @@ -55,7 +56,7 @@ ELS=[ [('p',' '),('punc','('),('fnc','puthash'),('p',' '),('var','key'),('p',' '),('var','v'),('p',' '),('var','cache--tbl'),('punc',') '),('var','v'),('punc','))))')], [], [('punc','('),('kw','defun'),('p',' '),('fnd','cache-clear'),('p',' '),('punc','()')], - [('p',' '),('doc','"Empty the memo table."')], + [('p',' '),('doc','"Empty the memo table. See '),('dmark','\\\\[cache-get]'),('doc','."')], [('p',' '),('punc','('),('kw','interactive'),('punc',')')], [('p',' '),('punc','('),('fnc','clrhash'),('p',' '),('var','cache--tbl'),('punc',')')], [('p',' '),('punc','('),('fnc','message'),('p',' '),('str','"cleared'),('esc','\\n'),('str','"'),('punc','))')], @@ -66,6 +67,9 @@ ELS=[ [('p',' '),('punc','('),('fnc','maphash'),('p',' '),('punc','('),('kw','lambda'),('p',' '),('punc','('),('var','k'),('p',' '),('var','_v'),('punc',')'),('p',' '),('punc','('),('fnc','push'),('p',' '),('var','k'),('p',' '),('var','acc'),('punc','))')], [('p',' '),('var','cache--tbl'),('punc',')'),('p',' '),('var','acc'),('punc','))')], [], + [('punc','('),('kw','defun'),('p',' '),('fnd','cache--key-p'),('p',' '),('punc','('),('var','s'),('punc',')')], + [('p',' '),('punc','('),('fnc','string-match'),('p',' '),('str','"'),('rxgb','\\\\'),('rxgc','('),('str','key'),('rxgb','\\\\'),('rxgc',')'),('str','"'),('p',' '),('var','s'),('punc','))')], + [], [('punc','('),('kw','provide'),('p',' '),('con',"'cache"),('punc',')')], ] GOS=[ @@ -134,7 +138,7 @@ CS=[ [], [('cmd','//'),('cm',' returns -1 on null input')], [('ty','int'),('p',' '),('fnd','push'),('punc','('),('ty','Order'),('p',' '),('op','*'),('var','o'),('punc',')'),('p',' '),('dec','__attribute__'),('punc','(('),('dec','nonnull'),('punc','))'),('p',' '),('punc','{')], - [('p',' '),('kw','if'),('p',' '),('punc','('),('var','o'),('p',' '),('op','=='),('p',' '),('con','NULL'),('punc',')'),('p',' '),('kw','return'),('p',' '),('num','-1'),('punc',';')], + [('p',' '),('kw','if'),('p',' '),('punc','('),('neg','!'),('var','o'),('punc',')'),('p',' '),('kw','return'),('p',' '),('num','-1'),('punc',';')], [('p',' '),('fnc','printf'),('punc','('),('str','"id=%d'),('esc','\\n'),('str','"'),('punc',','),('p',' '),('var','o'),('op','->'),('prop','id'),('punc',');')], [('p',' '),('kw','return'),('p',' '),('num','0'),('punc',';')], [('punc','}')], diff --git a/scripts/theme-studio/test_generate.py b/scripts/theme-studio/test_generate.py index 3bc78bdf8..d4744cdea 100644 --- a/scripts/theme-studio/test_generate.py +++ b/scripts/theme-studio/test_generate.py @@ -619,7 +619,6 @@ class GeneratedDefaults(unittest.TestCase): def test_representative_package_inherits_are_selected(self): self.assertEqual(self.package_seed("elfeed", "elfeed-search-filter-face")["inherit"], "mode-line-buffer-id") - self.assertEqual(self.package_seed("ghostel", "ghostel-default")["inherit"], "default") def test_syntax_defaults_capture_font_lock_styles(self): self.assertEqual(generate.MAP["kw"], "#d3d3d3") diff --git a/scripts/theme-studio/theme-studio.html b/scripts/theme-studio/theme-studio.html index 04facca6e..3b8d4b90e 100644 --- a/scripts/theme-studio/theme-studio.html +++ b/scripts/theme-studio/theme-studio.html @@ -297,10 +297,10 @@ </div> </div> <script> -const SAMPLES={"Elisp": [[["cmd", ";;"], ["cm", " cache.el"]], [["punc", "("], ["kw", "require"], ["p", " "], ["con", "'cl-lib"], ["punc", ")"]], [], [["punc", "("], ["kw", "defvar"], ["p", " "], ["var", "cache--tbl"], ["p", " "], ["punc", "("], ["fnc", "make-hash-table"], ["p", " "], ["con", ":test"], ["p", " "], ["con", "'equal"], ["punc", "))"]], [["p", " "], ["doc", "\"Memo table.\")"]], [], [["punc", "("], ["kw", "defun"], ["p", " "], ["fnd", "cache-get"], ["p", " "], ["punc", "("], ["var", "key"], ["punc", ")"]], [["p", " "], ["doc", "\"Return cached value for KEY.\""]], [["p", " "], ["punc", "("], ["kw", "or"], ["p", " "], ["punc", "("], ["bi", "gethash"], ["p", " "], ["var", "key"], ["p", " "], ["var", "cache--tbl"], ["punc", ")"]], [["p", " "], ["punc", "("], ["kw", "let"], ["p", " "], ["punc", "(("], ["var", "v"], ["p", " "], ["punc", "("], ["fnc", "compute"], ["p", " "], ["var", "key"], ["p", " "], ["num", "42"], ["punc", "))) "]], [["p", " "], ["punc", "("], ["fnc", "puthash"], ["p", " "], ["var", "key"], ["p", " "], ["var", "v"], ["p", " "], ["var", "cache--tbl"], ["punc", ") "], ["var", "v"], ["punc", "))))"]], [], [["punc", "("], ["kw", "defun"], ["p", " "], ["fnd", "cache-clear"], ["p", " "], ["punc", "()"]], [["p", " "], ["doc", "\"Empty the memo table.\""]], [["p", " "], ["punc", "("], ["kw", "interactive"], ["punc", ")"]], [["p", " "], ["punc", "("], ["fnc", "clrhash"], ["p", " "], ["var", "cache--tbl"], ["punc", ")"]], [["p", " "], ["punc", "("], ["fnc", "message"], ["p", " "], ["str", "\"cleared"], ["esc", "\\n"], ["str", "\""], ["punc", "))"]], [], [["punc", "("], ["kw", "defun"], ["p", " "], ["fnd", "cache-keys"], ["p", " "], ["punc", "()"]], [["p", " "], ["doc", "\"Return all keys.\""]], [["p", " "], ["punc", "("], ["kw", "let"], ["p", " "], ["punc", "(("], ["var", "acc"], ["p", " "], ["con", "nil"], ["punc", "))"]], [["p", " "], ["punc", "("], ["fnc", "maphash"], ["p", " "], ["punc", "("], ["kw", "lambda"], ["p", " "], ["punc", "("], ["var", "k"], ["p", " "], ["var", "_v"], ["punc", ")"], ["p", " "], ["punc", "("], ["fnc", "push"], ["p", " "], ["var", "k"], ["p", " "], ["var", "acc"], ["punc", "))"]], [["p", " "], ["var", "cache--tbl"], ["punc", ")"], ["p", " "], ["var", "acc"], ["punc", "))"]], [], [["punc", "("], ["kw", "provide"], ["p", " "], ["con", "'cache"], ["punc", ")"]]], "Go": [[["cmd", "//"], ["cm", " queue.go"]], [["kw", "package"], ["p", " "], ["var", "main"]], [], [["kw", "import"], ["p", " "], ["str", "\"fmt\""]], [], [["kw", "const"], ["p", " "], ["con", "MaxItems"], ["p", " "], ["op", "="], ["p", " "], ["num", "100"]], [], [["kw", "type"], ["p", " "], ["ty", "Order"], ["p", " "], ["kw", "struct"], ["p", " "], ["punc", "{"]], [["p", " "], ["prop", "ID"], ["p", " "], ["ty", "int"]], [["p", " "], ["prop", "Name"], ["p", " "], ["ty", "string"]], [["punc", "}"]], [], [["kw", "func"], ["p", " "], ["punc", "("], ["var", "q"], ["p", " "], ["op", "*"], ["ty", "Queue"], ["punc", ")"], ["p", " "], ["fnd", "Push"], ["punc", "("], ["var", "o"], ["p", " "], ["op", "*"], ["ty", "Order"], ["punc", ")"], ["p", " "], ["ty", "error"], ["p", " "], ["punc", "{"]], [["p", " "], ["cmd", "//"], ["cm", " reject nil"]], [["p", " "], ["kw", "if"], ["p", " "], ["var", "o"], ["p", " "], ["op", "=="], ["p", " "], ["con", "nil"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "return"], ["p", " "], ["fnc", "fmt.Errorf"], ["punc", "("], ["str", "\"nil"], ["esc", "\\n"], ["str", "\""], ["punc", ")"]], [["p", " "], ["punc", "}"]], [["p", " "], ["var", "q"], ["op", "."], ["prop", "items"], ["p", " "], ["op", "="], ["p", " "], ["bi", "append"], ["punc", "("], ["var", "q"], ["op", "."], ["prop", "items"], ["punc", ","], ["p", " "], ["var", "o"], ["punc", ")"]], [["p", " "], ["kw", "return"], ["p", " "], ["con", "nil"]], [["punc", "}"]], [], [["kw", "func"], ["p", " "], ["fnd", "main"], ["punc", "()"], ["p", " "], ["punc", "{"]], [["p", " "], ["fnc", "fmt.Println"], ["punc", "("], ["op", "&"], ["ty", "Queue"], ["punc", "{}"], ["punc", ")"]], [["punc", "}"]]], "Python": [[["cmd", "#"], ["cm", " theme.py"]], [["kw", "from"], ["p", " "], ["var", "dataclasses"], ["p", " "], ["kw", "import"], ["p", " "], ["var", "dataclass"], ["punc", ","], ["p", " "], ["var", "field"]], [], [["con", "DEFAULT_PORT"], ["op", ":"], ["p", " "], ["ty", "int"], ["p", " "], ["op", "="], ["p", " "], ["num", "8080"]], [["con", "HEX"], ["p", " "], ["op", "="], ["p", " "], ["var", "re"], ["op", "."], ["fnc", "compile"], ["punc", "("], ["re", "r\"#[0-9a-f]{6}\""], ["punc", ")"]], [], [["dec", "@dataclass"]], [["kw", "class"], ["p", " "], ["ty", "Theme"], ["op", ":"]], [["p", " "], ["doc", "\"\"\"A color theme.\"\"\""]], [["p", " "], ["prop", "name"], ["op", ":"], ["p", " "], ["ty", "str"], ["p", " "], ["op", "="], ["p", " "], ["str", "\"dupre\""]], [["p", " "], ["prop", "colors"], ["op", ":"], ["p", " "], ["ty", "dict"], ["p", " "], ["op", "="], ["p", " "], ["fnc", "field"], ["punc", "("], ["prop", "default_factory"], ["op", "="], ["ty", "dict"], ["punc", ")"]], [], [["p", " "], ["kw", "def"], ["p", " "], ["fnd", "resolve"], ["punc", "("], ["var", "self"], ["punc", ","], ["p", " "], ["var", "key"], ["op", ":"], ["p", " "], ["ty", "str"], ["punc", ")"], ["p", " "], ["op", "->"], ["p", " "], ["ty", "str"], ["p", " "], ["op", "|"], ["p", " "], ["con", "None"], ["op", ":"]], [["p", " "], ["cmd", "#"], ["cm", " fallback to none"]], [["p", " "], ["var", "v"], ["p", " "], ["op", "="], ["p", " "], ["var", "self"], ["op", "."], ["prop", "colors"], ["op", "."], ["fnc", "get"], ["punc", "("], ["var", "key"], ["punc", ","], ["p", " "], ["str", "\""], ["esc", "\\t"], ["str", "none\""], ["punc", ")"]], [["p", " "], ["kw", "if"], ["p", " "], ["bi", "len"], ["punc", "("], ["var", "v"], ["punc", ")"], ["p", " "], ["op", "=="], ["p", " "], ["num", "0"], ["op", ":"], ["p", " "], ["kw", "return"], ["p", " "], ["con", "None"]], [["p", " "], ["kw", "return"], ["p", " "], ["var", "v"]], [], [["p", " "], ["dec", "@property"]], [["p", " "], ["kw", "def"], ["p", " "], ["fnd", "size"], ["punc", "("], ["var", "self"], ["punc", ")"], ["p", " "], ["op", "->"], ["p", " "], ["ty", "int"], ["op", ":"]], [["p", " "], ["kw", "return"], ["p", " "], ["bi", "len"], ["punc", "("], ["var", "self"], ["op", "."], ["prop", "colors"], ["punc", ")"]], [], [["var", "theme"], ["p", " "], ["op", "="], ["p", " "], ["ty", "Theme"], ["punc", "("], ["str", "\"dupre\""], ["punc", ")"]], [["fnc", "print"], ["punc", "("], ["var", "theme"], ["op", "."], ["fnc", "resolve"], ["punc", "("], ["str", "\"bg\""], ["punc", "))"]]], "TypeScript": [[["cmd", "//"], ["cm", " orders.ts"]], [["kw", "import"], ["p", " "], ["punc", "{"], ["p", " "], ["ty", "Order"], ["p", " "], ["punc", "}"], ["p", " "], ["kw", "from"], ["p", " "], ["str", "\"./types\""]], [], [["kw", "export"], ["p", " "], ["kw", "interface"], ["p", " "], ["ty", "Queue"], ["p", " "], ["punc", "{"]], [["p", " "], ["prop", "max"], ["op", ":"], ["p", " "], ["ty", "number"], ["punc", ";"]], [["p", " "], ["prop", "items"], ["op", ":"], ["p", " "], ["ty", "Order"], ["punc", "[];"]], [["punc", "}"]], [], [["dec", "@Injectable"], ["punc", "()"]], [["kw", "export"], ["p", " "], ["kw", "class"], ["p", " "], ["ty", "OrderQueue"], ["p", " "], ["kw", "implements"], ["p", " "], ["ty", "Queue"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "private"], ["p", " "], ["prop", "re"], ["p", " "], ["op", "="], ["p", " "], ["re", "/^#[0-9a-f]{6}$/i"], ["punc", ";"]], [], [["p", " "], ["fnd", "push"], ["punc", "("], ["var", "o"], ["op", ":"], ["p", " "], ["ty", "Order"], ["punc", ")"], ["op", ":"], ["p", " "], ["ty", "boolean"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "if"], ["p", " "], ["punc", "("], ["var", "o"], ["p", " "], ["op", "==="], ["p", " "], ["con", "null"], ["punc", ")"], ["p", " "], ["kw", "return"], ["p", " "], ["con", "false"], ["punc", ";"]], [["p", " "], ["var", "console"], ["op", "."], ["fnc", "log"], ["punc", "("], ["str", "`id "], ["punc", "${"], ["var", "o"], ["op", "."], ["prop", "id"], ["punc", "}"], ["esc", "\\n"], ["str", "`"], ["punc", ");"]], [["p", " "], ["kw", "return"], ["p", " "], ["con", "true"], ["punc", ";"]], [["p", " "], ["punc", "}"]], [["punc", "}"]], [], [["kw", "const"], ["p", " "], ["con", "LIMIT"], ["op", ":"], ["p", " "], ["ty", "number"], ["p", " "], ["op", "="], ["p", " "], ["num", "50"], ["punc", ";"]], [["kw", "const"], ["p", " "], ["var", "q"], ["p", " "], ["op", "="], ["p", " "], ["kw", "new"], ["p", " "], ["ty", "OrderQueue"], ["punc", "()"], ["punc", ";"]], [["var", "q"], ["op", "."], ["fnd", "push"], ["punc", "("], ["punc", "{"], ["p", " "], ["prop", "id"], ["op", ":"], ["p", " "], ["num", "1"], ["p", " "], ["punc", "}"], ["p", " "], ["kw", "as"], ["p", " "], ["ty", "Order"], ["punc", ")"], ["punc", ";"]], [["var", "console"], ["op", "."], ["fnc", "log"], ["punc", "("], ["var", "q"], ["op", "."], ["prop", "max"], ["punc", ")"], ["punc", ";"]], [["kw", "const"], ["p", " "], ["var", "cap"], ["p", " "], ["op", "="], ["p", " "], ["var", "Math"], ["op", "."], ["bi", "max"], ["punc", "("], ["con", "LIMIT"], ["punc", ","], ["p", " "], ["num", "0"], ["punc", ")"], ["punc", ";"]]], "Java": [[["cmd", "/**"], ["doc", " A color theme. */"]], [["kw", "package"], ["p", " "], ["var", "com"], ["op", "."], ["var", "dupre"], ["punc", ";"]], [["kw", "import"], ["p", " "], ["var", "java"], ["op", "."], ["var", "util"], ["op", "."], ["var", "regex"], ["op", "."], ["ty", "Pattern"], ["punc", ";"]], [], [["dec", "@Deprecated"]], [["kw", "public"], ["p", " "], ["kw", "final"], ["p", " "], ["kw", "class"], ["p", " "], ["ty", "Theme"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "private"], ["p", " "], ["kw", "static"], ["p", " "], ["kw", "final"], ["p", " "], ["ty", "int"], ["p", " "], ["con", "MAX_PORT"], ["p", " "], ["op", "="], ["p", " "], ["num", "8080"], ["punc", ";"]], [["p", " "], ["kw", "private"], ["p", " "], ["kw", "final"], ["p", " "], ["ty", "String"], ["p", " "], ["prop", "name"], ["p", " "], ["op", "="], ["p", " "], ["str", "\"dupre\""], ["punc", ";"]], [["p", " "], ["kw", "private"], ["p", " "], ["kw", "static"], ["p", " "], ["kw", "final"], ["p", " "], ["ty", "Pattern"], ["p", " "], ["con", "HEX"], ["p", " "], ["op", "="], ["p", " "], ["ty", "Pattern"], ["op", "."], ["fnc", "compile"], ["punc", "("], ["re", "\"#[0-9a-f]{6}\""], ["punc", ")"], ["punc", ";"]], [], [["p", " "], ["dec", "@Override"]], [["p", " "], ["kw", "public"], ["p", " "], ["ty", "String"], ["p", " "], ["fnd", "resolve"], ["punc", "("], ["ty", "String"], ["p", " "], ["var", "key"], ["punc", ")"], ["p", " "], ["punc", "{"]], [["p", " "], ["cmd", "//"], ["cm", " fall back to null"]], [["p", " "], ["kw", "if"], ["p", " "], ["punc", "("], ["var", "key"], ["op", "."], ["fnc", "isEmpty"], ["punc", "()"], ["punc", ")"], ["p", " "], ["kw", "return"], ["p", " "], ["con", "null"], ["punc", ";"]], [["p", " "], ["kw", "return"], ["p", " "], ["var", "key"], ["op", "."], ["fnc", "strip"], ["punc", "("], ["punc", ")"], ["op", "+"], ["str", "\""], ["esc", "\\t"], ["str", "\""], ["punc", ";"]], [["p", " "], ["punc", "}"]], [], [["p", " "], ["kw", "public"], ["p", " "], ["kw", "static"], ["p", " "], ["ty", "void"], ["p", " "], ["fnd", "main"], ["punc", "("], ["ty", "String"], ["punc", "[]"], ["p", " "], ["var", "args"], ["punc", ")"], ["p", " "], ["punc", "{"]], [["p", " "], ["ty", "var"], ["p", " "], ["var", "t"], ["p", " "], ["op", "="], ["p", " "], ["kw", "new"], ["p", " "], ["ty", "Theme"], ["punc", "()"], ["punc", ";"]], [["p", " "], ["ty", "System"], ["op", "."], ["prop", "out"], ["op", "."], ["fnc", "println"], ["punc", "("], ["var", "t"], ["op", "."], ["fnc", "resolve"], ["punc", "("], ["str", "\"bg\""], ["punc", "))"], ["punc", ";"]], [["p", " "], ["punc", "}"]], [["punc", "}"]]], "C": [[["cmd", "/**"], ["doc", " Order queue. */"]], [["pp", "#include"], ["p", " "], ["str", "<stdio.h>"]], [["pp", "#include"], ["p", " "], ["str", "<stdlib.h>"]], [["pp", "#define"], ["p", " "], ["con", "MAX_PORT"], ["p", " "], ["num", "8080"]], [], [["kw", "typedef"], ["p", " "], ["kw", "struct"], ["p", " "], ["punc", "{"]], [["p", " "], ["ty", "int"], ["p", " "], ["prop", "id"], ["punc", ";"]], [["p", " "], ["kw", "const"], ["p", " "], ["ty", "char"], ["p", " "], ["op", "*"], ["prop", "name"], ["punc", ";"]], [["punc", "}"], ["p", " "], ["ty", "Order"], ["punc", ";"]], [], [["cmd", "//"], ["cm", " returns -1 on null input"]], [["ty", "int"], ["p", " "], ["fnd", "push"], ["punc", "("], ["ty", "Order"], ["p", " "], ["op", "*"], ["var", "o"], ["punc", ")"], ["p", " "], ["dec", "__attribute__"], ["punc", "(("], ["dec", "nonnull"], ["punc", "))"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "if"], ["p", " "], ["punc", "("], ["var", "o"], ["p", " "], ["op", "=="], ["p", " "], ["con", "NULL"], ["punc", ")"], ["p", " "], ["kw", "return"], ["p", " "], ["num", "-1"], ["punc", ";"]], [["p", " "], ["fnc", "printf"], ["punc", "("], ["str", "\"id=%d"], ["esc", "\\n"], ["str", "\""], ["punc", ","], ["p", " "], ["var", "o"], ["op", "->"], ["prop", "id"], ["punc", ");"]], [["p", " "], ["kw", "return"], ["p", " "], ["num", "0"], ["punc", ";"]], [["punc", "}"]], [], [["ty", "int"], ["p", " "], ["fnd", "main"], ["punc", "("], ["ty", "void"], ["punc", ")"], ["p", " "], ["punc", "{"]], [["p", " "], ["ty", "Order"], ["p", " "], ["var", "o"], ["p", " "], ["op", "="], ["p", " "], ["punc", "{"], ["p", " "], ["op", "."], ["prop", "id"], ["p", " "], ["op", "="], ["p", " "], ["num", "1"], ["punc", ","], ["p", " "], ["op", "."], ["prop", "name"], ["p", " "], ["op", "="], ["p", " "], ["str", "\"dupre\""], ["p", " "], ["punc", "}"], ["punc", ";"]], [["p", " "], ["ty", "Order"], ["p", " "], ["op", "*"], ["var", "p2"], ["p", " "], ["op", "="], ["p", " "], ["bi", "malloc"], ["punc", "("], ["bi", "sizeof"], ["punc", "("], ["ty", "Order"], ["punc", "))"], ["punc", ";"]], [["p", " "], ["fnc", "push"], ["punc", "("], ["op", "&"], ["var", "o"], ["punc", ")"], ["punc", ";"]], [["p", " "], ["bi", "free"], ["punc", "("], ["var", "p2"], ["punc", ")"], ["punc", ";"]], [["p", " "], ["kw", "return"], ["p", " "], ["num", "0"], ["punc", ";"]], [["punc", "}"]]], "C++": [[["cmd", "/**"], ["doc", " A color theme. */"]], [["pp", "#include"], ["p", " "], ["str", "<string>"]], [["pp", "#include"], ["p", " "], ["str", "<regex>"]], [["pp", "#pragma"], ["p", " "], ["pp", "once"]], [], [["kw", "namespace"], ["p", " "], ["var", "dupre"], ["p", " "], ["punc", "{"]], [], [["kw", "template"], ["op", "<"], ["kw", "typename"], ["p", " "], ["ty", "T"], ["op", ">"], ["p", " "], ["kw", "class"], ["p", " "], ["ty", "Theme"], ["p", " "], ["punc", "{"]], [["kw", "public"], ["op", ":"]], [["p", " "], ["kw", "static"], ["p", " "], ["kw", "constexpr"], ["p", " "], ["ty", "int"], ["p", " "], ["con", "MAX"], ["p", " "], ["op", "="], ["p", " "], ["num", "0x20"], ["punc", ";"]], [["p", " "], ["ty", "std"], ["op", "::"], ["ty", "string"], ["p", " "], ["prop", "name_"], ["p", " "], ["op", "="], ["p", " "], ["str", "\"dupre\""], ["punc", ";"]], [], [["p", " "], ["dec", "[[nodiscard]]"], ["p", " "], ["ty", "T"], ["p", " "], ["fnd", "resolve"], ["punc", "("], ["kw", "const"], ["p", " "], ["ty", "std"], ["op", "::"], ["ty", "string"], ["op", "&"], ["p", " "], ["var", "key"], ["punc", ")"], ["p", " "], ["kw", "const"], ["p", " "], ["punc", "{"]], [["p", " "], ["cmd", "//"], ["cm", " validate against a hex pattern"]], [["p", " "], ["kw", "static"], ["p", " "], ["ty", "std"], ["op", "::"], ["ty", "regex"], ["p", " "], ["var", "re"], ["punc", "("], ["re", "R\"(#[0-9a-f]{6})\""], ["punc", ")"], ["punc", ";"]], [["p", " "], ["kw", "if"], ["p", " "], ["punc", "("], ["var", "key"], ["op", "."], ["fnc", "empty"], ["punc", "()"], ["punc", ")"], ["p", " "], ["kw", "return"], ["p", " "], ["con", "nullptr"], ["punc", ";"]], [["p", " "], ["kw", "return"], ["p", " "], ["ty", "T"], ["punc", "{"], ["var", "key"], ["punc", "}"], ["punc", ";"]], [["p", " "], ["punc", "}"]], [["punc", "}"], ["punc", ";"]], [], [["ty", "int"], ["p", " "], ["fnd", "main"], ["punc", "()"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "auto"], ["p", " "], ["var", "t"], ["p", " "], ["op", "="], ["p", " "], ["ty", "Theme"], ["op", "<"], ["ty", "int"], ["op", ">"], ["punc", "{}"], ["punc", ";"]], [["p", " "], ["bi", "static_cast"], ["op", "<"], ["ty", "int"], ["op", ">"], ["punc", "("], ["var", "t"], ["op", "."], ["prop", "name_"], ["op", "."], ["fnc", "size"], ["punc", "())"], ["punc", ";"]], [["p", " "], ["ty", "std"], ["op", "::"], ["fnc", "printf"], ["punc", "("], ["str", "\"%s"], ["esc", "\\n"], ["str", "\""], ["punc", ","], ["p", " "], ["var", "t"], ["op", "."], ["prop", "name_"], ["op", "."], ["fnc", "c_str"], ["punc", "())"], ["punc", ";"]], [["p", " "], ["kw", "return"], ["p", " "], ["num", "0"], ["punc", ";"]], [["punc", "}"]]], "Rust": [[["cmd", "//"], ["cm", " theme.rs"]], [["dec", "#![allow(dead_code)]"]], [["kw", "use"], ["p", " "], ["var", "std"], ["op", "::"], ["var", "fmt"], ["punc", ";"]], [], [["dec", "#[derive"], ["punc", "("], ["dec", "Debug"], ["punc", ","], ["p", " "], ["dec", "Clone"], ["punc", ")]"]], [["kw", "pub"], ["p", " "], ["kw", "trait"], ["p", " "], ["ty", "Theme"], ["op", "<"], ["var", "'a"], ["op", ">"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "const"], ["p", " "], ["con", "NAME"], ["op", ":"], ["p", " "], ["op", "&"], ["var", "'static"], ["p", " "], ["ty", "str"], ["punc", ";"]], [["p", " "], ["kw", "fn"], ["p", " "], ["fnd", "resolve"], ["punc", "("], ["op", "&"], ["var", "'a"], ["p", " "], ["var", "self"], ["punc", ","], ["p", " "], ["var", "key"], ["op", ":"], ["p", " "], ["op", "&"], ["var", "'a"], ["p", " "], ["ty", "str"], ["punc", ")"], ["p", " "], ["op", "->"], ["p", " "], ["ty", "Option"], ["op", "<"], ["op", "&"], ["var", "'a"], ["p", " "], ["ty", "str"], ["op", ">"], ["punc", ";"]], [["punc", "}"]], [], [["kw", "pub"], ["p", " "], ["kw", "struct"], ["p", " "], ["ty", "Palette"], ["op", "<"], ["var", "'a"], ["op", ">"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "pub"], ["p", " "], ["prop", "name"], ["op", ":"], ["p", " "], ["op", "&"], ["var", "'a"], ["p", " "], ["ty", "str"], ["punc", ","]], [["p", " "], ["kw", "pub"], ["p", " "], ["prop", "colors"], ["op", ":"], ["p", " "], ["ty", "Vec"], ["op", "<"], ["punc", "("], ["op", "&"], ["var", "'a"], ["p", " "], ["ty", "str"], ["punc", ","], ["p", " "], ["op", "&"], ["var", "'a"], ["p", " "], ["ty", "str"], ["punc", ")"], ["op", ">"], ["punc", ","]], [["punc", "}"]], [], [["kw", "impl"], ["op", "<"], ["var", "'a"], ["op", ">"], ["p", " "], ["ty", "Theme"], ["op", "<"], ["var", "'a"], ["op", ">"], ["p", " "], ["kw", "for"], ["p", " "], ["ty", "Palette"], ["op", "<"], ["var", "'a"], ["op", ">"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "const"], ["p", " "], ["con", "NAME"], ["op", ":"], ["p", " "], ["op", "&"], ["var", "'static"], ["p", " "], ["ty", "str"], ["p", " "], ["op", "="], ["p", " "], ["str", "\"dupre\""], ["punc", ";"]], [["p", " "], ["kw", "fn"], ["p", " "], ["fnd", "resolve"], ["punc", "("], ["op", "&"], ["var", "'a"], ["p", " "], ["var", "self"], ["punc", ","], ["p", " "], ["var", "key"], ["op", ":"], ["p", " "], ["op", "&"], ["var", "'a"], ["p", " "], ["ty", "str"], ["punc", ")"], ["p", " "], ["op", "->"], ["p", " "], ["ty", "Option"], ["op", "<"], ["op", "&"], ["var", "'a"], ["p", " "], ["ty", "str"], ["op", ">"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "if"], ["p", " "], ["var", "key"], ["op", "."], ["fnc", "is_empty"], ["punc", "()"], ["p", " "], ["punc", "{"], ["p", " "], ["kw", "return"], ["p", " "], ["con", "None"], ["punc", ";"], ["p", " "], ["punc", "}"]], [["p", " "], ["var", "self"], ["op", "."], ["prop", "colors"], ["op", "."], ["fnc", "iter"], ["punc", "()"], ["op", "."], ["fnc", "find"], ["punc", "("], ["op", "|"], ["punc", "("], ["var", "k"], ["punc", ","], ["p", " "], ["var", "_"], ["punc", ")"], ["op", "|"], ["p", " "], ["op", "*"], ["var", "k"], ["p", " "], ["op", "=="], ["p", " "], ["var", "key"], ["punc", ")"], ["op", "."], ["fnc", "map"], ["punc", "("], ["op", "|"], ["punc", "("], ["var", "_"], ["punc", ","], ["p", " "], ["var", "v"], ["punc", ")"], ["op", "|"], ["p", " "], ["op", "*"], ["var", "v"], ["punc", ")"]], [["p", " "], ["punc", "}"]], [["punc", "}"]], [], [["kw", "fn"], ["p", " "], ["fnd", "main"], ["punc", "()"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "let"], ["p", " "], ["var", "palette"], ["p", " "], ["op", "="], ["p", " "], ["ty", "Palette"], ["p", " "], ["punc", "{"], ["p", " "], ["prop", "name"], ["op", ":"], ["p", " "], ["str", "\"dupre\""], ["punc", ","], ["p", " "], ["prop", "colors"], ["op", ":"], ["p", " "], ["bi", "vec!"], ["punc", "["], ["punc", "("], ["str", "\"bg\""], ["punc", ","], ["p", " "], ["str", "\"#0d0b0a\""], ["punc", ")"], ["punc", "]"], ["p", " "], ["punc", "}"], ["punc", ";"]], [["p", " "], ["bi", "println!"], ["punc", "("], ["str", "\"{:?}\""], ["punc", ","], ["p", " "], ["var", "palette"], ["op", "."], ["fnc", "resolve"], ["punc", "("], ["str", "\"bg\""], ["punc", "))"], ["punc", ";"]], [["punc", "}"]]], "Zig": [[["cmd", "//"], ["cm", " theme.zig"]], [["kw", "const"], ["p", " "], ["var", "std"], ["p", " "], ["op", "="], ["p", " "], ["bi", "@import"], ["punc", "("], ["str", "\"std\""], ["punc", ")"], ["punc", ";"]], [["kw", "const"], ["p", " "], ["ty", "Allocator"], ["p", " "], ["op", "="], ["p", " "], ["var", "std"], ["op", "."], ["var", "mem"], ["op", "."], ["ty", "Allocator"], ["punc", ";"]], [], [["kw", "pub"], ["p", " "], ["kw", "const"], ["p", " "], ["ty", "Theme"], ["p", " "], ["op", "="], ["p", " "], ["kw", "struct"], ["p", " "], ["punc", "{"]], [["p", " "], ["prop", "name"], ["op", ":"], ["p", " "], ["punc", "["], ["punc", "]"], ["kw", "const"], ["p", " "], ["ty", "u8"], ["punc", ","]], [["p", " "], ["prop", "colors"], ["op", ":"], ["p", " "], ["punc", "["], ["punc", "]"], ["kw", "const"], ["p", " "], ["ty", "Color"], ["punc", ","]], [], [["p", " "], ["kw", "pub"], ["p", " "], ["kw", "fn"], ["p", " "], ["fnd", "init"], ["punc", "("], ["var", "alloc"], ["op", ":"], ["p", " "], ["op", "*"], ["ty", "Allocator"], ["punc", ")"], ["p", " "], ["op", "!"], ["bi", "@This"], ["punc", "()"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "const"], ["p", " "], ["var", "colors"], ["p", " "], ["op", "="], ["p", " "], ["kw", "try"], ["p", " "], ["var", "alloc"], ["op", "."], ["fnc", "alloc"], ["punc", "("], ["ty", "Color"], ["punc", ","], ["p", " "], ["num", "2"], ["punc", ")"], ["punc", ";"]], [["p", " "], ["var", "colors"], ["punc", "["], ["num", "0"], ["punc", "]"], ["p", " "], ["op", "="], ["p", " "], ["ty", "Color"], ["punc", "{"], ["p", " "], ["prop", ".name"], ["p", " "], ["op", "="], ["p", " "], ["str", "\"bg\""], ["punc", ","], ["p", " "], ["prop", ".hex"], ["p", " "], ["op", "="], ["p", " "], ["str", "\"#0d0b0a\""], ["p", " "], ["punc", "}"], ["punc", ";"]], [["p", " "], ["kw", "return"], ["p", " "], ["bi", "@This"], ["punc", "()"], ["punc", "{"], ["p", " "], ["prop", ".name"], ["p", " "], ["op", "="], ["p", " "], ["str", "\"dupre\""], ["punc", ","], ["p", " "], ["prop", ".colors"], ["p", " "], ["op", "="], ["p", " "], ["var", "colors"], ["p", " "], ["punc", "}"], ["punc", ";"]], [["p", " "], ["punc", "}"]], [["punc", "}"], ["punc", ";"]], [], [["kw", "const"], ["p", " "], ["ty", "Color"], ["p", " "], ["op", "="], ["p", " "], ["kw", "struct"], ["p", " "], ["punc", "{"], ["p", " "], ["prop", "name"], ["op", ":"], ["p", " "], ["punc", "["], ["punc", "]"], ["kw", "const"], ["p", " "], ["ty", "u8"], ["punc", ","], ["p", " "], ["prop", "hex"], ["op", ":"], ["p", " "], ["punc", "["], ["punc", "]"], ["kw", "const"], ["p", " "], ["ty", "u8"], ["p", " "], ["punc", "}"], ["punc", ";"]], [], [["kw", "fn"], ["p", " "], ["fnd", "resolve"], ["punc", "("], ["var", "theme"], ["op", ":"], ["p", " "], ["ty", "Theme"], ["punc", ","], ["p", " "], ["kw", "comptime"], ["p", " "], ["var", "key"], ["op", ":"], ["p", " "], ["punc", "["], ["punc", ":"], ["num", "0"], ["punc", "]"], ["kw", "const"], ["p", " "], ["ty", "u8"], ["punc", ")"], ["p", " "], ["op", "!"], ["punc", "["], ["punc", "]"], ["kw", "const"], ["p", " "], ["ty", "u8"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "inline"], ["p", " "], ["kw", "for"], ["p", " "], ["punc", "("], ["var", "theme"], ["op", "."], ["prop", "colors"], ["punc", ")"], ["p", " "], ["op", "|"], ["var", "color"], ["op", "|"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "if"], ["p", " "], ["punc", "("], ["var", "std"], ["op", "."], ["var", "mem"], ["op", "."], ["fnc", "eql"], ["punc", "("], ["ty", "u8"], ["punc", ","], ["p", " "], ["var", "color"], ["op", "."], ["prop", "name"], ["punc", ","], ["p", " "], ["var", "key"], ["punc", ")"], ["punc", ")"], ["p", " "], ["kw", "return"], ["p", " "], ["var", "color"], ["op", "."], ["prop", "hex"], ["punc", ";"]], [["p", " "], ["punc", "}"]], [["p", " "], ["kw", "return"], ["p", " "], ["con", "error.MissingColor"], ["punc", ";"]], [["punc", "}"]], [], [["kw", "test"], ["p", " "], ["str", "\"resolve bg\""], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "var"], ["p", " "], ["var", "arena"], ["p", " "], ["op", "="], ["p", " "], ["var", "std"], ["op", "."], ["var", "heap"], ["op", "."], ["ty", "ArenaAllocator"], ["op", "."], ["fnc", "init"], ["punc", "("], ["var", "std"], ["op", "."], ["var", "testing"], ["op", "."], ["prop", "allocator"], ["punc", ")"], ["punc", ";"]], [["p", " "], ["kw", "defer"], ["p", " "], ["var", "arena"], ["op", "."], ["fnc", "deinit"], ["punc", "()"], ["punc", ";"]], [["p", " "], ["kw", "try"], ["p", " "], ["var", "std"], ["op", "."], ["var", "testing"], ["op", "."], ["fnc", "expectEqualStrings"], ["punc", "("], ["str", "\"#0d0b0a\""], ["punc", ","], ["p", " "], ["kw", "try"], ["p", " "], ["fnc", "resolve"], ["punc", "("], ["kw", "try"], ["p", " "], ["ty", "Theme"], ["op", "."], ["fnc", "init"], ["punc", "("], ["op", "&"], ["var", "arena"], ["op", "."], ["prop", "allocator"], ["punc", ")"], ["punc", ","], ["p", " "], ["str", "\"bg\""], ["punc", "))"], ["punc", ";"]], [["punc", "}"]]], "Shell": [[["cmd", "#!"], ["cm", "/bin/bash"]], [["cmd", "#"], ["cm", " deploy.sh"]], [["bi", "set"], ["p", " "], ["op", "-"], ["var", "euo"], ["p", " "], ["var", "pipefail"]], [], [["var", "PORT"], ["op", "="], ["num", "8080"]], [["var", "NAME"], ["op", "="], ["str", "\"dupre\""]], [], [["fnd", "deploy"], ["punc", "()"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "local"], ["p", " "], ["var", "target"], ["op", "="], ["str", "\"$1\""]], [["p", " "], ["kw", "if"], ["p", " "], ["punc", "[["], ["p", " "], ["op", "-z"], ["p", " "], ["str", "\"$target\""], ["p", " "], ["punc", "]]"], ["punc", ";"], ["p", " "], ["kw", "then"]], [["p", " "], ["bi", "echo"], ["p", " "], ["str", "\"no target\""]], [["p", " "], ["kw", "return"], ["p", " "], ["num", "1"]], [["p", " "], ["kw", "fi"]], [["p", " "], ["fnc", "rsync"], ["p", " "], ["op", "-az"], ["p", " "], ["str", "\"$NAME\""], ["p", " "], ["str", "\"$target\""]], [["punc", "}"]], [], [["fnd", "main"], ["punc", "()"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "for"], ["p", " "], ["var", "host"], ["p", " "], ["kw", "in"], ["p", " "], ["str", "\"$@\""], ["punc", ";"], ["p", " "], ["kw", "do"]], [["p", " "], ["fnc", "deploy"], ["p", " "], ["str", "\"$host\""], ["p", " "], ["op", "||"], ["p", " "], ["bi", "exit"], ["p", " "], ["num", "1"]], [["p", " "], ["kw", "done"]], [["p", " "], ["bi", "echo"], ["p", " "], ["op", "-e"], ["p", " "], ["str", "\"all done"], ["esc", "\\n"], ["str", "\""]], [["punc", "}"]], [], [["fnc", "main"], ["p", " "], ["str", "\"$@\""]]], "Racket": [[["pp", "#lang"], ["p", " "], ["pp", "racket"]], [], [["cmd", ";;"], ["p", " "], ["cm", "Compute Fibonacci numbers with memoization"]], [["punc", "("], ["kw", "require"], ["p", " "], ["var", "racket/list"], ["punc", ")"]], [], [["punc", "("], ["kw", "define"], ["p", " "], ["punc", "("], ["fnd", "fib"], ["p", " "], ["var", "n"], ["punc", ")"]], [["p", " "], ["punc", "("], ["kw", "cond"], ["p", " "]], [["p", " "], ["punc", "[("], ["bi", "<"], ["p", " "], ["var", "n"], ["p", " "], ["num", "2"], ["punc", ")"], ["p", " "], ["var", "n"], ["punc", "]"]], [["p", " "], ["punc", "["], ["con", "else"], ["p", " "]], [["p", " "], ["punc", "("], ["bi", "+"], ["p", " "], ["punc", "("], ["fnc", "fib"], ["p", " "], ["punc", "("], ["bi", "-"], ["p", " "], ["var", "n"], ["p", " "], ["num", "1"], ["punc", "))"], ["p", " "]], [["p", " "], ["punc", "("], ["fnc", "fib"], ["p", " "], ["punc", "("], ["bi", "-"], ["p", " "], ["var", "n"], ["p", " "], ["num", "2"], ["punc", ")))])]"]], [], [["cmd", ";;"], ["p", " "], ["cm", "A point struct with two fields"]], [["punc", "("], ["kw", "struct"], ["p", " "], ["ty", "point"], ["p", " "], ["punc", "("], ["prop", "x"], ["p", " "], ["prop", "y"], ["punc", ")"], ["p", " "], ["con", "#:transparent"], ["punc", ")"]], [], [["punc", "("], ["kw", "define"], ["p", " "], ["var", "origin"], ["p", " "], ["punc", "("], ["fnc", "point"], ["p", " "], ["num", "0"], ["p", " "], ["num", "0"], ["punc", "))"]], [], [["punc", "("], ["kw", "define"], ["p", " "], ["var", "nums"], ["p", " "], ["punc", "("], ["kw", "quote"], ["p", " "], ["punc", "("], ["num", "1"], ["p", " "], ["num", "2"], ["p", " "], ["num", "3"], ["p", " "], ["num", "4"], ["p", " "], ["num", "5"], ["punc", "))"]], [], [["punc", "("], ["kw", "define"], ["p", " "], ["var", "squared"], ["p", " "]], [["p", " "], ["punc", "("], ["bi", "map"], ["p", " "], ["punc", "("], ["kw", "lambda"], ["p", " "], ["punc", "("], ["var", "x"], ["punc", ")"], ["p", " "], ["punc", "("], ["bi", "*"], ["p", " "], ["var", "x"], ["p", " "], ["var", "x"], ["punc", "))"], ["p", " "], ["var", "nums"], ["punc", "))"]], [], [["punc", "("], ["bi", "printf"], ["p", " "], ["str", "\"squares: ~a\\n\""], ["p", " "], ["var", "squared"], ["punc", ")"]], [["punc", "("], ["bi", "displayln"], ["p", " "], ["punc", "("], ["fnc", "first"], ["p", " "], ["var", "squared"], ["punc", "))"]]], "Scheme": [[["cmd", ";;"], ["p", " "], ["cm", "Tail-recursive factorial in Scheme"]], [], [["punc", "("], ["kw", "define"], ["p", " "], ["punc", "("], ["fnd", "factorial"], ["p", " "], ["var", "n"], ["punc", ")"]], [["p", " "], ["punc", "("], ["kw", "let"], ["p", " "], ["fnd", "loop"], ["p", " "], ["punc", "(["], ["var", "acc"], ["p", " "], ["num", "1"], ["punc", "]"], ["p", " "], ["punc", "["], ["var", "i"], ["p", " "], ["var", "n"], ["punc", "])"]], [["p", " "], ["punc", "("], ["kw", "if"], ["p", " "], ["punc", "("], ["bi", "="], ["p", " "], ["var", "i"], ["p", " "], ["num", "0"], ["punc", ")"]], [["p", " "], ["var", "acc"], ["p", " "]], [["p", " "], ["punc", "("], ["fnc", "loop"], ["p", " "], ["punc", "("], ["bi", "*"], ["p", " "], ["var", "acc"], ["p", " "], ["var", "i"], ["punc", ")"], ["p", " "], ["punc", "("], ["bi", "-"], ["p", " "], ["var", "i"], ["p", " "], ["num", "1"], ["punc", "))))"]], [], [["cmd", ";;"], ["p", " "], ["cm", "Higher-order map over a quoted list"]], [["punc", "("], ["kw", "define"], ["p", " "], ["var", "primes"], ["p", " "], ["punc", "("], ["kw", "quote"], ["p", " "], ["punc", "("], ["num", "2"], ["p", " "], ["num", "3"], ["p", " "], ["num", "5"], ["p", " "], ["num", "7"], ["p", " "], ["num", "11"], ["punc", "))"]], [], [["punc", "("], ["kw", "define"], ["p", " "], ["punc", "("], ["fnd", "double"], ["p", " "], ["var", "x"], ["punc", ")"]], [["p", " "], ["punc", "("], ["bi", "*"], ["p", " "], ["var", "x"], ["p", " "], ["num", "2"], ["punc", ")"]], [], [["punc", "("], ["kw", "define"], ["p", " "], ["var", "doubled"], ["p", " "], ["punc", "("], ["bi", "map"], ["p", " "], ["var", "double"], ["p", " "], ["var", "primes"], ["punc", "))"]], [], [["cmd", ";;"], ["p", " "], ["cm", "Predicate using cond and recursion"]], [["punc", "("], ["kw", "define"], ["p", " "], ["punc", "("], ["fnd", "member?"], ["p", " "], ["var", "x"], ["p", " "], ["var", "lst"], ["punc", ")"]], [["p", " "], ["punc", "("], ["kw", "cond"], ["p", " "]], [["p", " "], ["punc", "[("], ["bi", "null?"], ["p", " "], ["var", "lst"], ["punc", ")"], ["p", " "], ["con", "#f"], ["punc", "]"]], [["p", " "], ["punc", "[("], ["bi", "equal?"], ["p", " "], ["punc", "("], ["bi", "car"], ["p", " "], ["var", "lst"], ["punc", ")"], ["p", " "], ["var", "x"], ["punc", ")"], ["p", " "], ["con", "#t"], ["punc", "]"]], [["p", " "], ["punc", "["], ["con", "else"], ["p", " "], ["punc", "("], ["fnc", "member?"], ["p", " "], ["var", "x"], ["p", " "], ["punc", "("], ["bi", "cdr"], ["p", " "], ["var", "lst"], ["punc", "))]"], ["punc", ")"]], [], [["punc", "("], ["bi", "display"], ["p", " "], ["punc", "("], ["fnc", "member?"], ["p", " "], ["num", "5"], ["p", " "], ["var", "primes"], ["punc", "))"]], [["punc", "("], ["bi", "newline"], ["punc", ")"]]], "Haskell": [[["cmd", "-- |"], ["cm", " Compute statistics over a stream of samples."]], [["pp", "{-# LANGUAGE ScopedTypeVariables #-}"]], [["kw", "module"], ["p", " "], ["ty", "Stats"], ["p", " "], ["punc", "("], ["var", "mean"], ["punc", ","], ["p", " "], ["var", "variance"], ["punc", ")"], ["p", " "], ["kw", "where"]], [], [["kw", "import"], ["p", " "], ["kw", "qualified"], ["p", " "], ["ty", "Data.List"], ["p", " "], ["kw", "as"], ["p", " "], ["ty", "L"]], [], [["cmd", "-- |"], ["cm", " A labelled measurement."]], [["kw", "data"], ["p", " "], ["ty", "Sample"], ["p", " "], ["op", "="], ["p", " "], ["ty", "Sample"]], [["p", " "], ["p", " "], ["punc", "{"], ["p", " "], ["prop", "label"], ["p", " "], ["op", "::"], ["p", " "], ["ty", "String"]], [["p", " "], ["p", " "], ["punc", ","], ["p", " "], ["prop", "value"], ["p", " "], ["op", "::"], ["p", " "], ["ty", "Double"]], [["p", " "], ["p", " "], ["punc", "}"], ["p", " "], ["kw", "deriving"], ["p", " "], ["punc", "("], ["ty", "Show"], ["punc", ","], ["p", " "], ["ty", "Eq"], ["punc", ")"]], [], [["cmd", "-- |"], ["cm", " Arithmetic mean; returns 0 for an empty list."]], [["fnd", "mean"], ["p", " "], ["op", "::"], ["p", " "], ["punc", "["], ["ty", "Double"], ["punc", "]"], ["p", " "], ["op", "->"], ["p", " "], ["ty", "Double"]], [["fnd", "mean"], ["p", " "], ["con", "[]"], ["p", " "], ["op", "="], ["p", " "], ["num", "0"]], [["fnd", "mean"], ["p", " "], ["var", "xs"], ["p", " "], ["op", "="], ["p", " "], ["fnc", "sum"], ["p", " "], ["var", "xs"], ["p", " "], ["op", "/"], ["p", " "], ["fnc", "fromIntegral"], ["p", " "], ["punc", "("], ["fnc", "length"], ["p", " "], ["var", "xs"], ["punc", ")"]], [], [["fnd", "variance"], ["p", " "], ["op", "::"], ["p", " "], ["punc", "["], ["ty", "Double"], ["punc", "]"], ["p", " "], ["op", "->"], ["p", " "], ["ty", "Double"]], [["fnd", "variance"], ["p", " "], ["var", "xs"], ["p", " "], ["op", "="], ["p", " "], ["kw", "let"], ["p", " "], ["var", "m"], ["p", " "], ["op", "="], ["p", " "], ["fnc", "mean"], ["p", " "], ["var", "xs"]], [["p", " "], ["kw", "in"], ["p", " "], ["fnc", "mean"], ["p", " "], ["punc", "["], ["p", " "], ["punc", "("], ["var", "x"], ["p", " "], ["op", "-"], ["p", " "], ["var", "m"], ["punc", ")"], ["p", " "], ["op", "^"], ["p", " "], ["num", "2"], ["p", " "], ["op", "|"], ["p", " "], ["var", "x"], ["p", " "], ["op", "<-"], ["p", " "], ["var", "xs"], ["p", " "], ["punc", "]"]], [], [["cmd", "-- |"], ["cm", " Demo entry point."]], [["fnd", "main"], ["p", " "], ["op", "::"], ["p", " "], ["ty", "IO"], ["p", " "], ["punc", "("], ["punc", ")"]], [["fnd", "main"], ["p", " "], ["op", "="], ["p", " "], ["kw", "do"]], [["p", " "], ["kw", "let"], ["p", " "], ["var", "samples"], ["p", " "], ["op", "="], ["p", " "], ["punc", "["], ["num", "1.0"], ["punc", ","], ["p", " "], ["num", "2.5"], ["punc", ","], ["p", " "], ["num", "3.5"], ["punc", "]"]], [["p", " "], ["fnc", "putStrLn"], ["p", " "], ["punc", "("], ["str", "\"mean = \""], ["p", " "], ["op", "++"], ["p", " "], ["fnc", "show"], ["p", " "], ["punc", "("], ["fnc", "mean"], ["p", " "], ["var", "samples"], ["punc", "))"]]], "OCaml": [[["cmd", "(*"], ["cm", " Simple expression evaluator with variant types. "], ["cmd", "*)"]], [], [["kw", "type"], ["p", " "], ["ty", "expr"], ["p", " "], ["op", "="]], [["p", " "], ["p", " "], ["op", "|"], ["p", " "], ["ty", "Num"], ["p", " "], ["kw", "of"], ["p", " "], ["ty", "float"]], [["p", " "], ["p", " "], ["op", "|"], ["p", " "], ["ty", "Var"], ["p", " "], ["kw", "of"], ["p", " "], ["ty", "string"]], [["p", " "], ["p", " "], ["op", "|"], ["p", " "], ["ty", "Add"], ["p", " "], ["kw", "of"], ["p", " "], ["ty", "expr"], ["p", " "], ["op", "*"], ["p", " "], ["ty", "expr"]], [["p", " "], ["p", " "], ["op", "|"], ["p", " "], ["ty", "Mul"], ["p", " "], ["kw", "of"], ["p", " "], ["ty", "expr"], ["p", " "], ["op", "*"], ["p", " "], ["ty", "expr"]], [], [["cmd", "(**"], ["cm", " Evaluate [e] under environment [env]. "], ["cmd", "*)"]], [["kw", "let"], ["p", " "], ["kw", "rec"], ["p", " "], ["fnd", "eval"], ["p", " "], ["var", "env"], ["p", " "], ["var", "e"], ["p", " "], ["op", "="]], [["p", " "], ["kw", "match"], ["p", " "], ["var", "e"], ["p", " "], ["kw", "with"]], [["p", " "], ["op", "|"], ["p", " "], ["ty", "Num"], ["p", " "], ["var", "n"], ["p", " "], ["op", "->"], ["p", " "], ["var", "n"]], [["p", " "], ["op", "|"], ["p", " "], ["ty", "Var"], ["p", " "], ["var", "x"], ["p", " "], ["op", "->"], ["p", " "], ["ty", "List"], ["punc", "."], ["fnc", "assoc"], ["p", " "], ["var", "x"], ["p", " "], ["var", "env"]], [["p", " "], ["op", "|"], ["p", " "], ["ty", "Add"], ["p", " "], ["punc", "("], ["var", "a"], ["punc", ","], ["p", " "], ["var", "b"], ["punc", ")"], ["p", " "], ["op", "->"], ["p", " "], ["fnc", "eval"], ["p", " "], ["var", "env"], ["p", " "], ["var", "a"], ["p", " "], ["op", "+."], ["p", " "], ["fnc", "eval"], ["p", " "], ["var", "env"], ["p", " "], ["var", "b"]], [["p", " "], ["op", "|"], ["p", " "], ["ty", "Mul"], ["p", " "], ["punc", "("], ["var", "a"], ["punc", ","], ["p", " "], ["var", "b"], ["punc", ")"], ["p", " "], ["op", "->"], ["p", " "], ["fnc", "eval"], ["p", " "], ["var", "env"], ["p", " "], ["var", "a"], ["p", " "], ["op", "*."], ["p", " "], ["fnc", "eval"], ["p", " "], ["var", "env"], ["p", " "], ["var", "b"]], [], [["kw", "let"], ["p", " "], ["punc", "()"], ["p", " "], ["op", "="], ["p", " "], ["kw", "let"], ["p", " "], ["var", "env"], ["p", " "], ["op", "="], ["p", " "], ["punc", "["], ["p", " "], ["punc", "("], ["str", "\"x\""], ["punc", ","], ["p", " "], ["num", "3.0"], ["punc", ")"], ["p", " "], ["punc", "]"], ["p", " "], ["kw", "in"]], [["p", " "], ["kw", "let"], ["p", " "], ["var", "e"], ["p", " "], ["op", "="], ["p", " "], ["ty", "Add"], ["p", " "], ["punc", "("], ["ty", "Var"], ["p", " "], ["str", "\"x\""], ["punc", ","], ["p", " "], ["ty", "Num"], ["p", " "], ["num", "4.0"], ["punc", ")"], ["p", " "], ["kw", "in"]], [["p", " "], ["ty", "Printf"], ["punc", "."], ["fnc", "printf"], ["p", " "], ["str", "\"result = %g\\n\""], ["p", " "], ["punc", "("], ["fnc", "eval"], ["p", " "], ["var", "env"], ["p", " "], ["var", "e"], ["punc", ")"]]], "Scala": [[["cmd", "//"], ["cm", " Geometry helpers for 2D shapes"]], [["kw", "package"], ["p", " "], ["var", "geometry"]], [], [["kw", "import"], ["p", " "], ["var", "scala"], ["op", "."], ["var", "math"], ["op", "."], ["fnc", "sqrt"]], [], [["dec", "@inline"], ["p", " "], ["kw", "final"], ["p", " "], ["kw", "case"], ["p", " "], ["kw", "class"], ["p", " "], ["ty", "Point"], ["punc", "("], ["kw", "val"], ["p", " "], ["prop", "x"], ["op", ":"], ["p", " "], ["ty", "Double"], ["punc", ","], ["p", " "], ["kw", "val"], ["p", " "], ["prop", "y"], ["op", ":"], ["p", " "], ["ty", "Double"], ["punc", ")"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "def"], ["p", " "], ["fnd", "distanceTo"], ["punc", "("], ["var", "that"], ["op", ":"], ["p", " "], ["ty", "Point"], ["punc", ")"], ["op", ":"], ["p", " "], ["ty", "Double"], ["p", " "], ["op", "="], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "val"], ["p", " "], ["var", "dx"], ["p", " "], ["op", "="], ["p", " "], ["var", "x"], ["p", " "], ["op", "-"], ["p", " "], ["var", "that"], ["op", "."], ["prop", "x"]], [["p", " "], ["kw", "val"], ["p", " "], ["var", "dy"], ["p", " "], ["op", "="], ["p", " "], ["var", "y"], ["p", " "], ["op", "-"], ["p", " "], ["var", "that"], ["op", "."], ["prop", "y"]], [["p", " "], ["fnc", "sqrt"], ["punc", "("], ["var", "dx"], ["p", " "], ["op", "*"], ["p", " "], ["var", "dx"], ["p", " "], ["op", "+"], ["p", " "], ["var", "dy"], ["p", " "], ["op", "*"], ["p", " "], ["var", "dy"], ["punc", ")"]], [["p", " "], ["punc", "}"]], [["punc", "}"]], [], [["kw", "object"], ["p", " "], ["ty", "Geometry"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "val"], ["p", " "], ["var", "origin"], ["p", " "], ["op", "="], ["p", " "], ["ty", "Point"], ["punc", "("], ["num", "0.0"], ["punc", ","], ["p", " "], ["num", "0.0"], ["punc", ")"]], [["p", " "], ["kw", "val"], ["p", " "], ["var", "pts"], ["p", " "], ["op", "="], ["p", " "], ["ty", "List"], ["punc", "("], ["ty", "Point"], ["punc", "("], ["num", "3.0"], ["punc", ","], ["p", " "], ["num", "4.0"], ["punc", "),"], ["p", " "], ["ty", "Point"], ["punc", "("], ["num", "1.0"], ["punc", ","], ["p", " "], ["num", "2.0"], ["punc", "))"]], [["p", " "], ["kw", "val"], ["p", " "], ["var", "dists"], ["p", " "], ["op", "="], ["p", " "], ["kw", "for"], ["p", " "], ["punc", "("], ["var", "p"], ["p", " "], ["op", "<-"], ["p", " "], ["var", "pts"], ["punc", ")"], ["p", " "], ["kw", "yield"], ["p", " "], ["var", "origin"], ["op", "."], ["fnc", "distanceTo"], ["punc", "("], ["var", "p"], ["punc", ")"]], [], [["p", " "], ["kw", "def"], ["p", " "], ["fnd", "main"], ["punc", "("], ["var", "args"], ["op", ":"], ["p", " "], ["ty", "Array"], ["punc", "["], ["ty", "String"], ["punc", "]"], ["punc", ")"], ["op", ":"], ["p", " "], ["ty", "Unit"], ["p", " "], ["op", "="], ["p", " "], ["punc", "{"]], [["p", " "], ["var", "dists"], ["op", "."], ["fnc", "foreach"], ["punc", "("], ["var", "d"], ["p", " "], ["op", "=>"], ["p", " "], ["fnc", "println"], ["punc", "("], ["str", "s\"dist = $d\""], ["punc", ")"], ["punc", ")"]], [["p", " "], ["kw", "val"], ["p", " "], ["var", "ok"], ["p", " "], ["op", "="], ["p", " "], ["var", "dists"], ["op", "."], ["fnc", "nonEmpty"], ["p", " "], ["op", "&&"], ["p", " "], ["con", "true"]], [["p", " "], ["punc", "}"]], [["punc", "}"]]], "Kotlin": [[["cmd", "//"], ["cm", " User repository with a simple cache"]], [["kw", "package"], ["p", " "], ["var", "com"], ["op", "."], ["var", "example"], ["op", "."], ["var", "data"]], [], [["kw", "import"], ["p", " "], ["var", "kotlin"], ["op", "."], ["var", "collections"], ["op", "."], ["var", "mutableMapOf"]], [], [["kw", "data"], ["p", " "], ["kw", "class"], ["p", " "], ["ty", "User"], ["punc", "("], ["kw", "val"], ["p", " "], ["prop", "id"], ["op", ":"], ["p", " "], ["ty", "Int"], ["punc", ","], ["p", " "], ["kw", "val"], ["p", " "], ["prop", "name"], ["op", ":"], ["p", " "], ["ty", "String"], ["punc", ")"]], [], [["kw", "class"], ["p", " "], ["ty", "UserRepo"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "private"], ["p", " "], ["kw", "val"], ["p", " "], ["var", "cache"], ["p", " "], ["op", "="], ["p", " "], ["bi", "mutableMapOf"], ["punc", "<"], ["ty", "Int"], ["punc", ","], ["p", " "], ["ty", "User"], ["punc", ">"], ["punc", "()"]], [], [["p", " "], ["dec", "@JvmStatic"], ["p", " "]], [["p", " "], ["kw", "fun"], ["p", " "], ["fnd", "findById"], ["punc", "("], ["var", "id"], ["op", ":"], ["p", " "], ["ty", "Int"], ["punc", ")"], ["op", ":"], ["p", " "], ["ty", "User"], ["op", "?"], ["p", " "], ["op", "="], ["p", " "], ["var", "cache"], ["punc", "["], ["var", "id"], ["punc", "]"]], [], [["p", " "], ["kw", "fun"], ["p", " "], ["fnd", "save"], ["punc", "("], ["var", "user"], ["op", ":"], ["p", " "], ["ty", "User"], ["punc", ")"], ["p", " "], ["punc", "{"]], [["p", " "], ["var", "cache"], ["punc", "["], ["var", "user"], ["op", "."], ["prop", "id"], ["punc", "]"], ["p", " "], ["op", "="], ["p", " "], ["var", "user"]], [["p", " "], ["bi", "println"], ["punc", "("], ["str", "\"saved "], ["esc", "\\n"], ["str", "\""], ["p", " "], ["op", "+"], ["p", " "], ["var", "user"], ["op", "."], ["prop", "name"], ["punc", ")"]], [["p", " "], ["punc", "}"]], [["punc", "}"]], [], [["kw", "fun"], ["p", " "], ["fnd", "main"], ["punc", "()"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "val"], ["p", " "], ["var", "repo"], ["p", " "], ["op", "="], ["p", " "], ["ty", "UserRepo"], ["punc", "()"]], [["p", " "], ["var", "repo"], ["op", "."], ["fnc", "save"], ["punc", "("], ["ty", "User"], ["punc", "("], ["num", "1"], ["punc", ","], ["p", " "], ["str", "\"Ada\""], ["punc", "))"]], [["p", " "], ["kw", "val"], ["p", " "], ["var", "found"], ["p", " "], ["op", "="], ["p", " "], ["var", "repo"], ["op", "."], ["fnc", "findById"], ["punc", "("], ["num", "1"], ["punc", ")"], ["p", " "], ["op", "?:"], ["p", " "], ["kw", "return"]], [["p", " "], ["bi", "println"], ["punc", "("], ["var", "found"], ["punc", ")"]], [["punc", "}"]]], "Swift": [[["cmd", "//"], ["cm", " Account model with balance guard"]], [["kw", "import"], ["p", " "], ["ty", "Foundation"]], [], [["dec", "@frozen"], ["p", " "]], [["kw", "struct"], ["p", " "], ["ty", "Account"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "let"], ["p", " "], ["prop", "id"], ["op", ":"], ["p", " "], ["ty", "Int"]], [["p", " "], ["kw", "var"], ["p", " "], ["prop", "balance"], ["op", ":"], ["p", " "], ["ty", "Double"], ["p", " "], ["op", "="], ["p", " "], ["num", "0.0"]], [], [["p", " "], ["kw", "func"], ["p", " "], ["fnd", "withdraw"], ["punc", "("], ["var", "amount"], ["op", ":"], ["p", " "], ["ty", "Double"], ["punc", ")"], ["p", " "], ["op", "->"], ["p", " "], ["ty", "Bool"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "guard"], ["p", " "], ["var", "amount"], ["p", " "], ["op", "<="], ["p", " "], ["prop", "balance"], ["p", " "], ["kw", "else"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "return"], ["p", " "], ["con", "false"]], [["p", " "], ["punc", "}"]], [["p", " "], ["prop", "balance"], ["p", " "], ["op", "-="], ["p", " "], ["var", "amount"]], [["p", " "], ["kw", "return"], ["p", " "], ["con", "true"]], [["p", " "], ["punc", "}"]], [["punc", "}"]], [], [["kw", "let"], ["p", " "], ["var", "acct"], ["p", " "], ["op", "="], ["p", " "], ["ty", "Account"], ["punc", "("], ["var", "id"], ["op", ":"], ["p", " "], ["num", "7"], ["punc", ","], ["p", " "], ["var", "balance"], ["op", ":"], ["p", " "], ["num", "100.0"], ["punc", ")"]], [["kw", "var"], ["p", " "], ["var", "copy"], ["p", " "], ["op", "="], ["p", " "], ["var", "acct"]], [["kw", "let"], ["p", " "], ["var", "ok"], ["p", " "], ["op", "="], ["p", " "], ["var", "copy"], ["op", "."], ["fnc", "withdraw"], ["punc", "("], ["var", "amount"], ["op", ":"], ["p", " "], ["num", "30.0"], ["punc", ")"]], [["bi", "print"], ["punc", "("], ["str", "\"acct ok=\""], ["punc", ","], ["p", " "], ["var", "ok"], ["punc", ")"]]], "Lua": [[["cmd", "--"], ["cm", " Account module: balances and transfers"]], [["kw", "local"], ["p", " "], ["ty", "Account"], ["op", "="], ["punc", "{}"]], [["ty", "Account"], ["punc", "."], ["prop", "__index"], ["op", "="], ["ty", "Account"]], [], [["kw", "local"], ["p", " "], ["var", "rates"], ["op", "="], ["p", " "], ["punc", "{"], ["str", "\"usd\""], ["op", "="], ["num", "1.0"], ["punc", ","], ["p", " "], ["str", "\"eur\""], ["op", "="], ["num", "0.92"], ["punc", "}"]], [], [["kw", "function"], ["p", " "], ["ty", "Account"], ["op", "."], ["fnd", "new"], ["punc", "("], ["var", "name"], ["punc", ","], ["p", " "], ["var", "balance"], ["punc", ")"]], [["p", " "], ["kw", "local"], ["p", " "], ["var", "self"], ["op", "="], ["p", " "], ["fnc", "setmetatable"], ["punc", "("], ["punc", "{}"], ["punc", ","], ["p", " "], ["ty", "Account"], ["punc", ")"]], [["p", " "], ["var", "self"], ["punc", "."], ["prop", "name"], ["op", "="], ["var", "name"]], [["p", " "], ["var", "self"], ["punc", "."], ["prop", "balance"], ["op", "="], ["p", " "], ["var", "balance"], ["p", " "], ["kw", "or"], ["p", " "], ["num", "0"]], [["p", " "], ["kw", "return"], ["p", " "], ["var", "self"]], [["kw", "end"]], [], [["kw", "function"], ["p", " "], ["ty", "Account"], ["op", ":"], ["fnd", "report"], ["punc", "()"]], [["p", " "], ["kw", "for"], ["p", " "], ["var", "code"], ["punc", ","], ["p", " "], ["var", "rate"], ["p", " "], ["kw", "in"], ["p", " "], ["bi", "pairs"], ["punc", "("], ["var", "rates"], ["punc", ")"], ["p", " "], ["kw", "do"]], [["p", " "], ["bi", "print"], ["punc", "("], ["var", "code"], ["punc", ","], ["p", " "], ["var", "self"], ["punc", "."], ["prop", "balance"], ["p", " "], ["op", "*"], ["p", " "], ["var", "rate"], ["punc", ")"]], [["p", " "], ["kw", "end"]], [["p", " "], ["kw", "if"], ["p", " "], ["var", "self"], ["punc", "."], ["prop", "balance"], ["p", " "], ["op", "=="], ["p", " "], ["num", "0"], ["p", " "], ["kw", "then"]], [["p", " "], ["kw", "return"], ["p", " "], ["con", "nil"]], [["p", " "], ["kw", "end"]], [["p", " "], ["kw", "return"], ["p", " "], ["con", "true"]], [["kw", "end"]]], "Ruby": [[["cmd", "#"], ["cm", " Inventory tracker with tagged items"]], [["kw", "class"], ["p", " "], ["ty", "Inventory"]], [["p", " "], ["kw", "def"], ["p", " "], ["fnd", "initialize"], ["punc", "("], ["var", "items"], ["p", " "], ["op", "="], ["p", " "], ["punc", "[]"], ["punc", ")"]], [["p", " "], ["var", "@items"], ["p", " "], ["op", "="], ["p", " "], ["var", "items"]], [["p", " "], ["var", "@tags"], ["p", " "], ["op", "="], ["p", " "], ["punc", "{"], ["prop", "sku:"], ["p", " "], ["con", "nil"], ["punc", "}"]], [["p", " "], ["kw", "end"]], [], [["p", " "], ["kw", "def"], ["p", " "], ["fnd", "add"], ["punc", "("], ["var", "name"], ["punc", ","], ["p", " "], ["var", "price"], ["punc", ")"]], [["p", " "], ["kw", "return"], ["p", " "], ["con", "false"], ["p", " "], ["kw", "unless"], ["p", " "], ["var", "name"], ["p", " "], ["op", "=~"], ["p", " "], ["re", "/\\A\\w+\\z/"]], [["p", " "], ["var", "@items"], ["p", " "], ["op", "<<"], ["p", " "], ["punc", "{"], ["p", " "], ["prop", "name:"], ["p", " "], ["var", "name"], ["punc", ","], ["p", " "], ["prop", "price:"], ["p", " "], ["var", "price"], ["p", " "], ["punc", "}"]], [["p", " "], ["kw", "end"]], [], [["p", " "], ["kw", "def"], ["p", " "], ["fnd", "total"], ["punc", "("], ["var", "tax"], ["p", " "], ["op", "="], ["p", " "], ["num", "0.08"], ["punc", ")"]], [["p", " "], ["var", "sum"], ["p", " "], ["op", "="], ["p", " "], ["num", "0"]], [["p", " "], ["var", "@items"], ["punc", "."], ["fnc", "each"], ["p", " "], ["kw", "do"], ["p", " "], ["punc", "|"], ["var", "item"], ["punc", "|"]], [["p", " "], ["var", "sum"], ["p", " "], ["op", "+="], ["p", " "], ["var", "item"], ["punc", "["], ["prop", ":price"], ["punc", "]"]], [["p", " "], ["kw", "end"]], [["p", " "], ["bi", "printf"], ["punc", "("], ["str", "\"total: %.2f\\n\""], ["punc", ","], ["p", " "], ["var", "sum"], ["p", " "], ["op", "*"], ["p", " "], ["punc", "("], ["num", "1"], ["p", " "], ["op", "+"], ["p", " "], ["var", "tax"], ["punc", "))"]], [["p", " "], ["kw", "end"]], [["kw", "end"]]], "Perl": [[["cmd", "#"], ["cm", "!/usr/bin/perl"]], [["kw", "use"], ["p", " "], ["pp", "strict"], ["punc", ";"]], [["kw", "use"], ["p", " "], ["pp", "warnings"], ["punc", ";"]], [], [["cmd", "#"], ["cm", " Parse a config line into a hash"]], [["kw", "sub"], ["p", " "], ["fnd", "parse_config"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "my"], ["p", " "], ["punc", "("], ["var", "$line"], ["punc", ")"], ["p", " "], ["op", "="], ["p", " "], ["var", "@_"], ["punc", ";"]], [["p", " "], ["kw", "my"], ["p", " "], ["var", "%conf"], ["p", " "], ["op", "="], ["p", " "], ["punc", "()"], ["punc", ";"]], [], [["p", " "], ["kw", "if"], ["p", " "], ["punc", "("], ["var", "$line"], ["p", " "], ["op", "=~"], ["p", " "], ["re", "/^(\\w+)\\s*=\\s*(.+)$/"], ["punc", ")"], ["p", " "], ["punc", "{"]], [["p", " "], ["var", "$conf"], ["punc", "{"], ["var", "$1"], ["punc", "}"], ["p", " "], ["op", "="], ["p", " "], ["var", "$2"], ["punc", ";"]], [["p", " "], ["punc", "}"]], [], [["p", " "], ["kw", "return"], ["p", " "], ["op", "\\"], ["var", "%conf"], ["punc", ";"]], [["punc", "}"]], [], [["kw", "my"], ["p", " "], ["var", "$ref"], ["p", " "], ["op", "="], ["p", " "], ["fnc", "parse_config"], ["punc", "("], ["str", "\"host = localhost\""], ["punc", ")"], ["punc", ";"]], [["kw", "my"], ["p", " "], ["var", "@keys"], ["p", " "], ["op", "="], ["p", " "], ["bi", "keys"], ["p", " "], ["var", "%$ref"], ["punc", ";"]], [["bi", "print"], ["p", " "], ["var", "@keys"], ["punc", ";"]]], "R": [[["cmd", "#"], ["cm", " Summarize sales by region and fit a model"]], [["var", "library"], ["punc", "("], ["bi", "dplyr"], ["punc", ")"]], [], [["var", "sales"], ["p", " "], ["op", "<-"], ["p", " "], ["fnc", "read.csv"], ["punc", "("], ["str", "\"sales.csv\""], ["punc", ","], ["p", " "], ["prop", "stringsAsFactors"], ["p", " "], ["op", "="], ["p", " "], ["con", "FALSE"], ["punc", ")"]], [["var", "regions"], ["p", " "], ["op", "<-"], ["p", " "], ["bi", "c"], ["punc", "("], ["str", "\"North\""], ["punc", ","], ["p", " "], ["str", "\"South\""], ["punc", ","], ["p", " "], ["str", "\"East\""], ["punc", ","], ["p", " "], ["str", "\"West\""], ["punc", ")"]], [], [["cmd", "#"], ["cm", " Compute mean revenue per region"]], [["fnd", "summarize_region"], ["p", " "], ["op", "<-"], ["p", " "], ["kw", "function"], ["punc", "("], ["var", "df"], ["punc", ","], ["p", " "], ["var", "reg"], ["punc", ")"], ["p", " "], ["punc", "{"]], [["p", " "], ["var", "subset"], ["p", " "], ["op", "<-"], ["p", " "], ["var", "df"], ["punc", "["], ["var", "df"], ["op", "$"], ["prop", "region"], ["p", " "], ["op", "=="], ["p", " "], ["var", "reg"], ["punc", ","], ["p", " "], ["punc", "]"]], [["p", " "], ["kw", "if"], ["p", " "], ["punc", "("], ["fnc", "nrow"], ["punc", "("], ["var", "subset"], ["punc", ")"], ["p", " "], ["op", "=="], ["p", " "], ["num", "0"], ["punc", ")"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "return"], ["punc", "("], ["con", "NA"], ["punc", ")"]], [["p", " "], ["punc", "}"]], [["p", " "], ["fnc", "mean"], ["punc", "("], ["var", "subset"], ["op", "$"], ["prop", "revenue"], ["punc", ","], ["p", " "], ["prop", "na.rm"], ["p", " "], ["op", "="], ["p", " "], ["con", "TRUE"], ["punc", ")"]], [["punc", "}"]], [], [["var", "means"], ["p", " "], ["op", "<-"], ["p", " "], ["fnc", "sapply"], ["punc", "("], ["var", "regions"], ["punc", ","], ["p", " "], ["kw", "function"], ["punc", "("], ["var", "r"], ["punc", ")"], ["p", " "], ["fnc", "summarize_region"], ["punc", "("], ["var", "sales"], ["punc", ","], ["p", " "], ["var", "r"], ["punc", ")"], ["punc", ")"]], [["var", "sales"], ["p", " "], ["op", "%>%"], ["p", " "], ["fnc", "filter"], ["punc", "("], ["prop", "revenue"], ["p", " "], ["op", ">"], ["p", " "], ["num", "1000"], ["punc", ")"], ["p", " "], ["op", "%>%"], ["p", " "], ["fnc", "head"], ["punc", "("], ["num", "5"], ["punc", ")"]], [], [["var", "model"], ["p", " "], ["op", "<-"], ["p", " "], ["fnc", "lm"], ["punc", "("], ["prop", "revenue"], ["p", " "], ["op", "~"], ["p", " "], ["prop", "units"], ["p", " "], ["op", "+"], ["p", " "], ["prop", "region"], ["punc", ","], ["p", " "], ["prop", "data"], ["p", " "], ["op", "="], ["p", " "], ["var", "sales"], ["punc", ")"]], [["fnc", "print"], ["punc", "("], ["fnc", "summary"], ["punc", "("], ["var", "model"], ["punc", ")"], ["punc", ")"]]], "Erlang": [[["cmd", "%"], ["cm", " Bank account server with pattern matching"]], [["pp", "-module"], ["punc", "("], ["ty", "bank"], ["punc", ")."]], [["pp", "-export"], ["punc", "(["], ["fnc", "start"], ["op", "/"], ["num", "0"], ["punc", ","], ["p", " "], ["fnc", "balance"], ["op", "/"], ["num", "1"], ["punc", "])"], ["punc", "."]], [], [["fnd", "start"], ["punc", "()"], ["p", " "], ["op", "->"]], [["p", " "], ["fnc", "spawn"], ["punc", "("], ["kw", "fun"], ["punc", "()"], ["p", " "], ["op", "->"], ["p", " "], ["fnc", "loop"], ["punc", "("], ["num", "0"], ["punc", ")"], ["p", " "], ["kw", "end"], ["punc", ")."]], [], [["fnd", "loop"], ["punc", "("], ["var", "Balance"], ["punc", ")"], ["p", " "], ["op", "->"]], [["p", " "], ["kw", "receive"]], [["p", " "], ["punc", "{"], ["con", "deposit"], ["punc", ","], ["p", " "], ["var", "Amount"], ["punc", "}"], ["p", " "], ["kw", "when"], ["p", " "], ["var", "Amount"], ["p", " "], ["op", ">"], ["p", " "], ["num", "0"], ["p", " "], ["op", "->"]], [["p", " "], ["fnc", "loop"], ["punc", "("], ["var", "Balance"], ["p", " "], ["op", "+"], ["p", " "], ["var", "Amount"], ["punc", ")"], ["punc", ";"]], [["p", " "], ["punc", "{"], ["con", "withdraw"], ["punc", ","], ["p", " "], ["var", "Amount"], ["punc", "}"], ["p", " "], ["op", "->"]], [["p", " "], ["fnc", "loop"], ["punc", "("], ["var", "Balance"], ["p", " "], ["op", "-"], ["p", " "], ["var", "Amount"], ["punc", ")"], ["punc", ";"]], [["p", " "], ["punc", "{"], ["con", "balance"], ["punc", ","], ["p", " "], ["var", "From"], ["punc", "}"], ["p", " "], ["op", "->"]], [["p", " "], ["var", "From"], ["p", " "], ["op", "!"], ["p", " "], ["punc", "{"], ["con", "ok"], ["punc", ","], ["p", " "], ["var", "Balance"], ["punc", "}"], ["punc", ","], ["p", " "], ["fnc", "loop"], ["punc", "("], ["var", "Balance"], ["punc", ")"]], [["p", " "], ["kw", "end"], ["punc", "."]], [], [["fnd", "balance"], ["punc", "("], ["var", "Pid"], ["punc", ")"], ["p", " "], ["op", "->"]], [["p", " "], ["var", "Pid"], ["p", " "], ["op", "!"], ["p", " "], ["punc", "{"], ["con", "balance"], ["punc", ","], ["p", " "], ["fnc", "self"], ["punc", "()"], ["punc", "}"], ["punc", ","], ["p", " "], ["kw", "receive"], ["p", " "], ["punc", "{"], ["con", "ok"], ["punc", ","], ["p", " "], ["var", "B"], ["punc", "}"], ["p", " "], ["op", "->"], ["p", " "], ["var", "B"], ["p", " "], ["kw", "end"], ["punc", "."]]], "SQL": [[["cmd", "-- "], ["cm", "Monthly revenue by active customer"]], [["kw", "SELECT"], ["p", " "], ["prop", "c.id"], ["punc", ","], ["p", " "], ["prop", "c.name"], ["punc", ","]], [["p", " "], ["bi", "COUNT"], ["punc", "("], ["prop", "o.id"], ["punc", ")"], ["p", " "], ["kw", "AS"], ["p", " "], ["var", "order_count"], ["punc", ","]], [["p", " "], ["bi", "COALESCE"], ["punc", "("], ["bi", "SUM"], ["punc", "("], ["prop", "o.total"], ["punc", "),"], ["p", " "], ["num", "0"], ["punc", ")"], ["p", " "], ["kw", "AS"], ["p", " "], ["var", "revenue"]], [["kw", "FROM"], ["p", " "], ["prop", "customers"], ["p", " "], ["var", "c"]], [["kw", "JOIN"], ["p", " "], ["prop", "orders"], ["p", " "], ["var", "o"], ["p", " "], ["kw", "ON"], ["p", " "], ["prop", "o.customer_id"], ["p", " "], ["op", "="], ["p", " "], ["prop", "c.id"]], [["kw", "WHERE"], ["p", " "], ["prop", "c.active"], ["p", " "], ["op", "="], ["p", " "], ["con", "TRUE"]], [["p", " "], ["kw", "AND"], ["p", " "], ["prop", "o.created_at"], ["p", " "], ["op", ">="], ["p", " "], ["str", "'2024-01-01'"]], [["p", " "], ["kw", "AND"], ["p", " "], ["prop", "o.status"], ["p", " "], ["op", "<>"], ["p", " "], ["con", "NULL"]], [["kw", "GROUP BY"], ["p", " "], ["prop", "c.id"], ["punc", ","], ["p", " "], ["prop", "c.name"]], [["kw", "HAVING"], ["p", " "], ["bi", "COUNT"], ["punc", "("], ["prop", "o.id"], ["punc", ")"], ["p", " "], ["op", ">"], ["p", " "], ["num", "5"]], [["kw", "ORDER BY"], ["p", " "], ["var", "revenue"], ["p", " "], ["kw", "DESC"]], [["kw", "LIMIT"], ["p", " "], ["num", "25"], ["punc", ";"]], [], [["cmd", "-- "], ["cm", "Flag stale accounts for review"]], [["kw", "UPDATE"], ["p", " "], ["prop", "customers"]], [["kw", "SET"], ["p", " "], ["prop", "status"], ["p", " "], ["op", "="], ["p", " "], ["str", "'dormant'"]], [["kw", "WHERE"], ["p", " "], ["prop", "last_login"], ["p", " "], ["op", "<"], ["p", " "], ["bi", "CURRENT_DATE"], ["p", " "], ["op", "-"], ["p", " "], ["kw", "INTERVAL"], ["p", " "], ["str", "'90 days'"]], [["p", " "], ["kw", "AND"], ["p", " "], ["prop", "active"], ["p", " "], ["op", "="], ["p", " "], ["con", "FALSE"], ["punc", ";"]]], "PHP": [[["pp", "<?php"]], [["kw", "namespace"], ["p", " "], ["ty", "App\\Service"], ["punc", ";"]], [], [["cmd", "/** "], ["doc", "Computes invoice totals. */"]], [["dec", "#[Service]"]], [["kw", "class"], ["p", " "], ["ty", "InvoiceCalculator"]], [["punc", "{"]], [["p", " "], ["kw", "public"], ["p", " "], ["ty", "float"], ["p", " "], ["var", "$taxRate"], ["p", " "], ["op", "="], ["p", " "], ["num", "0.0825"], ["punc", ";"]], [], [["p", " "], ["kw", "public"], ["p", " "], ["kw", "function"], ["p", " "], ["fnd", "total"], ["punc", "("], ["kw", "array"], ["p", " "], ["var", "$items"], ["punc", ")"], ["op", ":"], ["p", " "], ["ty", "float"]], [["p", " "], ["punc", "{"]], [["p", " "], ["cmd", "// "], ["cm", "sum each line item"]], [["p", " "], ["var", "$prices"], ["p", " "], ["op", "="], ["p", " "], ["bi", "array_map"], ["punc", "("], ["kw", "fn"], ["punc", "("], ["var", "$i"], ["punc", ")"], ["p", " "], ["op", "=>"], ["p", " "], ["var", "$i"], ["op", "["], ["str", "'price'"], ["op", "]"], ["punc", ","], ["p", " "], ["var", "$items"], ["punc", ")"], ["punc", ";"]], [["p", " "], ["var", "$subtotal"], ["p", " "], ["op", "="], ["p", " "], ["bi", "array_sum"], ["punc", "("], ["var", "$prices"], ["punc", ")"], ["punc", ";"]], [], [["p", " "], ["kw", "if"], ["p", " "], ["punc", "("], ["var", "$subtotal"], ["p", " "], ["op", "==="], ["p", " "], ["num", "0"], ["punc", ")"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "return"], ["p", " "], ["num", "0.0"], ["punc", ";"]], [["p", " "], ["punc", "}"]], [], [["p", " "], ["var", "$total"], ["p", " "], ["op", "="], ["p", " "], ["var", "$subtotal"], ["p", " "], ["op", "*"], ["p", " "], ["punc", "("], ["num", "1"], ["p", " "], ["op", "+"], ["p", " "], ["var", "$this"], ["op", "->"], ["prop", "taxRate"], ["punc", ")"], ["punc", ";"]], [["p", " "], ["fnc", "printf"], ["punc", "("], ["str", "\"Total: %.2f\\n\""], ["punc", ","], ["p", " "], ["var", "$total"], ["punc", ")"], ["punc", ";"]], [["p", " "], ["kw", "return"], ["p", " "], ["var", "$total"], ["punc", ";"]], [["p", " "], ["punc", "}"]], [["punc", "}"]]], "Ada": [[["cmd", "-- "], ["cm", "Compute factorial and print the result"]], [["pp", "with"], ["p", " "], ["var", "Ada.Text_IO"], ["punc", ";"]], [["pp", "use"], ["p", " "], ["var", "Ada.Text_IO"], ["punc", ";"]], [], [["kw", "procedure"], ["p", " "], ["fnd", "Factorial_Demo"], ["p", " "], ["kw", "is"]], [["p", " "], ["var", "N"], ["p", " "], ["punc", ":"], ["p", " "], ["ty", "Integer"], ["p", " "], ["op", ":="], ["p", " "], ["num", "5"], ["punc", ";"]], [["p", " "], ["var", "Result"], ["p", " "], ["punc", ":"], ["p", " "], ["ty", "Integer"], ["p", " "], ["op", ":="], ["p", " "], ["num", "1"], ["punc", ";"]], [["kw", "begin"]], [["p", " "], ["kw", "for"], ["p", " "], ["var", "I"], ["p", " "], ["kw", "in"], ["p", " "], ["num", "1"], ["p", " "], ["op", ".."], ["p", " "], ["var", "N"], ["p", " "], ["kw", "loop"]], [["p", " "], ["var", "Result"], ["p", " "], ["op", ":="], ["p", " "], ["var", "Result"], ["p", " "], ["op", "*"], ["p", " "], ["var", "I"], ["punc", ";"]], [["p", " "], ["kw", "end"], ["p", " "], ["kw", "loop"], ["punc", ";"]], [], [["p", " "], ["kw", "if"], ["p", " "], ["var", "Result"], ["p", " "], ["op", ">"], ["p", " "], ["num", "0"], ["p", " "], ["kw", "then"]], [["p", " "], ["bi", "Put_Line"], ["punc", "("], ["str", "\"Factorial = \""], ["p", " "], ["op", "&"], ["p", " "], ["var", "Integer"], ["punc", "'"], ["var", "Image"], ["punc", "("], ["var", "Result"], ["punc", "))"], ["punc", ";"]], [["p", " "], ["kw", "end"], ["p", " "], ["kw", "if"], ["punc", ";"]], [["kw", "end"], ["p", " "], ["fnd", "Factorial_Demo"], ["punc", ";"]]], "Fortran": [[["cmd", "! "], ["cm", "Sum the elements of an array"]], [["kw", "program"], ["p", " "], ["fnd", "array_sum"]], [["p", " "], ["kw", "implicit none"]], [["p", " "], ["ty", "integer"], ["p", " "], ["punc", "::"], ["p", " "], ["var", "i"], ["punc", ","], ["p", " "], ["var", "n"]], [["p", " "], ["ty", "real"], ["punc", "("], ["var", "kind"], ["op", "="], ["num", "8"], ["punc", ")"], ["p", " "], ["punc", "::"], ["p", " "], ["var", "total"]], [["p", " "], ["ty", "real"], ["punc", "("], ["var", "kind"], ["op", "="], ["num", "8"], ["punc", ")"], ["punc", ","], ["p", " "], ["kw", "dimension"], ["punc", "("], ["num", "5"], ["punc", ")"], ["p", " "], ["punc", "::"], ["p", " "], ["var", "a"]], [], [["p", " "], ["var", "n"], ["p", " "], ["op", "="], ["p", " "], ["num", "5"]], [["p", " "], ["var", "total"], ["p", " "], ["op", "="], ["p", " "], ["num", "0.0"]], [["p", " "], ["var", "a"], ["p", " "], ["op", "="], ["p", " "], ["punc", "["], ["num", "1.0"], ["punc", ","], ["p", " "], ["num", "2.0"], ["punc", ","], ["p", " "], ["num", "3.0"], ["punc", ","], ["p", " "], ["num", "4.0"], ["punc", ","], ["p", " "], ["num", "5.0"], ["punc", "]"]], [], [["p", " "], ["kw", "do"], ["p", " "], ["var", "i"], ["p", " "], ["op", "="], ["p", " "], ["num", "1"], ["punc", ","], ["p", " "], ["var", "n"]], [["p", " "], ["var", "total"], ["p", " "], ["op", "="], ["p", " "], ["var", "total"], ["p", " "], ["op", "+"], ["p", " "], ["var", "a"], ["punc", "("], ["var", "i"], ["punc", ")"]], [["p", " "], ["kw", "end do"]], [], [["p", " "], ["bi", "print"], ["p", " "], ["op", "*"], ["punc", ","], ["p", " "], ["str", "\"Sum = \""], ["punc", ","], ["p", " "], ["var", "total"]], [["kw", "end program"], ["p", " "], ["fnd", "array_sum"]]], "MATLAB": [[["cmd", "% "], ["cm", "Normalize a vector and report its length"]], [["kw", "function"], ["p", " "], ["var", "out"], ["p", " "], ["op", "="], ["p", " "], ["fnd", "normalize_vec"], ["punc", "("], ["var", "v"], ["punc", ")"]], [["p", " "], ["var", "n"], ["p", " "], ["op", "="], ["p", " "], ["bi", "length"], ["punc", "("], ["var", "v"], ["punc", ")"], ["punc", ";"]], [["p", " "], ["var", "acc"], ["p", " "], ["op", "="], ["p", " "], ["num", "0"], ["punc", ";"]], [], [["p", " "], ["kw", "for"], ["p", " "], ["var", "i"], ["p", " "], ["op", "="], ["p", " "], ["num", "1"], ["op", ":"], ["var", "n"]], [["p", " "], ["var", "acc"], ["p", " "], ["op", "="], ["p", " "], ["var", "acc"], ["p", " "], ["op", "+"], ["p", " "], ["var", "v"], ["punc", "("], ["var", "i"], ["punc", ")"], ["op", "^"], ["num", "2"], ["punc", ";"]], [["p", " "], ["kw", "end"]], [], [["p", " "], ["var", "mag"], ["p", " "], ["op", "="], ["p", " "], ["bi", "sqrt"], ["punc", "("], ["var", "acc"], ["punc", ")"], ["punc", ";"]], [["p", " "], ["kw", "if"], ["p", " "], ["var", "mag"], ["p", " "], ["op", "=="], ["p", " "], ["num", "0"]], [["p", " "], ["var", "out"], ["p", " "], ["op", "="], ["p", " "], ["bi", "zeros"], ["punc", "("], ["bi", "size"], ["punc", "("], ["var", "v"], ["punc", ")"], ["punc", ")"], ["punc", ";"]], [["p", " "], ["kw", "else"]], [["p", " "], ["var", "out"], ["p", " "], ["op", "="], ["p", " "], ["var", "v"], ["p", " "], ["op", "/"], ["p", " "], ["var", "mag"], ["punc", ";"]], [["p", " "], ["kw", "end"]], [], [["p", " "], ["bi", "disp"], ["punc", "("], ["str", "\"vector length:\""], ["punc", ")"], ["punc", ";"]], [["p", " "], ["bi", "disp"], ["punc", "("], ["var", "n"], ["punc", ")"], ["punc", ";"]], [["kw", "end"]]], "Assembly": [[["cmd", ";"], ["cm", " print a greeting via the write syscall"]], [["pp", "section"], ["p", " "], ["pp", ".data"]], [["p", " "], ["var", "msg"], ["p", " "], ["pp", "db"], ["p", " "], ["str", "\"Hello, world!\""], ["punc", ","], ["p", " "], ["num", "0xA"]], [["p", " "], ["con", "msglen"], ["p", " "], ["pp", "equ"], ["p", " "], ["var", "$"], ["p", " "], ["op", "-"], ["p", " "], ["var", "msg"]], [], [["pp", "section"], ["p", " "], ["pp", ".text"]], [["p", " "], ["bi", "global"], ["p", " "], ["fnc", "_start"]], [], [["fnd", "_start"], ["punc", ":"]], [["p", " "], ["kw", "mov"], ["p", " "], ["var", "rax"], ["punc", ","], ["p", " "], ["num", "1"], ["p", " "], ["cmd", ";"], ["cm", " sys_write"]], [["p", " "], ["kw", "mov"], ["p", " "], ["var", "rdi"], ["punc", ","], ["p", " "], ["num", "1"], ["p", " "], ["cmd", ";"], ["cm", " stdout"]], [["p", " "], ["kw", "lea"], ["p", " "], ["var", "rsi"], ["punc", ","], ["p", " "], ["punc", "["], ["var", "rel"], ["p", " "], ["var", "msg"], ["punc", "]"]], [["p", " "], ["kw", "mov"], ["p", " "], ["var", "rdx"], ["punc", ","], ["p", " "], ["con", "msglen"]], [["p", " "], ["kw", "syscall"]], [], [["p", " "], ["kw", "mov"], ["p", " "], ["var", "rax"], ["punc", ","], ["p", " "], ["num", "60"], ["p", " "], ["cmd", ";"], ["cm", " sys_exit"]], [["p", " "], ["kw", "xor"], ["p", " "], ["var", "rdi"], ["punc", ","], ["p", " "], ["var", "rdi"], ["p", " "], ["cmd", ";"], ["cm", " status 0"]], [["p", " "], ["kw", "syscall"]]]}, CATS=[["bg", "bg (ground)", "Aa Bb 123"], ["p", "fg", "other / whitespace"], ["kw", "keyword", "class def if return"], ["bi", "builtin", "len echo printf"], ["pp", "preprocessor", "#include #define"], ["fnd", "function \u00b7 def", "resolve push"], ["fnc", "function \u00b7 call", "printf rsync get"], ["dec", "decorator \u2192 type", "@dataclass"], ["ty", "type / class", "int str Order Queue"], ["prop", "property / field", "id name items"], ["con", "constant", "None nil NULL true"], ["num", "number", "8080 100 -1"], ["str", "string", "\"dupre\" \"fmt\""], ["esc", "escape", "\\n \\t"], ["re", "regexp", "/^#[0-9a-f]+/"], ["doc", "docstring", "\"\"\"...\"\"\""], ["cm", "comment", "# reject nil"], ["cmd", "comment delim", "# // ;;"], ["var", "variable / use", "value key self"], ["op", "operator", ": = -> =="], ["punc", "punctuation", "{ } ( ) ;"]], UI_FACES=[["cursor", "cursor", "Aa|"], ["region", "region (selection)", "selected text"], ["hl-line", "hl-line (current line)", "current line"], ["highlight", "highlight", "hover"], ["mode-line", "mode-line", "status active"], ["mode-line-highlight", "mode-line-highlight (hover)", "git:main"], ["mode-line-inactive", "mode-line-inactive", "status idle"], ["fringe", "fringe", "| |"], ["line-number", "line-number", " 42"], ["line-number-current-line", "line-number-current-line", "> 42"], ["minibuffer-prompt", "minibuffer-prompt", "M-x "], ["isearch", "isearch (match)", "match"], ["lazy-highlight", "lazy-highlight", "other match"], ["isearch-fail", "isearch-fail", "no match"], ["show-paren-match", "show-paren-match", "( )"], ["show-paren-mismatch", "show-paren-mismatch", ") ("], ["link", "link", "https://"], ["error", "error", "error!"], ["warning", "warning", "warning"], ["success", "success", "ok"], ["vertical-border", "vertical-border", "|"]], APPS={"org-mode": {"label": "org-mode", "preview": "org", "hover": "", "faces": [["org-document-title", "document title", {}], ["org-document-info", "document info", {}], ["org-document-info-keyword", "document info keyword", {}], ["org-level-1", "level 1", {}], ["org-level-2", "level 2", {}], ["org-level-3", "level 3", {}], ["org-level-4", "level 4", {}], ["org-level-5", "level 5", {}], ["org-level-6", "level 6", {}], ["org-level-7", "level 7", {}], ["org-level-8", "level 8", {}], ["org-headline-todo", "headline todo", {}], ["org-headline-done", "headline done", {}], ["org-todo", "todo", {}], ["org-done", "done", {}], ["org-priority", "priority", {}], ["org-tag", "tag", {}], ["org-tag-group", "tag group", {}], ["org-special-keyword", "special keyword", {}], ["org-drawer", "drawer", {}], ["org-property-value", "property value", {}], ["org-checkbox", "checkbox", {}], ["org-checkbox-statistics-todo", "checkbox statistics todo", {}], ["org-checkbox-statistics-done", "checkbox statistics done", {}], ["org-warning", "warning", {}], ["org-link", "link", {}], ["org-footnote", "footnote", {}], ["org-date", "date", {}], ["org-sexp-date", "sexp date", {}], ["org-date-selected", "date selected", {}], ["org-target", "target", {}], ["org-macro", "macro", {}], ["org-cite", "cite", {}], ["org-cite-key", "cite key", {}], ["org-block", "block", {}], ["org-block-begin-line", "block begin line", {}], ["org-block-end-line", "block end line", {}], ["org-code", "code", {}], ["org-verbatim", "verbatim", {}], ["org-inline-src-block", "inline src block", {}], ["org-quote", "quote", {}], ["org-verse", "verse", {}], ["org-latex-and-related", "latex and related", {}], ["org-table", "table", {}], ["org-table-header", "table header", {}], ["org-table-row", "table row", {}], ["org-formula", "formula", {}], ["org-column", "column", {}], ["org-column-title", "column title", {}], ["org-list-dt", "list dt", {}], ["org-meta-line", "meta line", {}], ["org-ellipsis", "ellipsis", {}], ["org-hide", "hide", {}], ["org-indent", "indent", {}], ["org-archived", "archived", {}], ["org-default", "default", {}], ["org-dispatcher-highlight", "dispatcher highlight", {}], ["org-agenda-structure", "agenda structure", {}], ["org-agenda-structure-secondary", "agenda structure secondary", {}], ["org-agenda-structure-filter", "agenda structure filter", {}], ["org-agenda-date", "agenda date", {}], ["org-agenda-date-today", "agenda date today", {}], ["org-agenda-date-weekend", "agenda date weekend", {}], ["org-agenda-date-weekend-today", "agenda date weekend today", {}], ["org-agenda-current-time", "agenda current time", {}], ["org-agenda-done", "agenda done", {}], ["org-agenda-dimmed-todo-face", "agenda dimmed todo", {}], ["org-agenda-calendar-event", "agenda calendar event", {}], ["org-agenda-calendar-sexp", "agenda calendar sexp", {}], ["org-agenda-calendar-daterange", "agenda calendar daterange", {}], ["org-agenda-diary", "agenda diary", {}], ["org-agenda-clocking", "agenda clocking", {}], ["org-agenda-column-dateline", "agenda column dateline", {}], ["org-agenda-restriction-lock", "agenda restriction lock", {}], ["org-agenda-filter-category", "agenda filter category", {}], ["org-agenda-filter-effort", "agenda filter effort", {}], ["org-agenda-filter-regexp", "agenda filter regexp", {}], ["org-agenda-filter-tags", "agenda filter tags", {}], ["org-scheduled", "scheduled", {}], ["org-scheduled-today", "scheduled today", {}], ["org-scheduled-previously", "scheduled previously", {}], ["org-upcoming-deadline", "upcoming deadline", {}], ["org-upcoming-distant-deadline", "upcoming distant deadline", {}], ["org-imminent-deadline", "imminent deadline", {}], ["org-time-grid", "time grid", {}], ["org-clock-overlay", "clock overlay", {}], ["org-mode-line-clock", "mode line clock", {}], ["org-mode-line-clock-overrun", "mode line clock overrun", {}]]}, "magit": {"label": "magit", "preview": "magit", "hover": "", "faces": [["magit-section-heading", "section heading", {"fg": "#8b6508", "weight": "bold", "extend": true}], ["magit-section-secondary-heading", "section secondary heading", {"weight": "bold", "extend": true}], ["magit-section-heading-selection", "section heading selection", {"fg": "#8b4c39", "extend": true}], ["magit-section-highlight", "section highlight", {"bg": "#f2f2f2", "extend": true}], ["magit-section-child-count", "section child count", {}], ["magit-diff-added", "diff added", {"fg": "#22aa22", "bg": "#ddffdd", "extend": true}], ["magit-diff-added-highlight", "diff added highlight", {"fg": "#22aa22", "bg": "#cceecc", "extend": true}], ["magit-diff-removed", "diff removed", {"fg": "#aa2222", "bg": "#ffdddd", "extend": true}], ["magit-diff-removed-highlight", "diff removed highlight", {"fg": "#aa2222", "bg": "#eecccc", "extend": true}], ["magit-diff-context", "diff context", {"fg": "#7f7f7f", "extend": true}], ["magit-diff-context-highlight", "diff context highlight", {"fg": "#7f7f7f", "bg": "#f2f2f2", "extend": true}], ["magit-diff-file-heading", "diff file heading", {"weight": "bold", "extend": true}], ["magit-diff-file-heading-highlight", "diff file heading highlight", {"extend": true, "inherit": "magit-section-highlight"}], ["magit-diff-file-heading-selection", "diff file heading selection", {"fg": "#8b4c39", "extend": true, "inherit": "magit-diff-file-heading-highlight"}], ["magit-diff-hunk-heading", "diff hunk heading", {"fg": "#333333", "bg": "#e5e5e5", "extend": true}], ["magit-diff-hunk-heading-highlight", "diff hunk heading highlight", {"fg": "#333333", "bg": "#cccccc", "extend": true}], ["magit-diff-hunk-heading-selection", "diff hunk heading selection", {"fg": "#8b4c39", "extend": true, "inherit": "magit-diff-hunk-heading-highlight"}], ["magit-diff-hunk-region", "diff hunk region", {"inherit": "bold"}], ["magit-diff-lines-heading", "diff lines heading", {"bg": "#cd8162", "extend": true, "inherit": "magit-diff-hunk-heading-highlight"}], ["magit-diff-lines-boundary", "diff lines boundary", {"extend": true, "inherit": "magit-diff-lines-heading"}], ["magit-diff-base", "diff base", {"fg": "#aaaa11", "bg": "#ffffcc", "extend": true}], ["magit-diff-base-highlight", "diff base highlight", {"fg": "#aaaa11", "bg": "#eeeebb", "extend": true}], ["magit-diff-our", "diff our", {"inherit": "magit-diff-removed"}], ["magit-diff-our-highlight", "diff our highlight", {"inherit": "magit-diff-removed-highlight"}], ["magit-diff-their", "diff their", {"inherit": "magit-diff-added"}], ["magit-diff-their-highlight", "diff their highlight", {"inherit": "magit-diff-added-highlight"}], ["magit-diff-conflict-heading", "diff conflict heading", {"inherit": "magit-diff-hunk-heading"}], ["magit-diff-conflict-heading-highlight", "diff conflict heading highlight", {"inherit": "magit-diff-hunk-heading-highlight"}], ["magit-diff-revision-summary", "diff revision summary", {"inherit": "magit-diff-hunk-heading"}], ["magit-diff-revision-summary-highlight", "diff revision summary highlight", {"inherit": "magit-diff-hunk-heading-highlight"}], ["magit-diff-whitespace-warning", "diff whitespace warning", {"inherit": "trailing-whitespace"}], ["magit-diffstat-added", "diffstat added", {"fg": "#22aa22"}], ["magit-diffstat-removed", "diffstat removed", {"fg": "#aa2222"}], ["magit-branch-current", "branch current", {"inherit": "magit-branch-local"}], ["magit-branch-local", "branch local", {"fg": "#4a708b"}], ["magit-branch-remote", "branch remote", {"fg": "#6e8b3d"}], ["magit-branch-remote-head", "branch remote head", {"inherit": "magit-branch-remote"}], ["magit-branch-upstream", "branch upstream", {"slant": "italic"}], ["magit-branch-warning", "branch warning", {"inherit": "warning"}], ["magit-head", "head", {"inherit": "magit-branch-local"}], ["magit-tag", "tag", {"fg": "#8b6914"}], ["magit-hash", "hash", {"fg": "#999999"}], ["magit-filename", "filename", {}], ["magit-dimmed", "dimmed", {"fg": "#7f7f7f"}], ["magit-keyword", "keyword", {"inherit": "font-lock-string-face"}], ["magit-keyword-squash", "keyword squash", {"inherit": "font-lock-warning-face"}], ["magit-refname", "refname", {"fg": "#4d4d4d"}], ["magit-refname-stash", "refname stash", {"inherit": "magit-refname"}], ["magit-refname-wip", "refname wip", {"inherit": "magit-refname"}], ["magit-refname-pullreq", "refname pullreq", {"inherit": "magit-refname"}], ["magit-log-author", "log author", {"fg": "#b22222"}], ["magit-log-date", "log date", {"fg": "#4d4d4d"}], ["magit-log-graph", "log graph", {"fg": "#4d4d4d"}], ["magit-header-line", "header line", {"inherit": "magit-section-heading"}], ["magit-header-line-key", "header line key", {"inherit": "font-lock-builtin-face"}], ["magit-header-line-log-select", "header line log select", {"inherit": "bold"}], ["magit-process-ok", "process ok", {"fg": "#00ff00", "inherit": "magit-section-heading"}], ["magit-process-ng", "process ng", {"fg": "#ff0000", "inherit": "magit-section-heading"}], ["magit-mode-line-process", "mode line process", {"inherit": "mode-line-emphasis"}], ["magit-mode-line-process-error", "mode line process error", {"inherit": "error"}], ["magit-bisect-good", "bisect good", {"fg": "#556b2f"}], ["magit-bisect-bad", "bisect bad", {"fg": "#8b3a3a"}], ["magit-bisect-skip", "bisect skip", {"fg": "#b8860b"}], ["magit-blame-heading", "blame heading", {"extend": true, "inherit": "magit-blame-highlight"}], ["magit-blame-highlight", "blame highlight", {"fg": "#000000", "bg": "#cccccc", "extend": true}], ["magit-blame-hash", "blame hash", {}], ["magit-blame-name", "blame name", {}], ["magit-blame-date", "blame date", {}], ["magit-blame-summary", "blame summary", {}], ["magit-blame-dimmed", "blame dimmed", {"inherit": "magit-dimmed"}], ["magit-blame-margin", "blame margin", {"inherit": "magit-blame-highlight"}], ["magit-cherry-equivalent", "cherry equivalent", {"fg": "#ff00ff"}], ["magit-cherry-unmatched", "cherry unmatched", {"fg": "#00ffff"}], ["magit-signature-good", "signature good", {"fg": "#00ff00"}], ["magit-signature-bad", "signature bad", {"fg": "#ff0000", "weight": "bold"}], ["magit-signature-untrusted", "signature untrusted", {"fg": "#66cdaa"}], ["magit-signature-expired", "signature expired", {"fg": "#ffa500"}], ["magit-signature-expired-key", "signature expired key", {"inherit": "magit-signature-expired"}], ["magit-signature-revoked", "signature revoked", {"fg": "#d02090"}], ["magit-signature-error", "signature error", {"fg": "#add8e6"}], ["magit-reflog-commit", "reflog commit", {"fg": "#00ff00"}], ["magit-reflog-amend", "reflog amend", {"fg": "#ff00ff"}], ["magit-reflog-merge", "reflog merge", {"fg": "#00ff00"}], ["magit-reflog-checkout", "reflog checkout", {"fg": "#0000ff"}], ["magit-reflog-reset", "reflog reset", {"fg": "#ff0000"}], ["magit-reflog-rebase", "reflog rebase", {"fg": "#ff00ff"}], ["magit-reflog-cherry-pick", "reflog cherry pick", {"fg": "#00ff00"}], ["magit-reflog-remote", "reflog remote", {"fg": "#00ffff"}], ["magit-reflog-other", "reflog other", {"fg": "#00ffff"}], ["magit-sequence-pick", "sequence pick", {"inherit": "default"}], ["magit-sequence-stop", "sequence stop", {"fg": "#6e8b3d"}], ["magit-sequence-part", "sequence part", {"fg": "#8b6914"}], ["magit-sequence-head", "sequence head", {"fg": "#4a708b"}], ["magit-sequence-drop", "sequence drop", {"fg": "#cd5c5c"}], ["magit-sequence-done", "sequence done", {"inherit": "magit-hash"}], ["magit-sequence-onto", "sequence onto", {"inherit": "magit-sequence-done"}], ["magit-sequence-exec", "sequence exec", {"inherit": "magit-hash"}], ["magit-left-margin", "left margin", {"inherit": "default"}], ["git-commit-comment-action", "git commit comment action", {"inherit": "bold"}], ["git-commit-comment-branch-local", "git commit comment branch local", {"inherit": "magit-branch-local"}], ["git-commit-comment-branch-remote", "git commit comment branch remote", {"inherit": "magit-branch-remote"}], ["git-commit-comment-detached", "git commit comment detached", {"inherit": "git-commit-comment-branch-local"}], ["git-commit-comment-file", "git commit comment file", {"inherit": "git-commit-trailer-value"}], ["git-commit-comment-heading", "git commit comment heading", {"inherit": "git-commit-trailer-token"}], ["git-commit-keyword", "git commit keyword", {"inherit": "font-lock-string-face"}], ["git-commit-nonempty-second-line", "git commit nonempty second line", {"inherit": "font-lock-warning-face"}], ["git-commit-overlong-summary", "git commit overlong summary", {"inherit": "font-lock-warning-face"}], ["git-commit-summary", "git commit summary", {"inherit": "font-lock-type-face"}], ["git-commit-trailer-token", "git commit trailer token", {"inherit": "font-lock-keyword-face"}], ["git-commit-trailer-value", "git commit trailer value", {"inherit": "font-lock-string-face"}]]}, "elfeed": {"label": "elfeed", "preview": "elfeed", "hover": "", "faces": [["elfeed-search-date-face", "search date", {"fg": "#aaa"}], ["elfeed-search-title-face", "search title", {"fg": "#000"}], ["elfeed-search-unread-title-face", "search unread title", {"weight": "bold"}], ["elfeed-search-feed-face", "search feed", {"fg": "#aa0"}], ["elfeed-search-tag-face", "search tag", {"fg": "#070"}], ["elfeed-search-unread-count-face", "search unread count", {"fg": "#000"}], ["elfeed-search-filter-face", "search filter", {"inherit": "mode-line-buffer-id"}], ["elfeed-search-last-update-face", "search last update", {}], ["elfeed-log-date-face", "log date", {"inherit": "font-lock-type-face"}], ["elfeed-log-error-level-face", "log error level", {"fg": "#ff0000"}], ["elfeed-log-warn-level-face", "log warn level", {"fg": "#daa520"}], ["elfeed-log-info-level-face", "log info level", {"fg": "#00bfff"}], ["elfeed-log-debug-level-face", "log debug level", {"fg": "#ee00ee"}]]}, "mu4e": {"label": "mu4e", "preview": "mu4e", "hover": "", "faces": [["mu4e-title-face", "title", {}], ["mu4e-context-face", "context", {}], ["mu4e-modeline-face", "modeline", {}], ["mu4e-ok-face", "ok", {}], ["mu4e-warning-face", "warning", {}], ["mu4e-header-title-face", "header title", {}], ["mu4e-header-key-face", "header key", {}], ["mu4e-header-value-face", "header value", {}], ["mu4e-header-face", "header", {}], ["mu4e-header-highlight-face", "header highlight", {}], ["mu4e-header-marks-face", "header marks", {}], ["mu4e-unread-face", "unread", {}], ["mu4e-flagged-face", "flagged", {}], ["mu4e-replied-face", "replied", {}], ["mu4e-forwarded-face", "forwarded", {}], ["mu4e-draft-face", "draft", {}], ["mu4e-trashed-face", "trashed", {}], ["mu4e-related-face", "related", {}], ["mu4e-contact-face", "contact", {}], ["mu4e-special-header-value-face", "special header value", {}], ["mu4e-url-number-face", "url number", {}], ["mu4e-link-face", "link", {}], ["mu4e-footer-face", "footer", {}], ["mu4e-region-code", "region code", {}], ["mu4e-system-face", "system", {}], ["mu4e-highlight-face", "highlight", {}], ["mu4e-compose-separator-face", "compose separator", {}]]}, "gnus": {"label": "gnus", "preview": "gnus", "hover": "Article-view faces, reused by mu4e's article view.", "faces": [["gnus-header-name", "header name", {}], ["gnus-header-from", "header from", {}], ["gnus-header-subject", "header subject", {}], ["gnus-header-content", "header content", {}], ["gnus-header-newsgroups", "header newsgroups", {}], ["gnus-cite-1", "cite 1", {}], ["gnus-cite-2", "cite 2", {}], ["gnus-cite-3", "cite 3", {}], ["gnus-cite-4", "cite 4", {}], ["gnus-cite-5", "cite 5", {}], ["gnus-cite-6", "cite 6", {}], ["gnus-cite-7", "cite 7", {}], ["gnus-cite-8", "cite 8", {}], ["gnus-cite-9", "cite 9", {}], ["gnus-cite-10", "cite 10", {}], ["gnus-cite-11", "cite 11", {}], ["gnus-cite-attribution", "cite attribution", {}], ["gnus-signature", "signature", {}], ["gnus-button", "button", {}], ["gnus-emphasis-bold", "emphasis bold", {}], ["gnus-emphasis-italic", "emphasis italic", {}], ["gnus-emphasis-underline", "emphasis underline", {}], ["gnus-emphasis-strikethru", "emphasis strikethru", {}], ["gnus-emphasis-highlight-words", "emphasis highlight words", {}]]}, "org-faces": {"label": "org-faces", "preview": "orgfaces", "hover": "", "faces": [["org-faces-todo", "todo", {}], ["org-faces-project", "project", {}], ["org-faces-doing", "doing", {}], ["org-faces-waiting", "waiting", {}], ["org-faces-verify", "verify", {}], ["org-faces-stalled", "stalled", {}], ["org-faces-delegated", "delegated", {}], ["org-faces-failed", "failed", {}], ["org-faces-done", "done", {}], ["org-faces-cancelled", "cancelled", {}], ["org-faces-priority-a", "priority a", {}], ["org-faces-priority-b", "priority b", {}], ["org-faces-priority-c", "priority c", {}], ["org-faces-priority-d", "priority d", {}], ["org-faces-todo-dim", "todo dim", {}], ["org-faces-project-dim", "project dim", {}], ["org-faces-doing-dim", "doing dim", {}], ["org-faces-waiting-dim", "waiting dim", {}], ["org-faces-verify-dim", "verify dim", {}], ["org-faces-stalled-dim", "stalled dim", {}], ["org-faces-delegated-dim", "delegated dim", {}], ["org-faces-failed-dim", "failed dim", {}], ["org-faces-done-dim", "done dim", {}], ["org-faces-cancelled-dim", "cancelled dim", {}], ["org-faces-priority-a-dim", "priority a dim", {}], ["org-faces-priority-b-dim", "priority b dim", {}], ["org-faces-priority-c-dim", "priority c dim", {}], ["org-faces-priority-d-dim", "priority d dim", {}]]}, "ghostel": {"label": "ghostel", "preview": "ghostel", "hover": "", "faces": [["ghostel-default", "default", {"inherit": "default"}], ["ghostel-fake-cursor", "fake cursor", {"box": {"style": "line", "width": 1, "color": null}}], ["ghostel-fake-cursor-box", "fake cursor box", {"inherit": "cursor"}], ["ghostel-color-black", "color black", {"inherit": "ansi-color-black"}], ["ghostel-color-red", "color red", {"inherit": "ansi-color-red"}], ["ghostel-color-green", "color green", {"inherit": "ansi-color-green"}], ["ghostel-color-yellow", "color yellow", {"inherit": "ansi-color-yellow"}], ["ghostel-color-blue", "color blue", {"inherit": "ansi-color-blue"}], ["ghostel-color-magenta", "color magenta", {"inherit": "ansi-color-magenta"}], ["ghostel-color-cyan", "color cyan", {"inherit": "ansi-color-cyan"}], ["ghostel-color-white", "color white", {"inherit": "ansi-color-white"}], ["ghostel-color-bright-black", "color bright black", {"inherit": "ansi-color-bright-black"}], ["ghostel-color-bright-red", "color bright red", {"inherit": "ansi-color-bright-red"}], ["ghostel-color-bright-green", "color bright green", {"inherit": "ansi-color-bright-green"}], ["ghostel-color-bright-yellow", "color bright yellow", {"inherit": "ansi-color-bright-yellow"}], ["ghostel-color-bright-blue", "color bright blue", {"inherit": "ansi-color-bright-blue"}], ["ghostel-color-bright-magenta", "color bright magenta", {"inherit": "ansi-color-bright-magenta"}], ["ghostel-color-bright-cyan", "color bright cyan", {"inherit": "ansi-color-bright-cyan"}], ["ghostel-color-bright-white", "color bright white", {"inherit": "ansi-color-bright-white"}]]}, "ansi-color": {"label": "ansi-color", "preview": "ansicolor", "hover": "The 16 ANSI palette faces. Reused by vterm, eshell, compilation, ghostel, and eat, whose own color faces inherit these.", "faces": [["ansi-color-black", "black", {}], ["ansi-color-red", "red", {}], ["ansi-color-green", "green", {}], ["ansi-color-yellow", "yellow", {}], ["ansi-color-blue", "blue", {}], ["ansi-color-magenta", "magenta", {}], ["ansi-color-cyan", "cyan", {}], ["ansi-color-white", "white", {}], ["ansi-color-bright-black", "bright black", {}], ["ansi-color-bright-red", "bright red", {}], ["ansi-color-bright-green", "bright green", {}], ["ansi-color-bright-yellow", "bright yellow", {}], ["ansi-color-bright-blue", "bright blue", {}], ["ansi-color-bright-magenta", "bright magenta", {}], ["ansi-color-bright-cyan", "bright cyan", {}], ["ansi-color-bright-white", "bright white", {}]]}, "eat": {"label": "emulate a terminal (eat)", "preview": "eat", "hover": "", "faces": [["eat-term-color-black", "term color black", {}], ["eat-term-color-red", "term color red", {}], ["eat-term-color-green", "term color green", {}], ["eat-term-color-yellow", "term color yellow", {}], ["eat-term-color-blue", "term color blue", {}], ["eat-term-color-magenta", "term color magenta", {}], ["eat-term-color-cyan", "term color cyan", {}], ["eat-term-color-white", "term color white", {}], ["eat-term-color-bright-black", "term color bright black", {}], ["eat-term-color-bright-red", "term color bright red", {}], ["eat-term-color-bright-green", "term color bright green", {}], ["eat-term-color-bright-yellow", "term color bright yellow", {}], ["eat-term-color-bright-blue", "term color bright blue", {}], ["eat-term-color-bright-magenta", "term color bright magenta", {}], ["eat-term-color-bright-cyan", "term color bright cyan", {}], ["eat-term-color-bright-white", "term color bright white", {}], ["eat-term-bold", "term bold", {}], ["eat-term-faint", "term faint", {}], ["eat-term-italic", "term italic", {}], ["eat-term-slow-blink", "term slow blink", {}], ["eat-term-fast-blink", "term fast blink", {}], ["eat-shell-prompt-annotation-success", "shell prompt annotation success", {}], ["eat-shell-prompt-annotation-running", "shell prompt annotation running", {}], ["eat-shell-prompt-annotation-failure", "shell prompt annotation failure", {}]]}, "auto-dim-other-buffers": {"label": "auto-dim", "preview": "autodim", "hover": "", "faces": [["auto-dim-other-buffers", "auto dim other buffers", {}], ["auto-dim-other-buffers-hide", "hide", {}]]}, "dashboard": {"label": "dashboard", "preview": "dashboard", "hover": "", "faces": [["dashboard-banner-logo-title", "banner logo title", {"inherit": "default"}], ["dashboard-text-banner", "text banner", {"inherit": "font-lock-keyword-face"}], ["dashboard-heading", "heading", {"inherit": "font-lock-keyword-face"}], ["dashboard-items-face", "items", {"inherit": "widget-button"}], ["dashboard-navigator", "navigator", {"inherit": "font-lock-keyword-face"}], ["dashboard-no-items-face", "no items", {"inherit": "widget-button"}], ["dashboard-footer-face", "footer", {"inherit": "font-lock-doc-face"}], ["dashboard-footer-icon-face", "footer icon", {"inherit": "dashboard-footer-face"}]]}, "lsp-mode": {"label": "language server protocol (lsp)", "preview": "lsp", "hover": "", "faces": [["lsp-signature-face", "signature", {"inherit": "lsp-details-face"}], ["lsp-signature-highlight-function-argument", "signature highlight function argument", {"inherit": "eldoc-highlight-function-argument"}], ["lsp-signature-posframe", "signature posframe", {"inherit": "tooltip"}], ["lsp-face-highlight-read", "face highlight read", {"underline": {"style": "line", "color": null}, "inherit": "highlight"}], ["lsp-face-highlight-write", "face highlight write", {"weight": "bold", "inherit": "highlight"}], ["lsp-face-highlight-textual", "face highlight textual", {"inherit": "highlight"}], ["lsp-face-rename", "face rename", {"underline": {"style": "line", "color": null}}], ["lsp-rename-placeholder-face", "rename placeholder", {"inherit": "font-lock-variable-name-face"}], ["lsp-inlay-hint-face", "inlay hint", {"inherit": "font-lock-comment-face"}], ["lsp-inlay-hint-parameter-face", "inlay hint parameter", {"inherit": "lsp-inlay-hint-face"}], ["lsp-inlay-hint-type-face", "inlay hint type", {"inherit": "lsp-inlay-hint-face"}], ["lsp-details-face", "details", {"inherit": "shadow", "height": 0.8}], ["lsp-installation-buffer-face", "installation buffer", {"fg": "#00ff00"}], ["lsp-installation-finished-buffer-face", "installation finished buffer", {"fg": "#ffa500"}]]}, "git-gutter": {"label": "git-gutter", "preview": "gitgutter", "hover": "", "faces": [["git-gutter:added", "added", {"fg": "#00ff00", "weight": "bold", "inherit": "default"}], ["git-gutter:modified", "modified", {"fg": "#ff00ff", "weight": "bold", "inherit": "default"}], ["git-gutter:deleted", "deleted", {"fg": "#ff0000", "weight": "bold", "inherit": "default"}], ["git-gutter:unchanged", "unchanged", {"bg": "#ffff00", "inherit": "default"}], ["git-gutter:separator", "separator", {"fg": "#00ffff", "weight": "bold", "inherit": "default"}]]}, "flycheck": {"label": "flycheck", "preview": "flycheck", "hover": "", "faces": [["flycheck-error", "error", {"underline": {"style": "line", "color": null}}], ["flycheck-warning", "warning", {"underline": {"style": "line", "color": null}}], ["flycheck-info", "info", {"underline": {"style": "line", "color": null}}], ["flycheck-fringe-error", "fringe error", {"inherit": "error"}], ["flycheck-fringe-warning", "fringe warning", {"inherit": "warning"}], ["flycheck-fringe-info", "fringe info", {"inherit": "success"}], ["flycheck-delimited-error", "delimited error", {}], ["flycheck-error-delimiter", "error delimiter", {}], ["flycheck-error-list-error", "error list error", {"inherit": "error"}], ["flycheck-error-list-warning", "error list warning", {"inherit": "warning"}], ["flycheck-error-list-info", "error list info", {"inherit": "success"}], ["flycheck-error-list-error-message", "error list error message", {}], ["flycheck-error-list-checker-name", "error list checker name", {"inherit": "font-lock-function-name-face"}], ["flycheck-error-list-column-number", "error list column number", {}], ["flycheck-error-list-line-number", "error list line number", {}], ["flycheck-error-list-filename", "error list filename", {"inherit": "mode-line-buffer-id"}], ["flycheck-error-list-id", "error list id", {"inherit": "font-lock-type-face"}], ["flycheck-error-list-id-with-explainer", "error list id with explainer", {"box": {"style": "released", "width": 1, "color": null}, "inherit": "flycheck-error-list-id"}], ["flycheck-error-list-highlight", "error list highlight", {"weight": "bold"}], ["flycheck-verify-select-checker", "verify select checker", {"box": {"style": "released", "width": 1, "color": null}}]]}, "dired": {"label": "dired", "preview": "dired", "hover": "Directory-listing faces, reused by dirvish (a dired frontend).", "faces": [["dired-header", "header", {}], ["dired-directory", "directory", {}], ["dired-symlink", "symlink", {}], ["dired-broken-symlink", "broken symlink", {}], ["dired-special", "special", {}], ["dired-set-id", "set id", {}], ["dired-perm-write", "perm write", {}], ["dired-mark", "mark", {}], ["dired-marked", "marked", {}], ["dired-flagged", "flagged", {}], ["dired-ignored", "ignored", {}], ["dired-warning", "warning", {}]]}, "dirvish": {"label": "dirvish", "preview": "dirvish", "hover": "", "faces": [["dirvish-inactive", "inactive", {"inherit": "shadow"}], ["dirvish-free-space", "free space", {"inherit": "font-lock-constant-face"}], ["dirvish-hl-line", "hl line", {"extend": true, "inherit": "highlight"}], ["dirvish-hl-line-inactive", "hl line inactive", {"extend": true, "inherit": "region"}], ["dirvish-file-modes", "file modes", {"fg": "#6b6b6b"}], ["dirvish-file-link-number", "file link number", {"inherit": "font-lock-constant-face"}], ["dirvish-file-user-id", "file user id", {"inherit": "font-lock-preprocessor-face"}], ["dirvish-file-group-id", "file group id", {"inherit": "dirvish-file-user-id"}], ["dirvish-file-size", "file size", {"underline": {"style": "line", "color": null}, "inherit": "completions-annotations"}], ["dirvish-file-time", "file time", {"fg": "#979797"}], ["dirvish-file-inode-number", "file inode number", {"inherit": "dirvish-file-link-number"}], ["dirvish-file-device-number", "file device number", {"inherit": "dirvish-file-link-number"}], ["dirvish-subtree-guide", "subtree guide", {"bg": "unspecified", "underline": {"style": "line", "color": null}, "inherit": "dired-ignored"}], ["dirvish-subtree-state", "subtree state", {"bg": "unspecified", "underline": {"style": "line", "color": null}, "inherit": "dired-ignored"}], ["dirvish-collapse-dir-face", "collapse dir", {"inherit": "dired-directory"}], ["dirvish-collapse-empty-dir-face", "collapse empty dir", {"inherit": "shadow"}], ["dirvish-collapse-file-face", "collapse file", {"inherit": "default"}], ["dirvish-emerge-group-title", "emerge group title", {"inherit": "dired-ignored"}], ["dirvish-media-info-heading", "media info heading", {"inherit": ["dired-header", "bold"]}], ["dirvish-media-info-property-key", "media info property key", {"inherit": ["italic"]}], ["dirvish-narrow-match-face-0", "narrow match 0", {"fg": "#223fbf", "weight": "bold"}], ["dirvish-narrow-match-face-1", "narrow match 1", {"fg": "#8f0075", "weight": "bold"}], ["dirvish-narrow-match-face-2", "narrow match 2", {"fg": "#145a00", "weight": "bold"}], ["dirvish-narrow-match-face-3", "narrow match 3", {"fg": "#804000", "weight": "bold"}], ["dirvish-narrow-split", "narrow split", {"inherit": "font-lock-negation-char-face"}], ["dirvish-proc-running", "proc running", {"inherit": "warning"}], ["dirvish-proc-finished", "proc finished", {"inherit": "success"}], ["dirvish-proc-failed", "proc failed", {"inherit": "error"}], ["dirvish-git-commit-message-face", "git commit message", {"bg": "unspecified", "underline": {"style": "line", "color": null}, "inherit": "dired-ignored"}], ["dirvish-vc-added-state", "vc added state", {"inherit": "vc-locally-added-state"}], ["dirvish-vc-edited-state", "vc edited state", {"inherit": "vc-edited-state"}], ["dirvish-vc-removed-state", "vc removed state", {"inherit": "vc-removed-state"}], ["dirvish-vc-conflict-state", "vc conflict state", {"inherit": "vc-conflict-state"}], ["dirvish-vc-locked-state", "vc locked state", {"inherit": "vc-locked-state"}], ["dirvish-vc-missing-state", "vc missing state", {"inherit": "vc-missing-state"}], ["dirvish-vc-needs-merge-face", "vc needs merge", {"bg": "#efcbcf"}], ["dirvish-vc-needs-update-state", "vc needs update state", {"inherit": "vc-needs-update-state"}], ["dirvish-vc-unregistered-face", "vc unregistered", {"inherit": "font-lock-constant-face"}]]}, "calibredb": {"label": "calibredb", "preview": "calibredb", "hover": "", "faces": [["calibredb-search-header-library-name-face", "search header library name", {}], ["calibredb-search-header-library-path-face", "search header library path", {}], ["calibredb-search-header-total-face", "search header total", {}], ["calibredb-search-header-filter-face", "search header filter", {}], ["calibredb-search-header-sort-face", "search header sort", {}], ["calibredb-search-header-highlight-face", "search header highlight", {}], ["calibredb-id-face", "id", {}], ["calibredb-title-face", "title", {}], ["calibredb-author-face", "author", {}], ["calibredb-format-face", "format", {}], ["calibredb-size-face", "size", {}], ["calibredb-tag-face", "tag", {}], ["calibredb-date-face", "date", {}], ["calibredb-mark-face", "mark", {}], ["calibredb-series-face", "series", {}], ["calibredb-publisher-face", "publisher", {}], ["calibredb-pubdate-face", "pubdate", {}], ["calibredb-language-face", "language", {}], ["calibredb-comment-face", "comment", {}], ["calibredb-archive-face", "archive", {}], ["calibredb-favorite-face", "favorite", {}], ["calibredb-file-face", "file", {}], ["calibredb-ids-face", "ids", {}], ["calibredb-highlight-face", "highlight", {}], ["calibredb-current-page-button-face", "current page button", {}], ["calibredb-mouse-face", "mouse", {}], ["calibredb-title-detailed-view-face", "title detailed view", {}], ["calibredb-edit-annotation-header-title-face", "edit annotation header title", {}]]}, "erc": {"label": "erc", "preview": "erc", "hover": "", "faces": [["erc-header-line", "header line", {}], ["erc-timestamp-face", "timestamp", {}], ["erc-notice-face", "notice", {}], ["erc-default-face", "default", {}], ["erc-current-nick-face", "current nick", {}], ["erc-my-nick-face", "my nick", {}], ["erc-my-nick-prefix-face", "my nick prefix", {}], ["erc-nick-default-face", "nick default", {}], ["erc-nick-prefix-face", "nick prefix", {}], ["erc-button-nick-default-face", "button nick default", {}], ["erc-nick-msg-face", "nick msg", {}], ["erc-direct-msg-face", "direct msg", {}], ["erc-action-face", "action", {}], ["erc-keyword-face", "keyword", {}], ["erc-pal-face", "pal", {}], ["erc-fool-face", "fool", {}], ["erc-dangerous-host-face", "dangerous host", {}], ["erc-error-face", "error", {}], ["erc-input-face", "input", {}], ["erc-prompt-face", "prompt", {}], ["erc-command-indicator-face", "command indicator", {}], ["erc-information", "information", {}], ["erc-button", "button", {}], ["erc-bold-face", "bold", {}], ["erc-italic-face", "italic", {}], ["erc-underline-face", "underline", {}], ["erc-inverse-face", "inverse", {}], ["erc-spoiler-face", "spoiler", {}], ["erc-fill-wrap-merge-indicator-face", "fill wrap merge indicator", {}], ["erc-keep-place-indicator-arrow", "keep place indicator arrow", {}], ["erc-keep-place-indicator-line", "keep place indicator line", {}]]}, "org-drill": {"label": "org-drill", "preview": "orgdrill", "hover": "", "faces": [["org-drill-hidden-cloze-face", "hidden cloze", {}], ["org-drill-visible-cloze-face", "visible cloze", {}], ["org-drill-visible-cloze-hint-face", "visible cloze hint", {}]]}, "org-noter": {"label": "org-noter", "preview": "orgnoter", "hover": "", "faces": [["org-noter-notes-exist-face", "notes exist", {}], ["org-noter-no-notes-exist-face", "no notes exist", {}]]}, "signel": {"label": "signel", "preview": "signel", "hover": "", "faces": [["signel-timestamp-face", "timestamp", {}], ["signel-my-msg-face", "my msg", {}], ["signel-other-msg-face", "other msg", {}], ["signel-error-face", "error", {}]]}, "pearl": {"label": "pearl", "preview": "pearl", "hover": "", "faces": [["pearl-preamble-summary", "preamble summary", {}], ["pearl-editable-comment", "editable comment", {}], ["pearl-readonly-comment", "readonly comment", {}], ["pearl-modified-highlight", "modified highlight", {}], ["pearl-modified-local", "modified local", {}], ["pearl-modified-unknown", "modified unknown", {}]]}, "slack": {"label": "slack", "preview": "slack", "hover": "", "faces": [["slack-room-info-title-face", "room info title", {}], ["slack-room-info-title-room-name-face", "room info title room name", {}], ["slack-room-info-section-title-face", "room info section title", {}], ["slack-room-info-section-label-face", "room info section label", {}], ["slack-room-unread-face", "room unread", {}], ["slack-message-output-header", "message output header", {}], ["slack-message-output-text", "message output text", {}], ["slack-message-output-reaction", "message output reaction", {}], ["slack-message-output-reaction-pressed", "message output reaction pressed", {}], ["slack-message-deleted-face", "message deleted", {}], ["slack-new-message-marker-face", "new message marker", {}], ["slack-all-thread-buffer-thread-header-face", "all thread buffer thread header", {}], ["slack-message-mention-face", "message mention", {}], ["slack-message-mention-me-face", "message mention me", {}], ["slack-message-mention-keyword-face", "message mention keyword", {}], ["slack-channel-button-face", "channel button", {}], ["slack-mrkdwn-bold-face", "mrkdwn bold", {}], ["slack-mrkdwn-italic-face", "mrkdwn italic", {}], ["slack-mrkdwn-code-face", "mrkdwn code", {}], ["slack-mrkdwn-code-block-face", "mrkdwn code block", {}], ["slack-mrkdwn-strike-face", "mrkdwn strike", {}], ["slack-mrkdwn-blockquote-face", "mrkdwn blockquote", {}], ["slack-mrkdwn-list-face", "mrkdwn list", {}], ["slack-attachment-header", "attachment header", {}], ["slack-attachment-footer", "attachment footer", {}], ["slack-attachment-pad", "attachment pad", {}], ["slack-attachment-field-title", "attachment field title", {}], ["slack-message-attachment-preview-header-face", "message attachment preview header", {}], ["slack-preview-face", "preview", {}], ["slack-block-highlight-source-overlay-face", "block highlight source overlay", {}], ["slack-message-action-face", "message action", {}], ["slack-message-action-primary-face", "message action primary", {}], ["slack-message-action-danger-face", "message action danger", {}], ["slack-button-block-element-face", "button block element", {}], ["slack-button-primary-block-element-face", "button primary block element", {}], ["slack-button-danger-block-element-face", "button danger block element", {}], ["slack-select-block-element-face", "select block element", {}], ["slack-overflow-block-element-face", "overflow block element", {}], ["slack-date-picker-block-element-face", "date picker block element", {}], ["slack-dialog-title-face", "dialog title", {}], ["slack-dialog-element-label-face", "dialog element label", {}], ["slack-dialog-element-hint-face", "dialog element hint", {}], ["slack-dialog-element-placeholder-face", "dialog element placeholder", {}], ["slack-dialog-element-error-face", "dialog element error", {}], ["slack-dialog-submit-button-face", "dialog submit button", {}], ["slack-dialog-cancel-button-face", "dialog cancel button", {}], ["slack-dialog-select-element-input-face", "dialog select element input", {}], ["slack-user-active-face", "user active", {}], ["slack-user-dnd-face", "user dnd", {}], ["slack-user-profile-header-face", "user profile header", {}], ["slack-user-profile-property-name-face", "user profile property name", {}], ["slack-profile-image-face", "profile image", {}], ["slack-search-result-message-header-face", "search result message header", {}], ["slack-search-result-message-username-face", "search result message username", {}], ["slack-modeline-has-unreads-face", "modeline has unreads", {}], ["slack-modeline-channel-has-unreads-face", "modeline channel has unreads", {}], ["slack-modeline-thread-has-unreads-face", "modeline thread has unreads", {}]]}, "telega": {"label": "telega", "preview": "telega", "hover": "", "faces": [["telega-root-heading", "root heading", {}], ["telega-tracking", "tracking", {}], ["telega-unread-unmuted-modeline", "unread unmuted modeline", {}], ["telega-username", "username", {}], ["telega-user-online-status", "user online status", {}], ["telega-user-non-online-status", "user non online status", {}], ["telega-secret-title", "secret title", {}], ["telega-contact-birthdays-today", "contact birthdays today", {}], ["telega-muted-count", "muted count", {}], ["telega-unmuted-count", "unmuted count", {}], ["telega-mention-count", "mention count", {}], ["telega-has-chatbuf-brackets", "has chatbuf brackets", {}], ["telega-delim-face", "delim", {}], ["telega-shadow", "shadow", {}], ["telega-link", "link", {}], ["telega-blue", "blue", {}], ["telega-red", "red", {}], ["telega-msg-heading", "msg heading", {}], ["telega-msg-user-title", "msg user title", {}], ["telega-msg-self-title", "msg self title", {}], ["telega-msg-deleted", "msg deleted", {}], ["telega-msg-sponsored", "msg sponsored", {}], ["telega-msg-inline-reply", "msg inline reply", {}], ["telega-msg-inline-forward", "msg inline forward", {}], ["telega-msg-inline-other", "msg inline other", {}], ["telega-entity-type-bold", "entity type bold", {}], ["telega-entity-type-italic", "entity type italic", {}], ["telega-entity-type-underline", "entity type underline", {}], ["telega-entity-type-strikethrough", "entity type strikethrough", {}], ["telega-entity-type-code", "entity type code", {}], ["telega-entity-type-pre", "entity type pre", {}], ["telega-entity-type-blockquote", "entity type blockquote", {}], ["telega-entity-type-mention", "entity type mention", {}], ["telega-entity-type-hashtag", "entity type hashtag", {}], ["telega-entity-type-cashtag", "entity type cashtag", {}], ["telega-entity-type-botcommand", "entity type botcommand", {}], ["telega-entity-type-texturl", "entity type texturl", {}], ["telega-entity-type-spoiler", "entity type spoiler", {}], ["telega-reaction", "reaction", {}], ["telega-reaction-chosen", "reaction chosen", {}], ["telega-reaction-paid", "reaction paid", {}], ["telega-reaction-paid-chosen", "reaction paid chosen", {}], ["telega-highlight-text-face", "highlight text", {}], ["telega-button-highlight", "button highlight", {}], ["telega-chat-prompt", "chat prompt", {}], ["telega-chat-prompt-aux", "chat prompt aux", {}], ["telega-chat-input-attachment", "chat input attachment", {}], ["telega-topic-button", "topic button", {}], ["telega-filter-active", "filter active", {}], ["telega-filter-button-active", "filter button active", {}], ["telega-filter-button-inactive", "filter button inactive", {}], ["telega-checklist-stats-done", "checklist stats done", {}], ["telega-checklist-stats-todo", "checklist stats todo", {}], ["telega-box-button", "box button", {}], ["telega-box-button-active", "box button active", {}], ["telega-box-button-default-active", "box button default active", {}], ["telega-box-button-default-passive", "box button default passive", {}], ["telega-box-button-primary-active", "box button primary active", {}], ["telega-box-button-primary-passive", "box button primary passive", {}], ["telega-box-button-success-active", "box button success active", {}], ["telega-box-button-success-passive", "box button success passive", {}], ["telega-box-button-danger-active", "box button danger active", {}], ["telega-box-button-danger-passive", "box button danger passive", {}], ["telega-box-button-ui-active", "box button ui active", {}], ["telega-box-button-ui-passive", "box button ui passive", {}], ["telega-box-button2-active", "box button2 active", {}], ["telega-box-button2-passive", "box button2 passive", {}], ["telega-box-button2-white-foreground", "box button2 white foreground", {}], ["telega-describe-item-title", "describe item title", {}], ["telega-describe-section-title", "describe section title", {}], ["telega-describe-subsection-title", "describe subsection title", {}], ["telega-enckey-00", "enckey 00", {}], ["telega-enckey-01", "enckey 01", {}], ["telega-enckey-10", "enckey 10", {}], ["telega-enckey-11", "enckey 11", {}], ["telega-palette-builtin-blue", "palette builtin blue", {}], ["telega-palette-builtin-green", "palette builtin green", {}], ["telega-palette-builtin-orange", "palette builtin orange", {}], ["telega-palette-builtin-purple", "palette builtin purple", {}], ["telega-webpage-title", "webpage title", {}], ["telega-webpage-subtitle", "webpage subtitle", {}], ["telega-webpage-header", "webpage header", {}], ["telega-webpage-subheader", "webpage subheader", {}], ["telega-webpage-outline", "webpage outline", {}], ["telega-webpage-fixed", "webpage fixed", {}], ["telega-webpage-preformatted", "webpage preformatted", {}], ["telega-webpage-marked", "webpage marked", {}], ["telega-webpage-strike-through", "webpage strike through", {}], ["telega-webpage-chat-link", "webpage chat link", {}], ["telega-link-preview-sitename", "link preview sitename", {}], ["telega-link-preview-title", "link preview title", {}]]}, "shr": {"label": "simple html renderer (shr)", "preview": "shr", "hover": "Simple HTML Renderer. Reused by eww, nov (epub reading), and mu4e / message for HTML mail.", "faces": [["shr-h1", "h1", {}], ["shr-h2", "h2", {}], ["shr-h3", "h3", {}], ["shr-h4", "h4", {}], ["shr-h5", "h5", {}], ["shr-h6", "h6", {}], ["shr-text", "text", {}], ["shr-link", "link", {}], ["shr-selected-link", "selected link", {}], ["shr-code", "code", {}], ["shr-mark", "mark", {}], ["shr-strike-through", "strike through", {}], ["shr-sup", "sup", {}], ["shr-abbreviation", "abbreviation", {}], ["shr-sliced-image", "sliced image", {}]]}, "nerd-icons": {"label": "nerd-icons", "preview": "nerdicons", "faces": [["nerd-icons-blue", "blue", {"fg": "#6a9fb5"}], ["nerd-icons-blue-alt", "blue alt", {"fg": "#2188b6"}], ["nerd-icons-cyan", "cyan", {"fg": "#75b5aa"}], ["nerd-icons-cyan-alt", "cyan alt", {"fg": "#0595bd"}], ["nerd-icons-dblue", "dblue", {"fg": "#446674"}], ["nerd-icons-dcyan", "dcyan", {"fg": "#48746d"}], ["nerd-icons-dgreen", "dgreen", {"fg": "#6d8143"}], ["nerd-icons-dmaroon", "dmaroon", {"fg": "#72584b"}], ["nerd-icons-dorange", "dorange", {"fg": "#915b2d"}], ["nerd-icons-dpink", "dpink", {"fg": "#7e5d5f"}], ["nerd-icons-dpurple", "dpurple", {"fg": "#694863"}], ["nerd-icons-dred", "dred", {"fg": "#843031"}], ["nerd-icons-dsilver", "dsilver", {"fg": "#838484"}], ["nerd-icons-dyellow", "dyellow", {"fg": "#b48d56"}], ["nerd-icons-green", "green", {"fg": "#90a959"}], ["nerd-icons-lblue", "lblue", {"fg": "#677174"}], ["nerd-icons-lcyan", "lcyan", {"fg": "#2c7d6e"}], ["nerd-icons-lgreen", "lgreen", {"fg": "#3d6837"}], ["nerd-icons-lmaroon", "lmaroon", {"fg": "#ce7a4e"}], ["nerd-icons-lorange", "lorange", {"fg": "#ffa500"}], ["nerd-icons-lpink", "lpink", {"fg": "#ff505b"}], ["nerd-icons-lpurple", "lpurple", {"fg": "#e69dd6"}], ["nerd-icons-lred", "lred", {"fg": "#eb595a"}], ["nerd-icons-lsilver", "lsilver", {"fg": "#7f7869"}], ["nerd-icons-lyellow", "lyellow", {"fg": "#ff9300"}], ["nerd-icons-maroon", "maroon", {"fg": "#8f5536"}], ["nerd-icons-orange", "orange", {"fg": "#d4843e"}], ["nerd-icons-pink", "pink", {"fg": "#fc505b"}], ["nerd-icons-purple", "purple", {"fg": "#68295b"}], ["nerd-icons-purple-alt", "purple alt", {"fg": "#5d54e1"}], ["nerd-icons-red", "red", {"fg": "#ac4142"}], ["nerd-icons-red-alt", "red alt", {"fg": "#843031"}], ["nerd-icons-silver", "silver", {"fg": "#716e68"}], ["nerd-icons-yellow", "yellow", {"fg": "#ffcc0e"}]], "legend": [{"key": "ext:el", "label": "init.el", "face": "nerd-icons-purple", "category": "extension", "glyph": "\ue632"}, {"key": "ext:py", "label": "app.py", "face": "nerd-icons-dblue", "category": "extension", "glyph": "\ue73c"}, {"key": "ext:org", "label": "notes.org", "face": "nerd-icons-lgreen", "category": "extension", "glyph": "\ue633"}, {"key": "ext:md", "label": "README.md", "face": "nerd-icons-lblue", "category": "extension", "glyph": "\uf48a"}, {"key": "ext:ts", "label": "main.ts", "face": "nerd-icons-blue-alt", "category": "extension", "glyph": "\udb81\udee6"}, {"key": "ext:html", "label": "index.html", "face": "nerd-icons-orange", "category": "extension", "glyph": "\ue736"}, {"key": "ext:rs", "label": "lib.rs", "face": "nerd-icons-maroon", "category": "extension", "glyph": "\ue7a8"}, {"key": "ext:js", "label": "app.js", "face": "nerd-icons-yellow", "category": "extension", "glyph": "\ue781"}, {"key": "ext:yml", "label": "ci.yml", "face": "nerd-icons-dyellow", "category": "extension", "glyph": "\ueb52"}, {"key": "ext:c", "label": "main.c", "face": "nerd-icons-blue", "category": "extension", "glyph": "\ue61e"}, {"key": "dir", "label": "src/", "face": "nerd-icons-yellow", "category": "dir", "glyph": "\ue6ad"}, {"key": "cmd", "label": "M-x command", "face": "nerd-icons-blue", "category": "command", "glyph": "\uea8c"}, {"key": "buf", "label": "*scratch*", "face": "nerd-icons-purple", "category": "buffer", "glyph": "\ue632"}], "gallery": [{"face": "nerd-icons-dpink", "hue": 5, "glyphs": [{"glyph": "\udb84\udd83", "name": "nf-md-bash"}, {"glyph": "\udb82\udc77", "name": "nf-md-graphql"}, {"glyph": "\udb81\udfec", "name": "nf-md-sass"}, {"glyph": "\ue662", "name": "nf-seti-graphql"}, {"glyph": "\ue67a", "name": "nf-seti-ocaml"}]}, {"face": "nerd-icons-pink", "hue": 5, "glyphs": [{"glyph": "\ue711", "name": "nf-dev-apple"}, {"glyph": "\udb81\udfec", "name": "nf-md-sass"}, {"glyph": "\uf4ae", "name": "nf-oct-code_of_conduct"}]}, {"face": "nerd-icons-dorange", "hue": 13, "glyphs": [{"glyph": "\ueb52", "name": "nf-cod-settings"}, {"glyph": "\ue779", "name": "nf-dev-gnu"}, {"glyph": "\ue7a8", "name": "nf-dev-rust"}, {"glyph": "\uf43d", "name": "nf-oct-key"}, {"glyph": "\ue673", "name": "nf-seti-makefile"}]}, {"face": "nerd-icons-lorange", "hue": 13, "glyphs": [{"glyph": "\ue6b0", "name": "nf-custom-common_lisp"}, {"glyph": "\ue62d", "name": "nf-custom-elixir"}, {"glyph": "\ue74d", "name": "nf-dev-bower"}, {"glyph": "\uf1c9", "name": "nf-fa-file_code_o"}, {"glyph": "\uf143", "name": "nf-fa-rss_square"}, {"glyph": "\ue62d", "name": "nf-seti-elixir"}, {"glyph": "\ue67e", "name": "nf-seti-perl"}]}, {"face": "nerd-icons-lred", "hue": 13, "glyphs": [{"glyph": "\ueb9c", "name": "nf-cod-library"}, {"glyph": "\ueb48", "name": "nf-cod-ruby"}, {"glyph": "\ue763", "name": "nf-dev-gulp"}, {"glyph": "\ue736", "name": "nf-dev-html5"}, {"glyph": "\ue807", "name": "nf-dev-jest"}, {"glyph": "\ue755", "name": "nf-dev-swift"}, {"glyph": "\uf022", "name": "nf-fa-list_alt"}, {"glyph": "\uf200", "name": "nf-fa-pie_chart"}, {"glyph": "\udb80\ude19", "name": "nf-md-file_document"}, {"glyph": "\uf4d2", "name": "nf-oct-file_diff"}, {"glyph": "\ue62d", "name": "nf-seti-elixir"}, {"glyph": "\ue65d", "name": "nf-seti-git"}, {"glyph": "\ue69b", "name": "nf-seti-tex"}]}, {"face": "nerd-icons-orange", "hue": 13, "glyphs": [{"glyph": "\ueb52", "name": "nf-cod-settings"}, {"glyph": "\ue6b0", "name": "nf-custom-common_lisp"}, {"glyph": "\ue632", "name": "nf-custom-emacs"}, {"glyph": "\ue634", "name": "nf-custom-kotlin"}, {"glyph": "\ue6b1", "name": "nf-custom-scheme"}, {"glyph": "\ue6b2", "name": "nf-custom-toml"}, {"glyph": "\ue7ad", "name": "nf-dev-aws"}, {"glyph": "\ue7bc", "name": "nf-dev-d3js"}, {"glyph": "\ue7eb", "name": "nf-dev-gitlab"}, {"glyph": "\ue736", "name": "nf-dev-html5"}, {"glyph": "\ue80f", "name": "nf-dev-jupyter"}, {"glyph": "\ue82a", "name": "nf-dev-matlab"}, {"glyph": "\uf143", "name": "nf-fa-rss_square"}, {"glyph": "\udb81\uddee", "name": "nf-md-disc"}, {"glyph": "\udb83\ude2d", "name": "nf-md-file_png_box"}, {"glyph": "\udb80\ude27", "name": "nf-md-file_powerpoint"}, {"glyph": "\udb81\uddc4", "name": "nf-md-zip_box"}, {"glyph": "\uf43d", "name": "nf-oct-key"}, {"glyph": "\ue666", "name": "nf-seti-haxe"}, {"glyph": "\ue634", "name": "nf-seti-kotlin"}, {"glyph": "\ue6a9", "name": "nf-seti-zig"}, {"glyph": "\ue6aa", "name": "nf-seti-zip"}]}, {"face": "nerd-icons-red", "hue": 14, "glyphs": [{"glyph": "\ueb48", "name": "nf-cod-ruby"}, {"glyph": "\ue6b1", "name": "nf-custom-scheme"}, {"glyph": "\ue794", "name": "nf-dev-cmake"}, {"glyph": "\ue7b1", "name": "nf-dev-erlang"}, {"glyph": "\ue725", "name": "nf-dev-git_branch"}, {"glyph": "\ue728", "name": "nf-dev-git_compare"}, {"glyph": "\ue777", "name": "nf-dev-haskell"}, {"glyph": "\ue71e", "name": "nf-dev-npm"}, {"glyph": "\ue737", "name": "nf-dev-scala"}, {"glyph": "\uf269", "name": "nf-fa-firefox"}, {"glyph": "\uf1fc", "name": "nf-fa-paint_brush"}, {"glyph": "\uf303", "name": "nf-linux-archlinux"}, {"glyph": "\udb81\ude1a", "name": "nf-md-chip"}, {"glyph": "\udb86\ude9d", "name": "nf-md-file_document_plus"}, {"glyph": "\uf417", "name": "nf-oct-git_commit"}, {"glyph": "\uf419", "name": "nf-oct-git_merge"}, {"glyph": "\uf456", "name": "nf-oct-lock"}, {"glyph": "\ue65d", "name": "nf-seti-git"}, {"glyph": "\ue66c", "name": "nf-seti-jade"}, {"glyph": "\ue686", "name": "nf-seti-pug"}, {"glyph": "\ue68d", "name": "nf-seti-sbt"}, {"glyph": "\ue697", "name": "nf-seti-svelte"}]}, {"face": "nerd-icons-red-alt", "hue": 14, "glyphs": [{"glyph": "\ue687", "name": "nf-seti-reasonml"}]}, {"face": "nerd-icons-maroon", "hue": 15, "glyphs": [{"glyph": "\ue751", "name": "nf-dev-coffeescript"}, {"glyph": "\ue7a8", "name": "nf-dev-rust"}, {"glyph": "\uf456", "name": "nf-oct-lock"}, {"glyph": "\uf4ed", "name": "nf-oct-log"}]}, {"face": "nerd-icons-lmaroon", "hue": 15, "glyphs": [{"glyph": "\ue751", "name": "nf-dev-coffeescript"}, {"glyph": "\ue7a1", "name": "nf-dev-prolog"}, {"glyph": "\udb80\udeea", "name": "nf-md-image_album"}, {"glyph": "\uf471", "name": "nf-oct-file_binary"}, {"glyph": "\uf410", "name": "nf-oct-file_zip"}, {"glyph": "\ue685", "name": "nf-seti-prolog"}]}, {"face": "nerd-icons-dred", "hue": 15, "glyphs": [{"glyph": "\ueaeb", "name": "nf-cod-file_pdf"}, {"glyph": "\ueb48", "name": "nf-cod-ruby"}, {"glyph": "\ue7b1", "name": "nf-dev-erlang"}, {"glyph": "\ue71e", "name": "nf-dev-npm"}, {"glyph": "\uf031", "name": "nf-fa-font"}, {"glyph": "\uf001", "name": "nf-fa-music"}, {"glyph": "\udb81\uded3", "name": "nf-md-feather"}, {"glyph": "\udb81\udff5", "name": "nf-md-form_textbox_password"}, {"glyph": "\udb80\udee9", "name": "nf-md-image"}, {"glyph": "\udb83\udcb9", "name": "nf-md-playlist_music_outline"}, {"glyph": "\ue687", "name": "nf-seti-reasonml"}]}, {"face": "nerd-icons-dmaroon", "hue": 15, "glyphs": [{"glyph": "\ue7a8", "name": "nf-dev-rust"}]}, {"face": "nerd-icons-lyellow", "hue": 45, "glyphs": [{"glyph": "\ueb52", "name": "nf-cod-settings"}, {"glyph": "\ue768", "name": "nf-dev-clojure"}, {"glyph": "\ue76a", "name": "nf-dev-clojure_alt"}, {"glyph": "\ue74c", "name": "nf-dev-grunt"}, {"glyph": "\uf249", "name": "nf-fa-sticky_note"}, {"glyph": "\uf45e", "name": "nf-oct-checklist"}, {"glyph": "\ue62d", "name": "nf-seti-elixir"}, {"glyph": "\ue664", "name": "nf-seti-haml"}, {"glyph": "\ue695", "name": "nf-seti-stylelint"}]}, {"face": "nerd-icons-dyellow", "hue": 45, "glyphs": [{"glyph": "\ueb52", "name": "nf-cod-settings"}, {"glyph": "\ue758", "name": "nf-dev-less"}, {"glyph": "\ue7a8", "name": "nf-dev-rust"}]}, {"face": "nerd-icons-yellow", "hue": 45, "glyphs": [{"glyph": "\ueacd", "name": "nf-cod-dashboard"}, {"glyph": "\ueb52", "name": "nf-cod-settings"}, {"glyph": "\ue62f", "name": "nf-custom-crystal"}, {"glyph": "\ue632", "name": "nf-custom-emacs"}, {"glyph": "\ue741", "name": "nf-dev-awk"}, {"glyph": "\ue749", "name": "nf-dev-css3"}, {"glyph": "\ue781", "name": "nf-dev-javascript"}, {"glyph": "\ue87d", "name": "nf-dev-qt"}, {"glyph": "\ue7a8", "name": "nf-dev-rust"}, {"glyph": "\ue8d9", "name": "nf-dev-vitest"}, {"glyph": "\uf0e7", "name": "nf-fa-bolt"}, {"glyph": "\uf143", "name": "nf-fa-rss_square"}, {"glyph": "\uf249", "name": "nf-fa-sticky_note"}, {"glyph": "\udb82\ude25", "name": "nf-md-babel"}, {"glyph": "\udb81\ude26", "name": "nf-md-code_json"}, {"glyph": "\uf4ed", "name": "nf-oct-log"}, {"glyph": "\ue639", "name": "nf-seti-babel"}, {"glyph": "\ue62f", "name": "nf-seti-crystal"}, {"glyph": "\ue677", "name": "nf-seti-nim"}, {"glyph": "\ue631", "name": "nf-seti-puppet"}]}, {"face": "nerd-icons-green", "hue": 79, "glyphs": [{"glyph": "\ueacd", "name": "nf-cod-dashboard"}, {"glyph": "\ue6b5", "name": "nf-custom-ada"}, {"glyph": "\ue61e", "name": "nf-custom-c"}, {"glyph": "\ue768", "name": "nf-dev-clojure"}, {"glyph": "\ue76a", "name": "nf-dev-clojure_alt"}, {"glyph": "\ue718", "name": "nf-dev-nodejs_small"}, {"glyph": "\ue795", "name": "nf-dev-terminal"}, {"glyph": "\uee36", "name": "nf-fa-file_arrow_down"}, {"glyph": "\uf0fd", "name": "nf-fa-h_square"}, {"glyph": "\uf001", "name": "nf-fa-music"}, {"glyph": "\uf1ea", "name": "nf-fa-newspaper"}, {"glyph": "\uf1fc", "name": "nf-fa-paint_brush"}, {"glyph": "\udb80\udcbd", "name": "nf-md-book_open"}, {"glyph": "\udb83\udd78", "name": "nf-md-file_gif_box"}, {"glyph": "\udb84\udce2", "name": "nf-md-file_table_box_multiple"}, {"glyph": "\udb80\udf1b", "name": "nf-md-language_csharp"}, {"glyph": "\uf472", "name": "nf-oct-database"}, {"glyph": "\uf43d", "name": "nf-oct-key"}, {"glyph": "\ue65d", "name": "nf-seti-git"}]}, {"face": "nerd-icons-dgreen", "hue": 79, "glyphs": [{"glyph": "\ue62b", "name": "nf-custom-vim"}, {"glyph": "\ue72b", "name": "nf-dev-apache"}, {"glyph": "\ue776", "name": "nf-dev-nginx"}, {"glyph": "\udb80\ude1b", "name": "nf-md-file_excel"}, {"glyph": "\uf4d2", "name": "nf-oct-file_diff"}, {"glyph": "\uf40f", "name": "nf-oct-file_media"}, {"glyph": "\uf4ed", "name": "nf-oct-log"}]}, {"face": "nerd-icons-lgreen", "hue": 83, "glyphs": [{"glyph": "\ue633", "name": "nf-custom-orgmode"}, {"glyph": "\ue794", "name": "nf-dev-cmake"}, {"glyph": "\ue769", "name": "nf-dev-perl"}, {"glyph": "\ue759", "name": "nf-dev-stylus"}, {"glyph": "\uf1ea", "name": "nf-fa-newspaper"}, {"glyph": "\udb82\udd84", "name": "nf-md-map_search"}, {"glyph": "\udb80\udf99", "name": "nf-md-nodejs"}, {"glyph": "\uf45e", "name": "nf-oct-checklist"}, {"glyph": "\uf4d2", "name": "nf-oct-file_diff"}, {"glyph": "\ue698", "name": "nf-seti-svg"}, {"glyph": "\ue6a0", "name": "nf-seti-vue"}]}, {"face": "nerd-icons-cyan", "hue": 189, "glyphs": [{"glyph": "\ue775", "name": "nf-dev-groovy"}, {"glyph": "\uf080", "name": "nf-fa-bar_chart"}, {"glyph": "\uf15c", "name": "nf-fa-file_text"}, {"glyph": "\uf031", "name": "nf-fa-font"}, {"glyph": "\uf303", "name": "nf-linux-archlinux"}, {"glyph": "\udb85\udd17", "name": "nf-md-file_document_multiple"}, {"glyph": "\udb80\ude27", "name": "nf-md-file_powerpoint"}, {"glyph": "\udb82\udce8", "name": "nf-md-gentoo"}, {"glyph": "\udb82\udfc2", "name": "nf-md-script_text"}, {"glyph": "\udb81\udcce", "name": "nf-md-star"}, {"glyph": "\ue650", "name": "nf-seti-docker"}]}, {"face": "nerd-icons-dcyan", "hue": 190, "glyphs": [{"glyph": "\uf031", "name": "nf-fa-font"}]}, {"face": "nerd-icons-cyan-alt", "hue": 192, "glyphs": [{"glyph": "\ue775", "name": "nf-dev-groovy"}]}, {"face": "nerd-icons-lcyan", "hue": 197, "glyphs": [{"glyph": "\ueb9c", "name": "nf-cod-library"}, {"glyph": "\ue795", "name": "nf-dev-terminal"}, {"glyph": "\uf405", "name": "nf-oct-book"}]}, {"face": "nerd-icons-lsilver", "hue": 210, "glyphs": [{"glyph": "\uebc4", "name": "nf-cod-terminal_cmd"}, {"glyph": "\ue73d", "name": "nf-dev-php"}, {"glyph": "\ue795", "name": "nf-dev-terminal"}, {"glyph": "\uf0fc", "name": "nf-fa-beer"}, {"glyph": "\uf013", "name": "nf-fa-cog"}, {"glyph": "\udb84\udc7b", "name": "nf-md-file_cog"}, {"glyph": "\udb83\udd13", "name": "nf-md-fountain_pen_tip"}, {"glyph": "\uf425", "name": "nf-oct-tools"}, {"glyph": "\ue673", "name": "nf-seti-makefile"}]}, {"face": "nerd-icons-silver", "hue": 210, "glyphs": [{"glyph": "\ue6b4", "name": "nf-custom-prettier"}, {"glyph": "\ue74d", "name": "nf-dev-bower"}, {"glyph": "\ue706", "name": "nf-dev-database"}, {"glyph": "\uf187", "name": "nf-fa-archive"}, {"glyph": "\uf085", "name": "nf-fa-cogs"}, {"glyph": "\uf001", "name": "nf-fa-music"}, {"glyph": "\uf472", "name": "nf-oct-database"}, {"glyph": "\ue652", "name": "nf-seti-editorconfig"}, {"glyph": "\ue660", "name": "nf-seti-gradle"}, {"glyph": "\ue66f", "name": "nf-seti-jinja"}]}, {"face": "nerd-icons-dsilver", "hue": 210, "glyphs": [{"glyph": "\ueae8", "name": "nf-cod-file_binary"}, {"glyph": "\ue632", "name": "nf-custom-emacs"}, {"glyph": "\ue73c", "name": "nf-dev-python"}, {"glyph": "\uf1c9", "name": "nf-fa-file_code"}, {"glyph": "\uf0c5", "name": "nf-fa-files_o"}, {"glyph": "\uf369", "name": "nf-linux-xorg"}, {"glyph": "\uf471", "name": "nf-oct-file_binary"}, {"glyph": "\uf42f", "name": "nf-oct-mail"}, {"glyph": "\uf487", "name": "nf-oct-package"}]}, {"face": "nerd-icons-lblue", "hue": 211, "glyphs": [{"glyph": "\ueb9c", "name": "nf-cod-library"}, {"glyph": "\ue632", "name": "nf-custom-emacs"}, {"glyph": "\ue7d2", "name": "nf-dev-eslint"}, {"glyph": "\ue728", "name": "nf-dev-git_compare"}, {"glyph": "\ue7ba", "name": "nf-dev-react"}, {"glyph": "\ue8e3", "name": "nf-dev-webpack"}, {"glyph": "\uf1c9", "name": "nf-fa-file_code_o"}, {"glyph": "\uf120", "name": "nf-fa-terminal"}, {"glyph": "\udb80\udcba", "name": "nf-md-book"}, {"glyph": "\udb81\ude70", "name": "nf-md-file_restore"}, {"glyph": "\uf43d", "name": "nf-oct-key"}, {"glyph": "\uf48a", "name": "nf-oct-markdown"}, {"glyph": "\ue650", "name": "nf-seti-docker"}, {"glyph": "\ue62d", "name": "nf-seti-elixir"}, {"glyph": "\ue68a", "name": "nf-seti-r"}]}, {"face": "nerd-icons-blue", "hue": 212, "glyphs": [{"glyph": "\ue6b5", "name": "nf-custom-ada"}, {"glyph": "\ue61e", "name": "nf-custom-c"}, {"glyph": "\ue61d", "name": "nf-custom-cpp"}, {"glyph": "\ue62c", "name": "nf-custom-elm"}, {"glyph": "\ue632", "name": "nf-custom-emacs"}, {"glyph": "\ue6b1", "name": "nf-custom-scheme"}, {"glyph": "\ue768", "name": "nf-dev-clojure"}, {"glyph": "\ue76a", "name": "nf-dev-clojure_alt"}, {"glyph": "\ue794", "name": "nf-dev-cmake"}, {"glyph": "\ue798", "name": "nf-dev-dart"}, {"glyph": "\ue7a7", "name": "nf-dev-fsharp"}, {"glyph": "\ue767", "name": "nf-dev-jenkins"}, {"glyph": "\ue795", "name": "nf-dev-terminal"}, {"glyph": "\uf293", "name": "nf-fa-bluetooth"}, {"glyph": "\uf02d", "name": "nf-fa-book"}, {"glyph": "\uf268", "name": "nf-fa-chrome"}, {"glyph": "\uf008", "name": "nf-fa-film"}, {"glyph": "\uf129", "name": "nf-fa-info"}, {"glyph": "\uf0d0", "name": "nf-fa-magic"}, {"glyph": "\uf1fc", "name": "nf-fa-paint_brush"}, {"glyph": "\ue217", "name": "nf-fae-telegram"}, {"glyph": "\udb80\udcba", "name": "nf-md-book"}, {"glyph": "\udb81\udde6", "name": "nf-md-copyright"}, {"glyph": "\udb80\ude2c", "name": "nf-md-file_word"}, {"glyph": "\udb82\udce8", "name": "nf-md-gentoo"}, {"glyph": "\udb81\udee6", "name": "nf-md-language_typescript"}, {"glyph": "\udb82\uded1", "name": "nf-md-mastodon"}, {"glyph": "\udb84\udd05", "name": "nf-md-nix"}, {"glyph": "\udb82\ude0a", "name": "nf-md-powershell"}, {"glyph": "\uf4bc", "name": "nf-oct-cpu"}, {"glyph": "\uf4d1", "name": "nf-oct-file_badge"}, {"glyph": "\uf40f", "name": "nf-oct-file_media"}, {"glyph": "\uf43d", "name": "nf-oct-key"}, {"glyph": "\uf412", "name": "nf-oct-tag"}, {"glyph": "\ue637", "name": "nf-seti-asm"}, {"glyph": "\ue642", "name": "nf-seti-clojure"}, {"glyph": "\ue650", "name": "nf-seti-docker"}, {"glyph": "\ue62c", "name": "nf-seti-elm"}, {"glyph": "\ue65e", "name": "nf-seti-go2"}, {"glyph": "\ue65f", "name": "nf-seti-godot"}]}, {"face": "nerd-icons-dblue", "hue": 212, "glyphs": [{"glyph": "\ueb9c", "name": "nf-cod-library"}, {"glyph": "\ue7b0", "name": "nf-dev-docker"}, {"glyph": "\ue73c", "name": "nf-dev-python"}, {"glyph": "\uf008", "name": "nf-fa-film"}, {"glyph": "\uf1fc", "name": "nf-fa-paint_brush"}, {"glyph": "\udb80\ude25", "name": "nf-md-file_jpg_box"}, {"glyph": "\udb80\udf1b", "name": "nf-md-language_csharp"}, {"glyph": "\uf472", "name": "nf-oct-database"}, {"glyph": "\uf40f", "name": "nf-oct-file_media"}, {"glyph": "\uf437", "name": "nf-oct-graph"}, {"glyph": "\ue620", "name": "nf-seti-lua"}]}, {"face": "nerd-icons-blue-alt", "hue": 213, "glyphs": [{"glyph": "\ue7a7", "name": "nf-dev-fsharp"}, {"glyph": "\udb81\udee6", "name": "nf-md-language_typescript"}, {"glyph": "\udb81\udf08", "name": "nf-md-react"}, {"glyph": "\ue615", "name": "nf-seti-config"}, {"glyph": "\ue6a7", "name": "nf-seti-yarn"}]}, {"face": "nerd-icons-lpurple", "hue": 265, "glyphs": [{"glyph": "\udb83\udc7a", "name": "nf-md-eslint"}, {"glyph": "\udb80\udf1e", "name": "nf-md-language_javascript"}, {"glyph": "\ue62d", "name": "nf-seti-elixir"}]}, {"face": "nerd-icons-purple", "hue": 272, "glyphs": [{"glyph": "\ue61d", "name": "nf-custom-cpp"}, {"glyph": "\ue632", "name": "nf-custom-emacs"}, {"glyph": "\ue738", "name": "nf-dev-java"}, {"glyph": "\ue795", "name": "nf-dev-terminal"}, {"glyph": "\uf0fd", "name": "nf-fa-h_square"}, {"glyph": "\uf129", "name": "nf-fa-info"}, {"glyph": "\uf1fc", "name": "nf-fa-paint_brush"}, {"glyph": "\ue217", "name": "nf-fae-telegram"}, {"glyph": "\udb83\udc7a", "name": "nf-md-eslint"}, {"glyph": "\udb84\ude1a", "name": "nf-md-language_fortran"}, {"glyph": "\udb81\ude10", "name": "nf-md-microsoft_visual_studio"}, {"glyph": "\ue624", "name": "nf-seti-julia"}, {"glyph": "\ue673", "name": "nf-seti-makefile"}]}, {"face": "nerd-icons-purple-alt", "hue": 272, "glyphs": [{"glyph": "\ue8e0", "name": "nf-dev-wasm"}, {"glyph": "\udb84\udc62", "name": "nf-md-terraform"}, {"glyph": "\ue6a1", "name": "nf-seti-wasm"}]}, {"face": "nerd-icons-dpurple", "hue": 272, "glyphs": [{"glyph": "\ue738", "name": "nf-dev-java"}, {"glyph": "\uf0e6", "name": "nf-fa-comments_o"}, {"glyph": "\uf01c", "name": "nf-fa-inbox"}, {"glyph": "\uf129", "name": "nf-fa-info"}, {"glyph": "\uf03a", "name": "nf-fa-list"}, {"glyph": "\uf1fc", "name": "nf-fa-paint_brush"}, {"glyph": "\uf002", "name": "nf-fa-search"}, {"glyph": "\uf0ce", "name": "nf-fa-table"}]}, {"face": "nerd-icons-lpink", "hue": 356, "glyphs": [{"glyph": "\ue795", "name": "nf-dev-terminal"}, {"glyph": "\uf461", "name": "nf-oct-bookmark"}, {"glyph": "\ue67a", "name": "nf-seti-ocaml"}]}]}, "2048-game": {"label": "2048-game", "preview": "generic", "faces": [["twentyfortyeight-face-1024", "twentyfortyeight 1024", {"fg": "#000000", "bg": "#ffd700"}], ["twentyfortyeight-face-128", "twentyfortyeight 128", {"fg": "#ffffff", "bg": "#8b0000"}], ["twentyfortyeight-face-16", "twentyfortyeight 16", {"fg": "#000000", "bg": "#ffa500"}], ["twentyfortyeight-face-2", "twentyfortyeight 2", {"fg": "#000000", "bg": "#f0e68c"}], ["twentyfortyeight-face-2048", "twentyfortyeight 2048", {"fg": "#000000", "bg": "#ffff00"}], ["twentyfortyeight-face-256", "twentyfortyeight 256", {"fg": "#ffffff", "bg": "#8b008b"}], ["twentyfortyeight-face-32", "twentyfortyeight 32", {"fg": "#000000", "bg": "#ff4500"}], ["twentyfortyeight-face-4", "twentyfortyeight 4", {"fg": "#000000", "bg": "#deb887"}], ["twentyfortyeight-face-512", "twentyfortyeight 512", {"fg": "#000000", "bg": "#ff00ff"}], ["twentyfortyeight-face-64", "twentyfortyeight 64", {"fg": "#ffffff", "bg": "#b22222"}], ["twentyfortyeight-face-8", "twentyfortyeight 8", {"fg": "#000000", "bg": "#cd8500"}]]}, "alert": {"label": "alert", "preview": "generic", "faces": [["alert-high-face", "high", {"fg": "#ff8c00", "weight": "bold"}], ["alert-low-face", "low", {"fg": "#00008b"}], ["alert-moderate-face", "moderate", {"fg": "#ffd700", "weight": "bold"}], ["alert-normal-face", "normal", {}], ["alert-trivial-face", "trivial", {"fg": "#9400d3"}], ["alert-urgent-face", "urgent", {"fg": "#ff0000", "weight": "bold"}]]}, "all-the-icons": {"label": "all-the-icons", "preview": "generic", "faces": [["all-the-icons-blue", "blue", {"fg": "#6a9fb5"}], ["all-the-icons-blue-alt", "blue alt", {"fg": "#2188b6"}], ["all-the-icons-cyan", "cyan", {"fg": "#75b5aa"}], ["all-the-icons-cyan-alt", "cyan alt", {"fg": "#0595bd"}], ["all-the-icons-dblue", "dblue", {"fg": "#446674"}], ["all-the-icons-dcyan", "dcyan", {"fg": "#48746d"}], ["all-the-icons-dgreen", "dgreen", {"fg": "#6d8143"}], ["all-the-icons-dmaroon", "dmaroon", {"fg": "#72584b"}], ["all-the-icons-dorange", "dorange", {"fg": "#915b2d"}], ["all-the-icons-dpink", "dpink", {"fg": "#7e5d5f"}], ["all-the-icons-dpurple", "dpurple", {"fg": "#694863"}], ["all-the-icons-dred", "dred", {"fg": "#843031"}], ["all-the-icons-dsilver", "dsilver", {"fg": "#838484"}], ["all-the-icons-dyellow", "dyellow", {"fg": "#b48d56"}], ["all-the-icons-green", "green", {"fg": "#90a959"}], ["all-the-icons-lblue", "lblue", {"fg": "#677174"}], ["all-the-icons-lcyan", "lcyan", {"fg": "#2c7d6e"}], ["all-the-icons-lgreen", "lgreen", {"fg": "#3d6837"}], ["all-the-icons-lmaroon", "lmaroon", {"fg": "#ce7a4e"}], ["all-the-icons-lorange", "lorange", {"fg": "#ffa500"}], ["all-the-icons-lpink", "lpink", {"fg": "#ff505b"}], ["all-the-icons-lpurple", "lpurple", {"fg": "#e69dd6"}], ["all-the-icons-lred", "lred", {"fg": "#eb595a"}], ["all-the-icons-lsilver", "lsilver", {"fg": "#7f7869"}], ["all-the-icons-lyellow", "lyellow", {"fg": "#ff9300"}], ["all-the-icons-maroon", "maroon", {"fg": "#8f5536"}], ["all-the-icons-orange", "orange", {"fg": "#d4843e"}], ["all-the-icons-pink", "pink", {"fg": "#fc505b"}], ["all-the-icons-purple", "purple", {"fg": "#68295b"}], ["all-the-icons-purple-alt", "purple alt", {"fg": "#5d54e1"}], ["all-the-icons-red", "red", {"fg": "#ac4142"}], ["all-the-icons-red-alt", "red alt", {"fg": "#843031"}], ["all-the-icons-silver", "silver", {"fg": "#716e68"}], ["all-the-icons-yellow", "yellow", {"fg": "#ffcc0e"}]]}, "company": {"label": "company", "preview": "generic", "faces": [["company-echo", "echo", {}], ["company-echo-common", "echo common", {"fg": "#8b1a1a"}], ["company-preview", "preview", {"inherit": ["company-tooltip-selection", "company-tooltip"]}], ["company-preview-common", "preview common", {"inherit": "company-tooltip-common-selection"}], ["company-preview-search", "preview search", {"inherit": "company-tooltip-common-selection"}], ["company-tooltip", "tooltip", {"fg": "#000000", "bg": "#fff8dc"}], ["company-tooltip-annotation", "tooltip annotation", {"fg": "#8b1a1a"}], ["company-tooltip-annotation-selection", "tooltip annotation selection", {"inherit": "company-tooltip-annotation"}], ["company-tooltip-common", "tooltip common", {"fg": "#8b0000"}], ["company-tooltip-common-selection", "tooltip common selection", {"inherit": "company-tooltip-common"}], ["company-tooltip-deprecated", "tooltip deprecated", {"strike": {"color": null}}], ["company-tooltip-mouse", "tooltip mouse", {"inherit": "highlight"}], ["company-tooltip-quick-access", "tooltip quick access", {"inherit": "company-tooltip-annotation"}], ["company-tooltip-quick-access-selection", "tooltip quick access selection", {"inherit": "company-tooltip-annotation-selection"}], ["company-tooltip-scrollbar-thumb", "tooltip scrollbar thumb", {"bg": "#cd5c5c"}], ["company-tooltip-scrollbar-track", "tooltip scrollbar track", {"bg": "#f5deb3"}], ["company-tooltip-search", "tooltip search", {"inherit": "highlight"}], ["company-tooltip-search-selection", "tooltip search selection", {"inherit": "highlight"}], ["company-tooltip-selection", "tooltip selection", {"bg": "#add8e6"}]]}, "company-box": {"label": "company-box", "preview": "generic", "faces": [["company-box-annotation", "annotation", {"inherit": "company-tooltip-annotation"}], ["company-box-background", "background", {"inherit": "company-tooltip"}], ["company-box-candidate", "candidate", {"fg": "#000000"}], ["company-box-numbers", "numbers", {"inherit": "company-box-candidate"}], ["company-box-scrollbar", "scrollbar", {"inherit": "company-tooltip-selection"}], ["company-box-selection", "selection", {"extend": true, "inherit": "company-tooltip-selection"}]]}, "consult": {"label": "consult", "preview": "generic", "faces": [["consult-async-failed", "async failed", {"inherit": "error"}], ["consult-async-finished", "async finished", {"inherit": "success"}], ["consult-async-running", "async running", {"inherit": "consult-narrow-indicator"}], ["consult-async-split", "async split", {"inherit": "font-lock-negation-char-face"}], ["consult-bookmark", "bookmark", {"inherit": "font-lock-constant-face"}], ["consult-buffer", "buffer", {}], ["consult-file", "file", {"inherit": "font-lock-function-name-face"}], ["consult-grep-context", "grep context", {"inherit": "shadow"}], ["consult-help", "help", {"inherit": "shadow"}], ["consult-highlight-mark", "highlight mark", {"inherit": "consult-highlight-match"}], ["consult-highlight-match", "highlight match", {"inherit": "match"}], ["consult-key", "key", {"inherit": "font-lock-keyword-face"}], ["consult-line-number", "line number", {"inherit": "consult-key"}], ["consult-line-number-prefix", "line number prefix", {"inherit": "line-number"}], ["consult-line-number-wrapped", "line number wrapped", {"inherit": "warning"}], ["consult-narrow-indicator", "narrow indicator", {"inherit": "warning"}], ["consult-preview-insertion", "preview insertion", {"inherit": "region"}], ["consult-preview-line", "preview line", {"extend": true, "inherit": "consult-preview-insertion"}], ["consult-preview-match", "preview match", {"inherit": "isearch"}], ["consult-separator", "separator", {}]]}, "embark": {"label": "embark", "preview": "generic", "faces": [["embark-collect-annotation", "collect annotation", {"inherit": "completions-annotations"}], ["embark-collect-candidate", "collect candidate", {"inherit": "default"}], ["embark-collect-group-separator", "collect group separator", {"slant": "italic", "strike": {"color": null}, "inherit": "shadow"}], ["embark-collect-group-title", "collect group title", {"slant": "italic", "inherit": "shadow"}], ["embark-keybinding", "keybinding", {"inherit": "success"}], ["embark-keybinding-repeat", "keybinding repeat", {"inherit": "font-lock-builtin-face"}], ["embark-keymap", "keymap", {"slant": "italic"}], ["embark-selected", "selected", {"inherit": "match"}], ["embark-target", "target", {"inherit": "highlight"}], ["embark-verbose-indicator-documentation", "verbose indicator documentation", {"inherit": "completions-annotations"}], ["embark-verbose-indicator-shadowed", "verbose indicator shadowed", {"inherit": "shadow"}], ["embark-verbose-indicator-title", "verbose indicator title", {"weight": "bold", "height": 1.1}]]}, "emms": {"label": "emacs multimedia system (emms)", "preview": "generic", "faces": [["emms-browser-album-face", "browser album", {}], ["emms-browser-albumartist-face", "browser albumartist", {}], ["emms-browser-artist-face", "browser artist", {}], ["emms-browser-composer-face", "browser composer", {}], ["emms-browser-performer-face", "browser performer", {}], ["emms-browser-track-face", "browser track", {}], ["emms-browser-year/genre-face", "browser year/genre", {}], ["emms-metaplaylist-mode-current-face", "metaplaylist mode current", {"fg": "#ffffff", "bg": "#cd0000"}], ["emms-metaplaylist-mode-face", "metaplaylist mode", {"fg": "#cd0000"}], ["emms-playlist-selected-face", "playlist selected", {"fg": "#ffffff", "bg": "#0000cd"}], ["emms-playlist-track-face", "playlist track", {"fg": "#0000ff"}]]}, "flyspell-correct": {"label": "flyspell-correct", "preview": "generic", "faces": [["flyspell-correct-highlight-face", "highlight", {"inherit": "isearch"}]]}, "highlight-indent-guides": {"label": "highlight-indent-guides", "preview": "generic", "faces": [["highlight-indent-guides-character-face", "character", {}], ["highlight-indent-guides-even-face", "even", {}], ["highlight-indent-guides-odd-face", "odd", {}], ["highlight-indent-guides-stack-character-face", "stack character", {}], ["highlight-indent-guides-stack-even-face", "stack even", {}], ["highlight-indent-guides-stack-odd-face", "stack odd", {}], ["highlight-indent-guides-top-character-face", "top character", {}], ["highlight-indent-guides-top-even-face", "top even", {}], ["highlight-indent-guides-top-odd-face", "top odd", {}]]}, "hl-todo": {"label": "hl-todo", "preview": "generic", "faces": [["hl-todo", "hl todo", {"fg": "#cc9393", "weight": "bold"}], ["hl-todo-flymake-type", "flymake type", {"inherit": "font-lock-keyword-face"}]]}, "json-mode": {"label": "json-mode", "preview": "generic", "faces": [["json-mode-object-name-face", "object name", {}]]}, "llama": {"label": "llama", "preview": "generic", "faces": [["llama-##-macro", "## macro", {"inherit": "font-lock-function-call-face"}], ["llama-deleted-argument", "deleted argument", {"box": {"style": "line", "width": 1, "color": "#ff0000"}}], ["llama-llama-macro", "llama macro", {"inherit": "font-lock-keyword-face"}], ["llama-mandatory-argument", "mandatory argument", {"inherit": "font-lock-variable-use-face"}], ["llama-optional-argument", "optional argument", {"inherit": "font-lock-type-face"}]]}, "lv": {"label": "lv", "preview": "generic", "faces": [["lv-separator", "separator", {"bg": "#cccccc"}]]}, "magit-section": {"label": "magit-section", "preview": "generic", "faces": [["magit-left-margin", "magit left margin", {"inherit": "default"}], ["magit-section-child-count", "child count", {}], ["magit-section-heading", "heading", {"fg": "#8b6508", "weight": "bold", "extend": true}], ["magit-section-heading-selection", "heading selection", {"fg": "#8b4c39", "extend": true}], ["magit-section-highlight", "highlight", {"bg": "#f2f2f2", "extend": true}], ["magit-section-secondary-heading", "secondary heading", {"weight": "bold", "extend": true}]]}, "malyon": {"label": "malyon", "preview": "generic", "faces": [["malyon-face-bold", "face bold", {"inherit": "bold"}], ["malyon-face-error", "face error", {"inherit": "error"}], ["malyon-face-italic", "face italic", {"inherit": "italic"}], ["malyon-face-plain", "face plain", {"inherit": "default"}], ["malyon-face-reverse", "face reverse", {"inverse": true, "inherit": "default"}]]}, "marginalia": {"label": "marginalia", "preview": "generic", "faces": [["marginalia-archive", "archive", {"inherit": "warning"}], ["marginalia-char", "char", {"inherit": "marginalia-key"}], ["marginalia-date", "date", {"inherit": "marginalia-key"}], ["marginalia-documentation", "documentation", {"inherit": "completions-annotations"}], ["marginalia-file-name", "file name", {"inherit": "marginalia-documentation"}], ["marginalia-file-owner", "file owner", {"inherit": "font-lock-preprocessor-face"}], ["marginalia-file-priv-dir", "file priv dir", {"inherit": "font-lock-keyword-face"}], ["marginalia-file-priv-exec", "file priv exec", {"inherit": "font-lock-function-name-face"}], ["marginalia-file-priv-link", "file priv link", {"inherit": "font-lock-keyword-face"}], ["marginalia-file-priv-no", "file priv no", {"inherit": "shadow"}], ["marginalia-file-priv-other", "file priv other", {"inherit": "font-lock-constant-face"}], ["marginalia-file-priv-rare", "file priv rare", {"inherit": "font-lock-variable-name-face"}], ["marginalia-file-priv-read", "file priv read", {"inherit": "font-lock-type-face"}], ["marginalia-file-priv-write", "file priv write", {"inherit": "font-lock-builtin-face"}], ["marginalia-function", "function", {"inherit": "font-lock-function-name-face"}], ["marginalia-installed", "installed", {"inherit": "success"}], ["marginalia-key", "key", {"inherit": "font-lock-keyword-face"}], ["marginalia-lighter", "lighter", {"inherit": "marginalia-size"}], ["marginalia-list", "list", {"inherit": "font-lock-constant-face"}], ["marginalia-mode", "mode", {"inherit": "marginalia-key"}], ["marginalia-modified", "modified", {"inherit": "font-lock-negation-char-face"}], ["marginalia-null", "null", {"inherit": "font-lock-comment-face"}], ["marginalia-number", "number", {"inherit": "font-lock-constant-face"}], ["marginalia-off", "off", {"inherit": "error"}], ["marginalia-on", "on", {"inherit": "success"}], ["marginalia-size", "size", {"inherit": "marginalia-number"}], ["marginalia-string", "string", {"inherit": "font-lock-string-face"}], ["marginalia-symbol", "symbol", {"inherit": "font-lock-type-face"}], ["marginalia-true", "true", {"inherit": "font-lock-builtin-face"}], ["marginalia-type", "type", {"inherit": "marginalia-key"}], ["marginalia-value", "value", {"inherit": "marginalia-key"}], ["marginalia-version", "version", {"inherit": "marginalia-number"}]]}, "markdown-mode": {"label": "markdown-mode", "preview": "markdown", "faces": [["markdown-blockquote-face", "markdown blockquote", {"inherit": "font-lock-doc-face"}], ["markdown-bold-face", "markdown bold", {"inherit": "bold"}], ["markdown-code-face", "markdown code", {"inherit": "fixed-pitch"}], ["markdown-comment-face", "markdown comment", {"inherit": "font-lock-comment-face"}], ["markdown-footnote-marker-face", "markdown footnote marker", {"inherit": "markdown-markup-face"}], ["markdown-footnote-text-face", "markdown footnote text", {"inherit": "font-lock-comment-face"}], ["markdown-gfm-checkbox-face", "markdown gfm checkbox", {"inherit": "font-lock-builtin-face"}], ["markdown-header-delimiter-face", "markdown header delimiter", {"inherit": "markdown-markup-face"}], ["markdown-header-face", "markdown header", {"weight": "bold", "inherit": ["font-lock-function-name-face"]}], ["markdown-header-face-1", "markdown header 1", {"inherit": "markdown-header-face"}], ["markdown-header-face-2", "markdown header 2", {"inherit": "markdown-header-face"}], ["markdown-header-face-3", "markdown header 3", {"inherit": "markdown-header-face"}], ["markdown-header-face-4", "markdown header 4", {"inherit": "markdown-header-face"}], ["markdown-header-face-5", "markdown header 5", {"inherit": "markdown-header-face"}], ["markdown-header-face-6", "markdown header 6", {"inherit": "markdown-header-face"}], ["markdown-header-rule-face", "markdown header rule", {"inherit": "markdown-markup-face"}], ["markdown-highlight-face", "markdown highlight", {"inherit": "highlight"}], ["markdown-highlighting-face", "markdown highlighting", {"fg": "#000000", "bg": "#ffff00"}], ["markdown-hr-face", "markdown hr", {"inherit": "markdown-markup-face"}], ["markdown-html-attr-name-face", "markdown html attr name", {"inherit": "font-lock-variable-name-face"}], ["markdown-html-attr-value-face", "markdown html attr value", {"inherit": "font-lock-string-face"}], ["markdown-html-entity-face", "markdown html entity", {"inherit": "font-lock-variable-name-face"}], ["markdown-html-tag-delimiter-face", "markdown html tag delimiter", {"inherit": "markdown-markup-face"}], ["markdown-html-tag-name-face", "markdown html tag name", {"inherit": "font-lock-type-face"}], ["markdown-inline-code-face", "markdown inline code", {"inherit": ["markdown-code-face", "font-lock-constant-face"]}], ["markdown-italic-face", "markdown italic", {"inherit": "italic"}], ["markdown-language-info-face", "markdown language info", {"inherit": "font-lock-string-face"}], ["markdown-language-keyword-face", "markdown language keyword", {"inherit": "font-lock-type-face"}], ["markdown-line-break-face", "markdown line break", {"underline": {"style": "line", "color": null}, "inherit": "font-lock-constant-face"}], ["markdown-link-face", "markdown link", {"inherit": "link"}], ["markdown-link-title-face", "markdown link title", {"inherit": "font-lock-comment-face"}], ["markdown-list-face", "markdown list", {"inherit": "markdown-markup-face"}], ["markdown-markup-face", "markdown markup", {"inherit": "shadow"}], ["markdown-math-face", "markdown math", {"inherit": "font-lock-string-face"}], ["markdown-metadata-key-face", "markdown metadata key", {"inherit": "font-lock-variable-name-face"}], ["markdown-metadata-value-face", "markdown metadata value", {"inherit": "font-lock-string-face"}], ["markdown-missing-link-face", "markdown missing link", {"inherit": "font-lock-warning-face"}], ["markdown-plain-url-face", "markdown plain url", {"inherit": "markdown-link-face"}], ["markdown-pre-face", "markdown pre", {"inherit": ["markdown-code-face", "font-lock-constant-face"]}], ["markdown-reference-face", "markdown reference", {"inherit": "markdown-markup-face"}], ["markdown-strike-through-face", "markdown strike through", {"strike": {"color": null}}], ["markdown-table-face", "markdown table", {"inherit": ["markdown-code-face"]}], ["markdown-url-face", "markdown url", {"inherit": "font-lock-string-face"}]]}, "nerd-icons-completion": {"label": "nerd-icons-completion", "preview": "generic", "faces": [["nerd-icons-completion-dir-face", "dir", {}]]}, "orderless": {"label": "orderless", "preview": "generic", "faces": [["orderless-match-face-0", "match 0", {"fg": "#223fbf", "weight": "bold"}], ["orderless-match-face-1", "match 1", {"fg": "#8f0075", "weight": "bold"}], ["orderless-match-face-2", "match 2", {"fg": "#145a00", "weight": "bold"}], ["orderless-match-face-3", "match 3", {"fg": "#804000", "weight": "bold"}]]}, "org-roam": {"label": "org-roam", "preview": "generic", "faces": [["org-roam-dailies-calendar-note", "dailies calendar note", {"underline": {"style": "line", "color": null}, "inherit": ["org-link"]}], ["org-roam-dim", "dim", {"fg": "#999999"}], ["org-roam-header-line", "header line", {"fg": "#8b6508", "weight": "bold", "extend": true}], ["org-roam-olp", "olp", {"fg": "#999999"}], ["org-roam-preview-heading", "preview heading", {"fg": "#4d4d4d", "bg": "#cccccc", "extend": true}], ["org-roam-preview-heading-highlight", "preview heading highlight", {"fg": "#4d4d4d", "bg": "#bfbfbf", "extend": true}], ["org-roam-preview-heading-selection", "preview heading selection", {"fg": "#8b4c39", "extend": true, "inherit": "org-roam-preview-heading-highlight"}], ["org-roam-preview-region", "preview region", {"inherit": "bold"}], ["org-roam-title", "title", {"weight": "bold"}]]}, "org-superstar": {"label": "org-superstar", "preview": "generic", "faces": [["org-superstar-first", "first", {"inherit": "org-warning"}], ["org-superstar-header-bullet", "header bullet", {}], ["org-superstar-item", "item", {"inherit": "default"}], ["org-superstar-leading", "leading", {"fg": "#bebebe", "inherit": "default"}]]}, "prescient": {"label": "prescient", "preview": "generic", "faces": [["prescient-primary-highlight", "primary highlight", {"weight": "bold"}], ["prescient-secondary-highlight", "secondary highlight", {"underline": {"style": "line", "color": null}, "inherit": "prescient-primary-highlight"}]]}, "rainbow-delimiters": {"label": "rainbow-delimiters", "preview": "generic", "faces": [["rainbow-delimiters-base-error-face", "base error", {"fg": "#88090b", "inherit": "rainbow-delimiters-base-face"}], ["rainbow-delimiters-base-face", "base", {"inherit": "unspecified"}], ["rainbow-delimiters-depth-1-face", "depth 1", {"fg": "#707183", "inherit": "rainbow-delimiters-base-face"}], ["rainbow-delimiters-depth-2-face", "depth 2", {"fg": "#7388d6", "inherit": "rainbow-delimiters-base-face"}], ["rainbow-delimiters-depth-3-face", "depth 3", {"fg": "#909183", "inherit": "rainbow-delimiters-base-face"}], ["rainbow-delimiters-depth-4-face", "depth 4", {"fg": "#709870", "inherit": "rainbow-delimiters-base-face"}], ["rainbow-delimiters-depth-5-face", "depth 5", {"fg": "#907373", "inherit": "rainbow-delimiters-base-face"}], ["rainbow-delimiters-depth-6-face", "depth 6", {"fg": "#6276ba", "inherit": "rainbow-delimiters-base-face"}], ["rainbow-delimiters-depth-7-face", "depth 7", {"fg": "#858580", "inherit": "rainbow-delimiters-base-face"}], ["rainbow-delimiters-depth-8-face", "depth 8", {"fg": "#80a880", "inherit": "rainbow-delimiters-base-face"}], ["rainbow-delimiters-depth-9-face", "depth 9", {"fg": "#887070", "inherit": "rainbow-delimiters-base-face"}], ["rainbow-delimiters-mismatched-face", "mismatched", {"inherit": "rainbow-delimiters-unmatched-face"}], ["rainbow-delimiters-unmatched-face", "unmatched", {"inherit": "rainbow-delimiters-base-error-face"}]]}, "symbol-overlay": {"label": "symbol-overlay", "preview": "generic", "faces": [["symbol-overlay-default-face", "default", {"inherit": "highlight"}], ["symbol-overlay-face-1", "face 1", {"fg": "#000000", "bg": "#1e90ff"}], ["symbol-overlay-face-2", "face 2", {"fg": "#000000", "bg": "#ff69b4"}], ["symbol-overlay-face-3", "face 3", {"fg": "#000000", "bg": "#ffff00"}], ["symbol-overlay-face-4", "face 4", {"fg": "#000000", "bg": "#da70d6"}], ["symbol-overlay-face-5", "face 5", {"fg": "#000000", "bg": "#ff0000"}], ["symbol-overlay-face-6", "face 6", {"fg": "#000000", "bg": "#fa8072"}], ["symbol-overlay-face-7", "face 7", {"fg": "#000000", "bg": "#00ff7f"}], ["symbol-overlay-face-8", "face 8", {"fg": "#000000", "bg": "#40e0d0"}]]}, "tmr": {"label": "tmr", "preview": "generic", "faces": [["tmr-description", "description", {"inherit": "bold"}], ["tmr-duration", "duration", {}], ["tmr-end-time", "end time", {"inherit": "error"}], ["tmr-finished", "finished", {"inherit": "error"}], ["tmr-is-acknowledged", "is acknowledged", {"inherit": "success"}], ["tmr-must-be-acknowledged", "must be acknowledged", {"inherit": "warning"}], ["tmr-start-time", "start time", {"inherit": "success"}], ["tmr-tabulated-acknowledgement", "tabulated acknowledgement", {"inherit": "bold"}], ["tmr-tabulated-description", "tabulated description", {"inherit": "font-lock-doc-face"}], ["tmr-tabulated-end-time", "tabulated end time", {"fg": "#800040"}], ["tmr-tabulated-remaining-time", "tabulated remaining time", {"fg": "#603f00"}], ["tmr-tabulated-start-time", "tabulated start time", {"fg": "#004476"}]]}, "transient": {"label": "transient", "preview": "generic", "faces": [["transient-active-infix", "active infix", {"inherit": "highlight"}], ["transient-argument", "argument", {"weight": "bold", "inherit": "font-lock-string-face"}], ["transient-delimiter", "delimiter", {"inherit": "shadow"}], ["transient-disabled-suffix", "disabled suffix", {"fg": "#000000", "bg": "#ff0000", "weight": "bold"}], ["transient-enabled-suffix", "enabled suffix", {"fg": "#000000", "bg": "#00ff00", "weight": "bold"}], ["transient-heading", "heading", {"inherit": "font-lock-keyword-face"}], ["transient-higher-level", "higher level", {"box": {"style": "line", "width": 1, "color": "#999999"}}], ["transient-inactive-argument", "inactive argument", {"inherit": "shadow"}], ["transient-inactive-value", "inactive value", {"inherit": "shadow"}], ["transient-inapt-argument", "inapt argument", {"weight": "bold", "inherit": "shadow"}], ["transient-inapt-suffix", "inapt suffix", {"slant": "italic", "inherit": "shadow"}], ["transient-key", "key", {"inherit": "font-lock-builtin-face"}], ["transient-key-exit", "key exit", {"fg": "#aa2222", "inherit": "transient-key"}], ["transient-key-noop", "key noop", {"fg": "#cccccc", "inherit": "transient-key"}], ["transient-key-recurse", "key recurse", {"fg": "#2266ff", "inherit": "transient-key"}], ["transient-key-return", "key return", {"fg": "#aaaa11", "inherit": "transient-key"}], ["transient-key-stack", "key stack", {"fg": "#dd4488", "inherit": "transient-key"}], ["transient-key-stay", "key stay", {"fg": "#22aa22", "inherit": "transient-key"}], ["transient-mismatched-key", "mismatched key", {"box": {"style": "line", "width": 1, "color": "#ff00ff"}}], ["transient-nonstandard-key", "nonstandard key", {"box": {"style": "line", "width": 1, "color": "#00ffff"}}], ["transient-unreachable", "unreachable", {"inherit": "shadow"}], ["transient-unreachable-key", "unreachable key", {"inherit": ["shadow", "transient-key"]}], ["transient-value", "value", {"weight": "bold", "inherit": "font-lock-string-face"}]]}, "vertico": {"label": "vertico", "preview": "generic", "faces": [["vertico-current", "current", {"extend": true, "inherit": "highlight"}], ["vertico-group-separator", "group separator", {"strike": {"color": null}, "inherit": "vertico-group-title"}], ["vertico-group-title", "group title", {"slant": "italic", "inherit": "shadow"}], ["vertico-multiline", "multiline", {"inherit": "shadow"}]]}, "web-mode": {"label": "web-mode", "preview": "generic", "faces": [["web-mode-annotation-face", "annotation", {"inherit": "web-mode-comment-face"}], ["web-mode-annotation-html-face", "annotation html", {"slant": "italic", "inherit": "web-mode-annotation-face"}], ["web-mode-annotation-tag-face", "annotation tag", {"underline": {"style": "line", "color": null}, "inherit": "web-mode-annotation-face"}], ["web-mode-annotation-type-face", "annotation type", {"weight": "bold", "inherit": "web-mode-annotation-face"}], ["web-mode-annotation-value-face", "annotation value", {"slant": "italic", "inherit": "web-mode-annotation-face"}], ["web-mode-block-attr-name-face", "block attr name", {"fg": "#8fbc8f"}], ["web-mode-block-attr-value-face", "block attr value", {"fg": "#5f9ea0"}], ["web-mode-block-comment-face", "block comment", {"inherit": "web-mode-comment-face"}], ["web-mode-block-control-face", "block control", {"inherit": "font-lock-preprocessor-face"}], ["web-mode-block-delimiter-face", "block delimiter", {"inherit": "font-lock-preprocessor-face"}], ["web-mode-block-face", "block", {"bg": "#ffffe0"}], ["web-mode-block-string-face", "block string", {"inherit": "web-mode-string-face"}], ["web-mode-bold-face", "bold", {"weight": "bold"}], ["web-mode-builtin-face", "builtin", {"inherit": "font-lock-builtin-face"}], ["web-mode-comment-face", "comment", {"inherit": "font-lock-comment-face"}], ["web-mode-comment-keyword-face", "comment keyword", {"weight": "bold"}], ["web-mode-constant-face", "constant", {"inherit": "font-lock-constant-face"}], ["web-mode-css-at-rule-face", "css at rule", {"inherit": "font-lock-constant-face"}], ["web-mode-css-color-face", "css color", {"inherit": "font-lock-builtin-face"}], ["web-mode-css-comment-face", "css comment", {"inherit": "web-mode-comment-face"}], ["web-mode-css-function-face", "css function", {"inherit": "font-lock-builtin-face"}], ["web-mode-css-priority-face", "css priority", {"inherit": "font-lock-builtin-face"}], ["web-mode-css-property-name-face", "css property name", {"inherit": "font-lock-variable-name-face"}], ["web-mode-css-pseudo-class-face", "css pseudo class", {"inherit": "font-lock-builtin-face"}], ["web-mode-css-selector-class-face", "css selector class", {"inherit": "font-lock-keyword-face"}], ["web-mode-css-selector-face", "css selector", {"inherit": "font-lock-keyword-face"}], ["web-mode-css-selector-tag-face", "css selector tag", {"inherit": "font-lock-keyword-face"}], ["web-mode-css-string-face", "css string", {"inherit": "web-mode-string-face"}], ["web-mode-css-variable-face", "css variable", {"slant": "italic", "inherit": "web-mode-variable-name-face"}], ["web-mode-current-column-highlight-face", "current column highlight", {"bg": "#3e3c36"}], ["web-mode-current-element-highlight-face", "current element highlight", {"fg": "#ffffff", "bg": "#000000"}], ["web-mode-doctype-face", "doctype", {"fg": "#bebebe"}], ["web-mode-error-face", "error", {"bg": "#ff0000"}], ["web-mode-filter-face", "filter", {"inherit": "font-lock-function-name-face"}], ["web-mode-folded-face", "folded", {"underline": {"style": "line", "color": null}}], ["web-mode-function-call-face", "function call", {"inherit": "font-lock-function-name-face"}], ["web-mode-function-name-face", "function name", {"inherit": "font-lock-function-name-face"}], ["web-mode-html-attr-custom-face", "html attr custom", {"inherit": "web-mode-html-attr-name-face"}], ["web-mode-html-attr-engine-face", "html attr engine", {"inherit": "web-mode-block-delimiter-face"}], ["web-mode-html-attr-equal-face", "html attr equal", {"inherit": "web-mode-html-attr-name-face"}], ["web-mode-html-attr-name-face", "html attr name", {"fg": "#8b8989"}], ["web-mode-html-attr-value-face", "html attr value", {"inherit": "font-lock-string-face"}], ["web-mode-html-entity-face", "html entity", {"slant": "italic"}], ["web-mode-html-tag-bracket-face", "html tag bracket", {"fg": "#242424"}], ["web-mode-html-tag-custom-face", "html tag custom", {"inherit": "web-mode-html-tag-face"}], ["web-mode-html-tag-face", "html tag", {"fg": "#8b8989"}], ["web-mode-html-tag-namespaced-face", "html tag namespaced", {"inherit": "web-mode-block-control-face"}], ["web-mode-html-tag-unclosed-face", "html tag unclosed", {"underline": {"style": "line", "color": null}, "inherit": "web-mode-html-tag-face"}], ["web-mode-inlay-face", "inlay", {"bg": "#ffffe0"}], ["web-mode-interpolate-color1-face", "interpolate color1", {"inherit": "web-mode-string-face"}], ["web-mode-interpolate-color2-face", "interpolate color2", {"inherit": "web-mode-string-face"}], ["web-mode-interpolate-color3-face", "interpolate color3", {"inherit": "web-mode-string-face"}], ["web-mode-interpolate-color4-face", "interpolate color4", {"inherit": "web-mode-string-face"}], ["web-mode-italic-face", "italic", {"slant": "italic"}], ["web-mode-javascript-comment-face", "javascript comment", {"inherit": "web-mode-comment-face"}], ["web-mode-javascript-string-face", "javascript string", {"inherit": "web-mode-string-face"}], ["web-mode-json-comment-face", "json comment", {"inherit": "web-mode-comment-face"}], ["web-mode-json-context-face", "json context", {"fg": "#cd69c9"}], ["web-mode-json-key-face", "json key", {"fg": "#dda0dd"}], ["web-mode-json-string-face", "json string", {"inherit": "web-mode-string-face"}], ["web-mode-jsx-depth-1-face", "jsx depth 1", {"bg": "#000053"}], ["web-mode-jsx-depth-2-face", "jsx depth 2", {"bg": "#001970"}], ["web-mode-jsx-depth-3-face", "jsx depth 3", {"bg": "#002984"}], ["web-mode-jsx-depth-4-face", "jsx depth 4", {"bg": "#49599a"}], ["web-mode-jsx-depth-5-face", "jsx depth 5", {"bg": "#9499b7"}], ["web-mode-keyword-face", "keyword", {"inherit": "font-lock-keyword-face"}], ["web-mode-param-name-face", "param name", {"fg": "#cdc9c9"}], ["web-mode-part-comment-face", "part comment", {"inherit": "web-mode-comment-face"}], ["web-mode-part-face", "part", {"inherit": "web-mode-block-face"}], ["web-mode-part-string-face", "part string", {"inherit": "web-mode-string-face"}], ["web-mode-preprocessor-face", "preprocessor", {"inherit": "font-lock-preprocessor-face"}], ["web-mode-script-face", "script", {"inherit": "web-mode-part-face"}], ["web-mode-sql-keyword-face", "sql keyword", {"weight": "bold", "slant": "italic"}], ["web-mode-string-face", "string", {"inherit": "font-lock-string-face"}], ["web-mode-style-face", "style", {"inherit": "web-mode-part-face"}], ["web-mode-symbol-face", "symbol", {"fg": "#eeb422"}], ["web-mode-type-face", "type", {"inherit": "font-lock-type-face"}], ["web-mode-underline-face", "underline", {"underline": {"style": "line", "color": null}}], ["web-mode-variable-name-face", "variable name", {"inherit": "font-lock-variable-name-face"}], ["web-mode-warning-face", "warning", {"inherit": "font-lock-warning-face"}], ["web-mode-whitespace-face", "whitespace", {"bg": "#68228b"}]]}, "yasnippet": {"label": "yasnippet", "preview": "generic", "faces": [["yas--field-debug-face", "yas field debug", {}], ["yas-field-highlight-face", "yas field highlight", {"inherit": "region"}]]}}; +const SAMPLES={"Elisp": [[["cmd", ";;"], ["cm", " cache.el"]], [["cmd", ";;"], ["cm", " "], ["warn", "TODO"], ["cm", ": add an LRU eviction policy"]], [["punc", "("], ["kw", "require"], ["p", " "], ["con", "'cl-lib"], ["punc", ")"]], [], [["punc", "("], ["kw", "defvar"], ["p", " "], ["var", "cache--tbl"], ["p", " "], ["punc", "("], ["fnc", "make-hash-table"], ["p", " "], ["con", ":test"], ["p", " "], ["con", "'equal"], ["punc", "))"]], [["p", " "], ["doc", "\"Memo table.\")"]], [], [["punc", "("], ["kw", "defun"], ["p", " "], ["fnd", "cache-get"], ["p", " "], ["punc", "("], ["var", "key"], ["punc", ")"]], [["p", " "], ["doc", "\"Return cached value for KEY.\""]], [["p", " "], ["punc", "("], ["kw", "or"], ["p", " "], ["punc", "("], ["bi", "gethash"], ["p", " "], ["var", "key"], ["p", " "], ["var", "cache--tbl"], ["punc", ")"]], [["p", " "], ["punc", "("], ["kw", "let"], ["p", " "], ["punc", "(("], ["var", "v"], ["p", " "], ["punc", "("], ["fnc", "compute"], ["p", " "], ["var", "key"], ["p", " "], ["num", "42"], ["punc", "))) "]], [["p", " "], ["punc", "("], ["fnc", "puthash"], ["p", " "], ["var", "key"], ["p", " "], ["var", "v"], ["p", " "], ["var", "cache--tbl"], ["punc", ") "], ["var", "v"], ["punc", "))))"]], [], [["punc", "("], ["kw", "defun"], ["p", " "], ["fnd", "cache-clear"], ["p", " "], ["punc", "()"]], [["p", " "], ["doc", "\"Empty the memo table. See "], ["dmark", "\\\\[cache-get]"], ["doc", ".\""]], [["p", " "], ["punc", "("], ["kw", "interactive"], ["punc", ")"]], [["p", " "], ["punc", "("], ["fnc", "clrhash"], ["p", " "], ["var", "cache--tbl"], ["punc", ")"]], [["p", " "], ["punc", "("], ["fnc", "message"], ["p", " "], ["str", "\"cleared"], ["esc", "\\n"], ["str", "\""], ["punc", "))"]], [], [["punc", "("], ["kw", "defun"], ["p", " "], ["fnd", "cache-keys"], ["p", " "], ["punc", "()"]], [["p", " "], ["doc", "\"Return all keys.\""]], [["p", " "], ["punc", "("], ["kw", "let"], ["p", " "], ["punc", "(("], ["var", "acc"], ["p", " "], ["con", "nil"], ["punc", "))"]], [["p", " "], ["punc", "("], ["fnc", "maphash"], ["p", " "], ["punc", "("], ["kw", "lambda"], ["p", " "], ["punc", "("], ["var", "k"], ["p", " "], ["var", "_v"], ["punc", ")"], ["p", " "], ["punc", "("], ["fnc", "push"], ["p", " "], ["var", "k"], ["p", " "], ["var", "acc"], ["punc", "))"]], [["p", " "], ["var", "cache--tbl"], ["punc", ")"], ["p", " "], ["var", "acc"], ["punc", "))"]], [], [["punc", "("], ["kw", "defun"], ["p", " "], ["fnd", "cache--key-p"], ["p", " "], ["punc", "("], ["var", "s"], ["punc", ")"]], [["p", " "], ["punc", "("], ["fnc", "string-match"], ["p", " "], ["str", "\""], ["rxgb", "\\\\"], ["rxgc", "("], ["str", "key"], ["rxgb", "\\\\"], ["rxgc", ")"], ["str", "\""], ["p", " "], ["var", "s"], ["punc", "))"]], [], [["punc", "("], ["kw", "provide"], ["p", " "], ["con", "'cache"], ["punc", ")"]]], "Go": [[["cmd", "//"], ["cm", " queue.go"]], [["kw", "package"], ["p", " "], ["var", "main"]], [], [["kw", "import"], ["p", " "], ["str", "\"fmt\""]], [], [["kw", "const"], ["p", " "], ["con", "MaxItems"], ["p", " "], ["op", "="], ["p", " "], ["num", "100"]], [], [["kw", "type"], ["p", " "], ["ty", "Order"], ["p", " "], ["kw", "struct"], ["p", " "], ["punc", "{"]], [["p", " "], ["prop", "ID"], ["p", " "], ["ty", "int"]], [["p", " "], ["prop", "Name"], ["p", " "], ["ty", "string"]], [["punc", "}"]], [], [["kw", "func"], ["p", " "], ["punc", "("], ["var", "q"], ["p", " "], ["op", "*"], ["ty", "Queue"], ["punc", ")"], ["p", " "], ["fnd", "Push"], ["punc", "("], ["var", "o"], ["p", " "], ["op", "*"], ["ty", "Order"], ["punc", ")"], ["p", " "], ["ty", "error"], ["p", " "], ["punc", "{"]], [["p", " "], ["cmd", "//"], ["cm", " reject nil"]], [["p", " "], ["kw", "if"], ["p", " "], ["var", "o"], ["p", " "], ["op", "=="], ["p", " "], ["con", "nil"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "return"], ["p", " "], ["fnc", "fmt.Errorf"], ["punc", "("], ["str", "\"nil"], ["esc", "\\n"], ["str", "\""], ["punc", ")"]], [["p", " "], ["punc", "}"]], [["p", " "], ["var", "q"], ["op", "."], ["prop", "items"], ["p", " "], ["op", "="], ["p", " "], ["bi", "append"], ["punc", "("], ["var", "q"], ["op", "."], ["prop", "items"], ["punc", ","], ["p", " "], ["var", "o"], ["punc", ")"]], [["p", " "], ["kw", "return"], ["p", " "], ["con", "nil"]], [["punc", "}"]], [], [["kw", "func"], ["p", " "], ["fnd", "main"], ["punc", "()"], ["p", " "], ["punc", "{"]], [["p", " "], ["fnc", "fmt.Println"], ["punc", "("], ["op", "&"], ["ty", "Queue"], ["punc", "{}"], ["punc", ")"]], [["punc", "}"]]], "Python": [[["cmd", "#"], ["cm", " theme.py"]], [["kw", "from"], ["p", " "], ["var", "dataclasses"], ["p", " "], ["kw", "import"], ["p", " "], ["var", "dataclass"], ["punc", ","], ["p", " "], ["var", "field"]], [], [["con", "DEFAULT_PORT"], ["op", ":"], ["p", " "], ["ty", "int"], ["p", " "], ["op", "="], ["p", " "], ["num", "8080"]], [["con", "HEX"], ["p", " "], ["op", "="], ["p", " "], ["var", "re"], ["op", "."], ["fnc", "compile"], ["punc", "("], ["re", "r\"#[0-9a-f]{6}\""], ["punc", ")"]], [], [["dec", "@dataclass"]], [["kw", "class"], ["p", " "], ["ty", "Theme"], ["op", ":"]], [["p", " "], ["doc", "\"\"\"A color theme.\"\"\""]], [["p", " "], ["prop", "name"], ["op", ":"], ["p", " "], ["ty", "str"], ["p", " "], ["op", "="], ["p", " "], ["str", "\"dupre\""]], [["p", " "], ["prop", "colors"], ["op", ":"], ["p", " "], ["ty", "dict"], ["p", " "], ["op", "="], ["p", " "], ["fnc", "field"], ["punc", "("], ["prop", "default_factory"], ["op", "="], ["ty", "dict"], ["punc", ")"]], [], [["p", " "], ["kw", "def"], ["p", " "], ["fnd", "resolve"], ["punc", "("], ["var", "self"], ["punc", ","], ["p", " "], ["var", "key"], ["op", ":"], ["p", " "], ["ty", "str"], ["punc", ")"], ["p", " "], ["op", "->"], ["p", " "], ["ty", "str"], ["p", " "], ["op", "|"], ["p", " "], ["con", "None"], ["op", ":"]], [["p", " "], ["cmd", "#"], ["cm", " fallback to none"]], [["p", " "], ["var", "v"], ["p", " "], ["op", "="], ["p", " "], ["var", "self"], ["op", "."], ["prop", "colors"], ["op", "."], ["fnc", "get"], ["punc", "("], ["var", "key"], ["punc", ","], ["p", " "], ["str", "\""], ["esc", "\\t"], ["str", "none\""], ["punc", ")"]], [["p", " "], ["kw", "if"], ["p", " "], ["bi", "len"], ["punc", "("], ["var", "v"], ["punc", ")"], ["p", " "], ["op", "=="], ["p", " "], ["num", "0"], ["op", ":"], ["p", " "], ["kw", "return"], ["p", " "], ["con", "None"]], [["p", " "], ["kw", "return"], ["p", " "], ["var", "v"]], [], [["p", " "], ["dec", "@property"]], [["p", " "], ["kw", "def"], ["p", " "], ["fnd", "size"], ["punc", "("], ["var", "self"], ["punc", ")"], ["p", " "], ["op", "->"], ["p", " "], ["ty", "int"], ["op", ":"]], [["p", " "], ["kw", "return"], ["p", " "], ["bi", "len"], ["punc", "("], ["var", "self"], ["op", "."], ["prop", "colors"], ["punc", ")"]], [], [["var", "theme"], ["p", " "], ["op", "="], ["p", " "], ["ty", "Theme"], ["punc", "("], ["str", "\"dupre\""], ["punc", ")"]], [["fnc", "print"], ["punc", "("], ["var", "theme"], ["op", "."], ["fnc", "resolve"], ["punc", "("], ["str", "\"bg\""], ["punc", "))"]]], "TypeScript": [[["cmd", "//"], ["cm", " orders.ts"]], [["kw", "import"], ["p", " "], ["punc", "{"], ["p", " "], ["ty", "Order"], ["p", " "], ["punc", "}"], ["p", " "], ["kw", "from"], ["p", " "], ["str", "\"./types\""]], [], [["kw", "export"], ["p", " "], ["kw", "interface"], ["p", " "], ["ty", "Queue"], ["p", " "], ["punc", "{"]], [["p", " "], ["prop", "max"], ["op", ":"], ["p", " "], ["ty", "number"], ["punc", ";"]], [["p", " "], ["prop", "items"], ["op", ":"], ["p", " "], ["ty", "Order"], ["punc", "[];"]], [["punc", "}"]], [], [["dec", "@Injectable"], ["punc", "()"]], [["kw", "export"], ["p", " "], ["kw", "class"], ["p", " "], ["ty", "OrderQueue"], ["p", " "], ["kw", "implements"], ["p", " "], ["ty", "Queue"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "private"], ["p", " "], ["prop", "re"], ["p", " "], ["op", "="], ["p", " "], ["re", "/^#[0-9a-f]{6}$/i"], ["punc", ";"]], [], [["p", " "], ["fnd", "push"], ["punc", "("], ["var", "o"], ["op", ":"], ["p", " "], ["ty", "Order"], ["punc", ")"], ["op", ":"], ["p", " "], ["ty", "boolean"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "if"], ["p", " "], ["punc", "("], ["var", "o"], ["p", " "], ["op", "==="], ["p", " "], ["con", "null"], ["punc", ")"], ["p", " "], ["kw", "return"], ["p", " "], ["con", "false"], ["punc", ";"]], [["p", " "], ["var", "console"], ["op", "."], ["fnc", "log"], ["punc", "("], ["str", "`id "], ["punc", "${"], ["var", "o"], ["op", "."], ["prop", "id"], ["punc", "}"], ["esc", "\\n"], ["str", "`"], ["punc", ");"]], [["p", " "], ["kw", "return"], ["p", " "], ["con", "true"], ["punc", ";"]], [["p", " "], ["punc", "}"]], [["punc", "}"]], [], [["kw", "const"], ["p", " "], ["con", "LIMIT"], ["op", ":"], ["p", " "], ["ty", "number"], ["p", " "], ["op", "="], ["p", " "], ["num", "50"], ["punc", ";"]], [["kw", "const"], ["p", " "], ["var", "q"], ["p", " "], ["op", "="], ["p", " "], ["kw", "new"], ["p", " "], ["ty", "OrderQueue"], ["punc", "()"], ["punc", ";"]], [["var", "q"], ["op", "."], ["fnd", "push"], ["punc", "("], ["punc", "{"], ["p", " "], ["prop", "id"], ["op", ":"], ["p", " "], ["num", "1"], ["p", " "], ["punc", "}"], ["p", " "], ["kw", "as"], ["p", " "], ["ty", "Order"], ["punc", ")"], ["punc", ";"]], [["var", "console"], ["op", "."], ["fnc", "log"], ["punc", "("], ["var", "q"], ["op", "."], ["prop", "max"], ["punc", ")"], ["punc", ";"]], [["kw", "const"], ["p", " "], ["var", "cap"], ["p", " "], ["op", "="], ["p", " "], ["var", "Math"], ["op", "."], ["bi", "max"], ["punc", "("], ["con", "LIMIT"], ["punc", ","], ["p", " "], ["num", "0"], ["punc", ")"], ["punc", ";"]]], "Java": [[["cmd", "/**"], ["doc", " A color theme. */"]], [["kw", "package"], ["p", " "], ["var", "com"], ["op", "."], ["var", "dupre"], ["punc", ";"]], [["kw", "import"], ["p", " "], ["var", "java"], ["op", "."], ["var", "util"], ["op", "."], ["var", "regex"], ["op", "."], ["ty", "Pattern"], ["punc", ";"]], [], [["dec", "@Deprecated"]], [["kw", "public"], ["p", " "], ["kw", "final"], ["p", " "], ["kw", "class"], ["p", " "], ["ty", "Theme"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "private"], ["p", " "], ["kw", "static"], ["p", " "], ["kw", "final"], ["p", " "], ["ty", "int"], ["p", " "], ["con", "MAX_PORT"], ["p", " "], ["op", "="], ["p", " "], ["num", "8080"], ["punc", ";"]], [["p", " "], ["kw", "private"], ["p", " "], ["kw", "final"], ["p", " "], ["ty", "String"], ["p", " "], ["prop", "name"], ["p", " "], ["op", "="], ["p", " "], ["str", "\"dupre\""], ["punc", ";"]], [["p", " "], ["kw", "private"], ["p", " "], ["kw", "static"], ["p", " "], ["kw", "final"], ["p", " "], ["ty", "Pattern"], ["p", " "], ["con", "HEX"], ["p", " "], ["op", "="], ["p", " "], ["ty", "Pattern"], ["op", "."], ["fnc", "compile"], ["punc", "("], ["re", "\"#[0-9a-f]{6}\""], ["punc", ")"], ["punc", ";"]], [], [["p", " "], ["dec", "@Override"]], [["p", " "], ["kw", "public"], ["p", " "], ["ty", "String"], ["p", " "], ["fnd", "resolve"], ["punc", "("], ["ty", "String"], ["p", " "], ["var", "key"], ["punc", ")"], ["p", " "], ["punc", "{"]], [["p", " "], ["cmd", "//"], ["cm", " fall back to null"]], [["p", " "], ["kw", "if"], ["p", " "], ["punc", "("], ["var", "key"], ["op", "."], ["fnc", "isEmpty"], ["punc", "()"], ["punc", ")"], ["p", " "], ["kw", "return"], ["p", " "], ["con", "null"], ["punc", ";"]], [["p", " "], ["kw", "return"], ["p", " "], ["var", "key"], ["op", "."], ["fnc", "strip"], ["punc", "("], ["punc", ")"], ["op", "+"], ["str", "\""], ["esc", "\\t"], ["str", "\""], ["punc", ";"]], [["p", " "], ["punc", "}"]], [], [["p", " "], ["kw", "public"], ["p", " "], ["kw", "static"], ["p", " "], ["ty", "void"], ["p", " "], ["fnd", "main"], ["punc", "("], ["ty", "String"], ["punc", "[]"], ["p", " "], ["var", "args"], ["punc", ")"], ["p", " "], ["punc", "{"]], [["p", " "], ["ty", "var"], ["p", " "], ["var", "t"], ["p", " "], ["op", "="], ["p", " "], ["kw", "new"], ["p", " "], ["ty", "Theme"], ["punc", "()"], ["punc", ";"]], [["p", " "], ["ty", "System"], ["op", "."], ["prop", "out"], ["op", "."], ["fnc", "println"], ["punc", "("], ["var", "t"], ["op", "."], ["fnc", "resolve"], ["punc", "("], ["str", "\"bg\""], ["punc", "))"], ["punc", ";"]], [["p", " "], ["punc", "}"]], [["punc", "}"]]], "C": [[["cmd", "/**"], ["doc", " Order queue. */"]], [["pp", "#include"], ["p", " "], ["str", "<stdio.h>"]], [["pp", "#include"], ["p", " "], ["str", "<stdlib.h>"]], [["pp", "#define"], ["p", " "], ["con", "MAX_PORT"], ["p", " "], ["num", "8080"]], [], [["kw", "typedef"], ["p", " "], ["kw", "struct"], ["p", " "], ["punc", "{"]], [["p", " "], ["ty", "int"], ["p", " "], ["prop", "id"], ["punc", ";"]], [["p", " "], ["kw", "const"], ["p", " "], ["ty", "char"], ["p", " "], ["op", "*"], ["prop", "name"], ["punc", ";"]], [["punc", "}"], ["p", " "], ["ty", "Order"], ["punc", ";"]], [], [["cmd", "//"], ["cm", " returns -1 on null input"]], [["ty", "int"], ["p", " "], ["fnd", "push"], ["punc", "("], ["ty", "Order"], ["p", " "], ["op", "*"], ["var", "o"], ["punc", ")"], ["p", " "], ["dec", "__attribute__"], ["punc", "(("], ["dec", "nonnull"], ["punc", "))"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "if"], ["p", " "], ["punc", "("], ["neg", "!"], ["var", "o"], ["punc", ")"], ["p", " "], ["kw", "return"], ["p", " "], ["num", "-1"], ["punc", ";"]], [["p", " "], ["fnc", "printf"], ["punc", "("], ["str", "\"id=%d"], ["esc", "\\n"], ["str", "\""], ["punc", ","], ["p", " "], ["var", "o"], ["op", "->"], ["prop", "id"], ["punc", ");"]], [["p", " "], ["kw", "return"], ["p", " "], ["num", "0"], ["punc", ";"]], [["punc", "}"]], [], [["ty", "int"], ["p", " "], ["fnd", "main"], ["punc", "("], ["ty", "void"], ["punc", ")"], ["p", " "], ["punc", "{"]], [["p", " "], ["ty", "Order"], ["p", " "], ["var", "o"], ["p", " "], ["op", "="], ["p", " "], ["punc", "{"], ["p", " "], ["op", "."], ["prop", "id"], ["p", " "], ["op", "="], ["p", " "], ["num", "1"], ["punc", ","], ["p", " "], ["op", "."], ["prop", "name"], ["p", " "], ["op", "="], ["p", " "], ["str", "\"dupre\""], ["p", " "], ["punc", "}"], ["punc", ";"]], [["p", " "], ["ty", "Order"], ["p", " "], ["op", "*"], ["var", "p2"], ["p", " "], ["op", "="], ["p", " "], ["bi", "malloc"], ["punc", "("], ["bi", "sizeof"], ["punc", "("], ["ty", "Order"], ["punc", "))"], ["punc", ";"]], [["p", " "], ["fnc", "push"], ["punc", "("], ["op", "&"], ["var", "o"], ["punc", ")"], ["punc", ";"]], [["p", " "], ["bi", "free"], ["punc", "("], ["var", "p2"], ["punc", ")"], ["punc", ";"]], [["p", " "], ["kw", "return"], ["p", " "], ["num", "0"], ["punc", ";"]], [["punc", "}"]]], "C++": [[["cmd", "/**"], ["doc", " A color theme. */"]], [["pp", "#include"], ["p", " "], ["str", "<string>"]], [["pp", "#include"], ["p", " "], ["str", "<regex>"]], [["pp", "#pragma"], ["p", " "], ["pp", "once"]], [], [["kw", "namespace"], ["p", " "], ["var", "dupre"], ["p", " "], ["punc", "{"]], [], [["kw", "template"], ["op", "<"], ["kw", "typename"], ["p", " "], ["ty", "T"], ["op", ">"], ["p", " "], ["kw", "class"], ["p", " "], ["ty", "Theme"], ["p", " "], ["punc", "{"]], [["kw", "public"], ["op", ":"]], [["p", " "], ["kw", "static"], ["p", " "], ["kw", "constexpr"], ["p", " "], ["ty", "int"], ["p", " "], ["con", "MAX"], ["p", " "], ["op", "="], ["p", " "], ["num", "0x20"], ["punc", ";"]], [["p", " "], ["ty", "std"], ["op", "::"], ["ty", "string"], ["p", " "], ["prop", "name_"], ["p", " "], ["op", "="], ["p", " "], ["str", "\"dupre\""], ["punc", ";"]], [], [["p", " "], ["dec", "[[nodiscard]]"], ["p", " "], ["ty", "T"], ["p", " "], ["fnd", "resolve"], ["punc", "("], ["kw", "const"], ["p", " "], ["ty", "std"], ["op", "::"], ["ty", "string"], ["op", "&"], ["p", " "], ["var", "key"], ["punc", ")"], ["p", " "], ["kw", "const"], ["p", " "], ["punc", "{"]], [["p", " "], ["cmd", "//"], ["cm", " validate against a hex pattern"]], [["p", " "], ["kw", "static"], ["p", " "], ["ty", "std"], ["op", "::"], ["ty", "regex"], ["p", " "], ["var", "re"], ["punc", "("], ["re", "R\"(#[0-9a-f]{6})\""], ["punc", ")"], ["punc", ";"]], [["p", " "], ["kw", "if"], ["p", " "], ["punc", "("], ["var", "key"], ["op", "."], ["fnc", "empty"], ["punc", "()"], ["punc", ")"], ["p", " "], ["kw", "return"], ["p", " "], ["con", "nullptr"], ["punc", ";"]], [["p", " "], ["kw", "return"], ["p", " "], ["ty", "T"], ["punc", "{"], ["var", "key"], ["punc", "}"], ["punc", ";"]], [["p", " "], ["punc", "}"]], [["punc", "}"], ["punc", ";"]], [], [["ty", "int"], ["p", " "], ["fnd", "main"], ["punc", "()"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "auto"], ["p", " "], ["var", "t"], ["p", " "], ["op", "="], ["p", " "], ["ty", "Theme"], ["op", "<"], ["ty", "int"], ["op", ">"], ["punc", "{}"], ["punc", ";"]], [["p", " "], ["bi", "static_cast"], ["op", "<"], ["ty", "int"], ["op", ">"], ["punc", "("], ["var", "t"], ["op", "."], ["prop", "name_"], ["op", "."], ["fnc", "size"], ["punc", "())"], ["punc", ";"]], [["p", " "], ["ty", "std"], ["op", "::"], ["fnc", "printf"], ["punc", "("], ["str", "\"%s"], ["esc", "\\n"], ["str", "\""], ["punc", ","], ["p", " "], ["var", "t"], ["op", "."], ["prop", "name_"], ["op", "."], ["fnc", "c_str"], ["punc", "())"], ["punc", ";"]], [["p", " "], ["kw", "return"], ["p", " "], ["num", "0"], ["punc", ";"]], [["punc", "}"]]], "Rust": [[["cmd", "//"], ["cm", " theme.rs"]], [["dec", "#![allow(dead_code)]"]], [["kw", "use"], ["p", " "], ["var", "std"], ["op", "::"], ["var", "fmt"], ["punc", ";"]], [], [["dec", "#[derive"], ["punc", "("], ["dec", "Debug"], ["punc", ","], ["p", " "], ["dec", "Clone"], ["punc", ")]"]], [["kw", "pub"], ["p", " "], ["kw", "trait"], ["p", " "], ["ty", "Theme"], ["op", "<"], ["var", "'a"], ["op", ">"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "const"], ["p", " "], ["con", "NAME"], ["op", ":"], ["p", " "], ["op", "&"], ["var", "'static"], ["p", " "], ["ty", "str"], ["punc", ";"]], [["p", " "], ["kw", "fn"], ["p", " "], ["fnd", "resolve"], ["punc", "("], ["op", "&"], ["var", "'a"], ["p", " "], ["var", "self"], ["punc", ","], ["p", " "], ["var", "key"], ["op", ":"], ["p", " "], ["op", "&"], ["var", "'a"], ["p", " "], ["ty", "str"], ["punc", ")"], ["p", " "], ["op", "->"], ["p", " "], ["ty", "Option"], ["op", "<"], ["op", "&"], ["var", "'a"], ["p", " "], ["ty", "str"], ["op", ">"], ["punc", ";"]], [["punc", "}"]], [], [["kw", "pub"], ["p", " "], ["kw", "struct"], ["p", " "], ["ty", "Palette"], ["op", "<"], ["var", "'a"], ["op", ">"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "pub"], ["p", " "], ["prop", "name"], ["op", ":"], ["p", " "], ["op", "&"], ["var", "'a"], ["p", " "], ["ty", "str"], ["punc", ","]], [["p", " "], ["kw", "pub"], ["p", " "], ["prop", "colors"], ["op", ":"], ["p", " "], ["ty", "Vec"], ["op", "<"], ["punc", "("], ["op", "&"], ["var", "'a"], ["p", " "], ["ty", "str"], ["punc", ","], ["p", " "], ["op", "&"], ["var", "'a"], ["p", " "], ["ty", "str"], ["punc", ")"], ["op", ">"], ["punc", ","]], [["punc", "}"]], [], [["kw", "impl"], ["op", "<"], ["var", "'a"], ["op", ">"], ["p", " "], ["ty", "Theme"], ["op", "<"], ["var", "'a"], ["op", ">"], ["p", " "], ["kw", "for"], ["p", " "], ["ty", "Palette"], ["op", "<"], ["var", "'a"], ["op", ">"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "const"], ["p", " "], ["con", "NAME"], ["op", ":"], ["p", " "], ["op", "&"], ["var", "'static"], ["p", " "], ["ty", "str"], ["p", " "], ["op", "="], ["p", " "], ["str", "\"dupre\""], ["punc", ";"]], [["p", " "], ["kw", "fn"], ["p", " "], ["fnd", "resolve"], ["punc", "("], ["op", "&"], ["var", "'a"], ["p", " "], ["var", "self"], ["punc", ","], ["p", " "], ["var", "key"], ["op", ":"], ["p", " "], ["op", "&"], ["var", "'a"], ["p", " "], ["ty", "str"], ["punc", ")"], ["p", " "], ["op", "->"], ["p", " "], ["ty", "Option"], ["op", "<"], ["op", "&"], ["var", "'a"], ["p", " "], ["ty", "str"], ["op", ">"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "if"], ["p", " "], ["var", "key"], ["op", "."], ["fnc", "is_empty"], ["punc", "()"], ["p", " "], ["punc", "{"], ["p", " "], ["kw", "return"], ["p", " "], ["con", "None"], ["punc", ";"], ["p", " "], ["punc", "}"]], [["p", " "], ["var", "self"], ["op", "."], ["prop", "colors"], ["op", "."], ["fnc", "iter"], ["punc", "()"], ["op", "."], ["fnc", "find"], ["punc", "("], ["op", "|"], ["punc", "("], ["var", "k"], ["punc", ","], ["p", " "], ["var", "_"], ["punc", ")"], ["op", "|"], ["p", " "], ["op", "*"], ["var", "k"], ["p", " "], ["op", "=="], ["p", " "], ["var", "key"], ["punc", ")"], ["op", "."], ["fnc", "map"], ["punc", "("], ["op", "|"], ["punc", "("], ["var", "_"], ["punc", ","], ["p", " "], ["var", "v"], ["punc", ")"], ["op", "|"], ["p", " "], ["op", "*"], ["var", "v"], ["punc", ")"]], [["p", " "], ["punc", "}"]], [["punc", "}"]], [], [["kw", "fn"], ["p", " "], ["fnd", "main"], ["punc", "()"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "let"], ["p", " "], ["var", "palette"], ["p", " "], ["op", "="], ["p", " "], ["ty", "Palette"], ["p", " "], ["punc", "{"], ["p", " "], ["prop", "name"], ["op", ":"], ["p", " "], ["str", "\"dupre\""], ["punc", ","], ["p", " "], ["prop", "colors"], ["op", ":"], ["p", " "], ["bi", "vec!"], ["punc", "["], ["punc", "("], ["str", "\"bg\""], ["punc", ","], ["p", " "], ["str", "\"#0d0b0a\""], ["punc", ")"], ["punc", "]"], ["p", " "], ["punc", "}"], ["punc", ";"]], [["p", " "], ["bi", "println!"], ["punc", "("], ["str", "\"{:?}\""], ["punc", ","], ["p", " "], ["var", "palette"], ["op", "."], ["fnc", "resolve"], ["punc", "("], ["str", "\"bg\""], ["punc", "))"], ["punc", ";"]], [["punc", "}"]]], "Zig": [[["cmd", "//"], ["cm", " theme.zig"]], [["kw", "const"], ["p", " "], ["var", "std"], ["p", " "], ["op", "="], ["p", " "], ["bi", "@import"], ["punc", "("], ["str", "\"std\""], ["punc", ")"], ["punc", ";"]], [["kw", "const"], ["p", " "], ["ty", "Allocator"], ["p", " "], ["op", "="], ["p", " "], ["var", "std"], ["op", "."], ["var", "mem"], ["op", "."], ["ty", "Allocator"], ["punc", ";"]], [], [["kw", "pub"], ["p", " "], ["kw", "const"], ["p", " "], ["ty", "Theme"], ["p", " "], ["op", "="], ["p", " "], ["kw", "struct"], ["p", " "], ["punc", "{"]], [["p", " "], ["prop", "name"], ["op", ":"], ["p", " "], ["punc", "["], ["punc", "]"], ["kw", "const"], ["p", " "], ["ty", "u8"], ["punc", ","]], [["p", " "], ["prop", "colors"], ["op", ":"], ["p", " "], ["punc", "["], ["punc", "]"], ["kw", "const"], ["p", " "], ["ty", "Color"], ["punc", ","]], [], [["p", " "], ["kw", "pub"], ["p", " "], ["kw", "fn"], ["p", " "], ["fnd", "init"], ["punc", "("], ["var", "alloc"], ["op", ":"], ["p", " "], ["op", "*"], ["ty", "Allocator"], ["punc", ")"], ["p", " "], ["op", "!"], ["bi", "@This"], ["punc", "()"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "const"], ["p", " "], ["var", "colors"], ["p", " "], ["op", "="], ["p", " "], ["kw", "try"], ["p", " "], ["var", "alloc"], ["op", "."], ["fnc", "alloc"], ["punc", "("], ["ty", "Color"], ["punc", ","], ["p", " "], ["num", "2"], ["punc", ")"], ["punc", ";"]], [["p", " "], ["var", "colors"], ["punc", "["], ["num", "0"], ["punc", "]"], ["p", " "], ["op", "="], ["p", " "], ["ty", "Color"], ["punc", "{"], ["p", " "], ["prop", ".name"], ["p", " "], ["op", "="], ["p", " "], ["str", "\"bg\""], ["punc", ","], ["p", " "], ["prop", ".hex"], ["p", " "], ["op", "="], ["p", " "], ["str", "\"#0d0b0a\""], ["p", " "], ["punc", "}"], ["punc", ";"]], [["p", " "], ["kw", "return"], ["p", " "], ["bi", "@This"], ["punc", "()"], ["punc", "{"], ["p", " "], ["prop", ".name"], ["p", " "], ["op", "="], ["p", " "], ["str", "\"dupre\""], ["punc", ","], ["p", " "], ["prop", ".colors"], ["p", " "], ["op", "="], ["p", " "], ["var", "colors"], ["p", " "], ["punc", "}"], ["punc", ";"]], [["p", " "], ["punc", "}"]], [["punc", "}"], ["punc", ";"]], [], [["kw", "const"], ["p", " "], ["ty", "Color"], ["p", " "], ["op", "="], ["p", " "], ["kw", "struct"], ["p", " "], ["punc", "{"], ["p", " "], ["prop", "name"], ["op", ":"], ["p", " "], ["punc", "["], ["punc", "]"], ["kw", "const"], ["p", " "], ["ty", "u8"], ["punc", ","], ["p", " "], ["prop", "hex"], ["op", ":"], ["p", " "], ["punc", "["], ["punc", "]"], ["kw", "const"], ["p", " "], ["ty", "u8"], ["p", " "], ["punc", "}"], ["punc", ";"]], [], [["kw", "fn"], ["p", " "], ["fnd", "resolve"], ["punc", "("], ["var", "theme"], ["op", ":"], ["p", " "], ["ty", "Theme"], ["punc", ","], ["p", " "], ["kw", "comptime"], ["p", " "], ["var", "key"], ["op", ":"], ["p", " "], ["punc", "["], ["punc", ":"], ["num", "0"], ["punc", "]"], ["kw", "const"], ["p", " "], ["ty", "u8"], ["punc", ")"], ["p", " "], ["op", "!"], ["punc", "["], ["punc", "]"], ["kw", "const"], ["p", " "], ["ty", "u8"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "inline"], ["p", " "], ["kw", "for"], ["p", " "], ["punc", "("], ["var", "theme"], ["op", "."], ["prop", "colors"], ["punc", ")"], ["p", " "], ["op", "|"], ["var", "color"], ["op", "|"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "if"], ["p", " "], ["punc", "("], ["var", "std"], ["op", "."], ["var", "mem"], ["op", "."], ["fnc", "eql"], ["punc", "("], ["ty", "u8"], ["punc", ","], ["p", " "], ["var", "color"], ["op", "."], ["prop", "name"], ["punc", ","], ["p", " "], ["var", "key"], ["punc", ")"], ["punc", ")"], ["p", " "], ["kw", "return"], ["p", " "], ["var", "color"], ["op", "."], ["prop", "hex"], ["punc", ";"]], [["p", " "], ["punc", "}"]], [["p", " "], ["kw", "return"], ["p", " "], ["con", "error.MissingColor"], ["punc", ";"]], [["punc", "}"]], [], [["kw", "test"], ["p", " "], ["str", "\"resolve bg\""], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "var"], ["p", " "], ["var", "arena"], ["p", " "], ["op", "="], ["p", " "], ["var", "std"], ["op", "."], ["var", "heap"], ["op", "."], ["ty", "ArenaAllocator"], ["op", "."], ["fnc", "init"], ["punc", "("], ["var", "std"], ["op", "."], ["var", "testing"], ["op", "."], ["prop", "allocator"], ["punc", ")"], ["punc", ";"]], [["p", " "], ["kw", "defer"], ["p", " "], ["var", "arena"], ["op", "."], ["fnc", "deinit"], ["punc", "()"], ["punc", ";"]], [["p", " "], ["kw", "try"], ["p", " "], ["var", "std"], ["op", "."], ["var", "testing"], ["op", "."], ["fnc", "expectEqualStrings"], ["punc", "("], ["str", "\"#0d0b0a\""], ["punc", ","], ["p", " "], ["kw", "try"], ["p", " "], ["fnc", "resolve"], ["punc", "("], ["kw", "try"], ["p", " "], ["ty", "Theme"], ["op", "."], ["fnc", "init"], ["punc", "("], ["op", "&"], ["var", "arena"], ["op", "."], ["prop", "allocator"], ["punc", ")"], ["punc", ","], ["p", " "], ["str", "\"bg\""], ["punc", "))"], ["punc", ";"]], [["punc", "}"]]], "Shell": [[["cmd", "#!"], ["cm", "/bin/bash"]], [["cmd", "#"], ["cm", " deploy.sh"]], [["bi", "set"], ["p", " "], ["op", "-"], ["var", "euo"], ["p", " "], ["var", "pipefail"]], [], [["var", "PORT"], ["op", "="], ["num", "8080"]], [["var", "NAME"], ["op", "="], ["str", "\"dupre\""]], [], [["fnd", "deploy"], ["punc", "()"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "local"], ["p", " "], ["var", "target"], ["op", "="], ["str", "\"$1\""]], [["p", " "], ["kw", "if"], ["p", " "], ["punc", "[["], ["p", " "], ["op", "-z"], ["p", " "], ["str", "\"$target\""], ["p", " "], ["punc", "]]"], ["punc", ";"], ["p", " "], ["kw", "then"]], [["p", " "], ["bi", "echo"], ["p", " "], ["str", "\"no target\""]], [["p", " "], ["kw", "return"], ["p", " "], ["num", "1"]], [["p", " "], ["kw", "fi"]], [["p", " "], ["fnc", "rsync"], ["p", " "], ["op", "-az"], ["p", " "], ["str", "\"$NAME\""], ["p", " "], ["str", "\"$target\""]], [["punc", "}"]], [], [["fnd", "main"], ["punc", "()"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "for"], ["p", " "], ["var", "host"], ["p", " "], ["kw", "in"], ["p", " "], ["str", "\"$@\""], ["punc", ";"], ["p", " "], ["kw", "do"]], [["p", " "], ["fnc", "deploy"], ["p", " "], ["str", "\"$host\""], ["p", " "], ["op", "||"], ["p", " "], ["bi", "exit"], ["p", " "], ["num", "1"]], [["p", " "], ["kw", "done"]], [["p", " "], ["bi", "echo"], ["p", " "], ["op", "-e"], ["p", " "], ["str", "\"all done"], ["esc", "\\n"], ["str", "\""]], [["punc", "}"]], [], [["fnc", "main"], ["p", " "], ["str", "\"$@\""]]], "Racket": [[["pp", "#lang"], ["p", " "], ["pp", "racket"]], [], [["cmd", ";;"], ["p", " "], ["cm", "Compute Fibonacci numbers with memoization"]], [["punc", "("], ["kw", "require"], ["p", " "], ["var", "racket/list"], ["punc", ")"]], [], [["punc", "("], ["kw", "define"], ["p", " "], ["punc", "("], ["fnd", "fib"], ["p", " "], ["var", "n"], ["punc", ")"]], [["p", " "], ["punc", "("], ["kw", "cond"], ["p", " "]], [["p", " "], ["punc", "[("], ["bi", "<"], ["p", " "], ["var", "n"], ["p", " "], ["num", "2"], ["punc", ")"], ["p", " "], ["var", "n"], ["punc", "]"]], [["p", " "], ["punc", "["], ["con", "else"], ["p", " "]], [["p", " "], ["punc", "("], ["bi", "+"], ["p", " "], ["punc", "("], ["fnc", "fib"], ["p", " "], ["punc", "("], ["bi", "-"], ["p", " "], ["var", "n"], ["p", " "], ["num", "1"], ["punc", "))"], ["p", " "]], [["p", " "], ["punc", "("], ["fnc", "fib"], ["p", " "], ["punc", "("], ["bi", "-"], ["p", " "], ["var", "n"], ["p", " "], ["num", "2"], ["punc", ")))])]"]], [], [["cmd", ";;"], ["p", " "], ["cm", "A point struct with two fields"]], [["punc", "("], ["kw", "struct"], ["p", " "], ["ty", "point"], ["p", " "], ["punc", "("], ["prop", "x"], ["p", " "], ["prop", "y"], ["punc", ")"], ["p", " "], ["con", "#:transparent"], ["punc", ")"]], [], [["punc", "("], ["kw", "define"], ["p", " "], ["var", "origin"], ["p", " "], ["punc", "("], ["fnc", "point"], ["p", " "], ["num", "0"], ["p", " "], ["num", "0"], ["punc", "))"]], [], [["punc", "("], ["kw", "define"], ["p", " "], ["var", "nums"], ["p", " "], ["punc", "("], ["kw", "quote"], ["p", " "], ["punc", "("], ["num", "1"], ["p", " "], ["num", "2"], ["p", " "], ["num", "3"], ["p", " "], ["num", "4"], ["p", " "], ["num", "5"], ["punc", "))"]], [], [["punc", "("], ["kw", "define"], ["p", " "], ["var", "squared"], ["p", " "]], [["p", " "], ["punc", "("], ["bi", "map"], ["p", " "], ["punc", "("], ["kw", "lambda"], ["p", " "], ["punc", "("], ["var", "x"], ["punc", ")"], ["p", " "], ["punc", "("], ["bi", "*"], ["p", " "], ["var", "x"], ["p", " "], ["var", "x"], ["punc", "))"], ["p", " "], ["var", "nums"], ["punc", "))"]], [], [["punc", "("], ["bi", "printf"], ["p", " "], ["str", "\"squares: ~a\\n\""], ["p", " "], ["var", "squared"], ["punc", ")"]], [["punc", "("], ["bi", "displayln"], ["p", " "], ["punc", "("], ["fnc", "first"], ["p", " "], ["var", "squared"], ["punc", "))"]]], "Scheme": [[["cmd", ";;"], ["p", " "], ["cm", "Tail-recursive factorial in Scheme"]], [], [["punc", "("], ["kw", "define"], ["p", " "], ["punc", "("], ["fnd", "factorial"], ["p", " "], ["var", "n"], ["punc", ")"]], [["p", " "], ["punc", "("], ["kw", "let"], ["p", " "], ["fnd", "loop"], ["p", " "], ["punc", "(["], ["var", "acc"], ["p", " "], ["num", "1"], ["punc", "]"], ["p", " "], ["punc", "["], ["var", "i"], ["p", " "], ["var", "n"], ["punc", "])"]], [["p", " "], ["punc", "("], ["kw", "if"], ["p", " "], ["punc", "("], ["bi", "="], ["p", " "], ["var", "i"], ["p", " "], ["num", "0"], ["punc", ")"]], [["p", " "], ["var", "acc"], ["p", " "]], [["p", " "], ["punc", "("], ["fnc", "loop"], ["p", " "], ["punc", "("], ["bi", "*"], ["p", " "], ["var", "acc"], ["p", " "], ["var", "i"], ["punc", ")"], ["p", " "], ["punc", "("], ["bi", "-"], ["p", " "], ["var", "i"], ["p", " "], ["num", "1"], ["punc", "))))"]], [], [["cmd", ";;"], ["p", " "], ["cm", "Higher-order map over a quoted list"]], [["punc", "("], ["kw", "define"], ["p", " "], ["var", "primes"], ["p", " "], ["punc", "("], ["kw", "quote"], ["p", " "], ["punc", "("], ["num", "2"], ["p", " "], ["num", "3"], ["p", " "], ["num", "5"], ["p", " "], ["num", "7"], ["p", " "], ["num", "11"], ["punc", "))"]], [], [["punc", "("], ["kw", "define"], ["p", " "], ["punc", "("], ["fnd", "double"], ["p", " "], ["var", "x"], ["punc", ")"]], [["p", " "], ["punc", "("], ["bi", "*"], ["p", " "], ["var", "x"], ["p", " "], ["num", "2"], ["punc", ")"]], [], [["punc", "("], ["kw", "define"], ["p", " "], ["var", "doubled"], ["p", " "], ["punc", "("], ["bi", "map"], ["p", " "], ["var", "double"], ["p", " "], ["var", "primes"], ["punc", "))"]], [], [["cmd", ";;"], ["p", " "], ["cm", "Predicate using cond and recursion"]], [["punc", "("], ["kw", "define"], ["p", " "], ["punc", "("], ["fnd", "member?"], ["p", " "], ["var", "x"], ["p", " "], ["var", "lst"], ["punc", ")"]], [["p", " "], ["punc", "("], ["kw", "cond"], ["p", " "]], [["p", " "], ["punc", "[("], ["bi", "null?"], ["p", " "], ["var", "lst"], ["punc", ")"], ["p", " "], ["con", "#f"], ["punc", "]"]], [["p", " "], ["punc", "[("], ["bi", "equal?"], ["p", " "], ["punc", "("], ["bi", "car"], ["p", " "], ["var", "lst"], ["punc", ")"], ["p", " "], ["var", "x"], ["punc", ")"], ["p", " "], ["con", "#t"], ["punc", "]"]], [["p", " "], ["punc", "["], ["con", "else"], ["p", " "], ["punc", "("], ["fnc", "member?"], ["p", " "], ["var", "x"], ["p", " "], ["punc", "("], ["bi", "cdr"], ["p", " "], ["var", "lst"], ["punc", "))]"], ["punc", ")"]], [], [["punc", "("], ["bi", "display"], ["p", " "], ["punc", "("], ["fnc", "member?"], ["p", " "], ["num", "5"], ["p", " "], ["var", "primes"], ["punc", "))"]], [["punc", "("], ["bi", "newline"], ["punc", ")"]]], "Haskell": [[["cmd", "-- |"], ["cm", " Compute statistics over a stream of samples."]], [["pp", "{-# LANGUAGE ScopedTypeVariables #-}"]], [["kw", "module"], ["p", " "], ["ty", "Stats"], ["p", " "], ["punc", "("], ["var", "mean"], ["punc", ","], ["p", " "], ["var", "variance"], ["punc", ")"], ["p", " "], ["kw", "where"]], [], [["kw", "import"], ["p", " "], ["kw", "qualified"], ["p", " "], ["ty", "Data.List"], ["p", " "], ["kw", "as"], ["p", " "], ["ty", "L"]], [], [["cmd", "-- |"], ["cm", " A labelled measurement."]], [["kw", "data"], ["p", " "], ["ty", "Sample"], ["p", " "], ["op", "="], ["p", " "], ["ty", "Sample"]], [["p", " "], ["p", " "], ["punc", "{"], ["p", " "], ["prop", "label"], ["p", " "], ["op", "::"], ["p", " "], ["ty", "String"]], [["p", " "], ["p", " "], ["punc", ","], ["p", " "], ["prop", "value"], ["p", " "], ["op", "::"], ["p", " "], ["ty", "Double"]], [["p", " "], ["p", " "], ["punc", "}"], ["p", " "], ["kw", "deriving"], ["p", " "], ["punc", "("], ["ty", "Show"], ["punc", ","], ["p", " "], ["ty", "Eq"], ["punc", ")"]], [], [["cmd", "-- |"], ["cm", " Arithmetic mean; returns 0 for an empty list."]], [["fnd", "mean"], ["p", " "], ["op", "::"], ["p", " "], ["punc", "["], ["ty", "Double"], ["punc", "]"], ["p", " "], ["op", "->"], ["p", " "], ["ty", "Double"]], [["fnd", "mean"], ["p", " "], ["con", "[]"], ["p", " "], ["op", "="], ["p", " "], ["num", "0"]], [["fnd", "mean"], ["p", " "], ["var", "xs"], ["p", " "], ["op", "="], ["p", " "], ["fnc", "sum"], ["p", " "], ["var", "xs"], ["p", " "], ["op", "/"], ["p", " "], ["fnc", "fromIntegral"], ["p", " "], ["punc", "("], ["fnc", "length"], ["p", " "], ["var", "xs"], ["punc", ")"]], [], [["fnd", "variance"], ["p", " "], ["op", "::"], ["p", " "], ["punc", "["], ["ty", "Double"], ["punc", "]"], ["p", " "], ["op", "->"], ["p", " "], ["ty", "Double"]], [["fnd", "variance"], ["p", " "], ["var", "xs"], ["p", " "], ["op", "="], ["p", " "], ["kw", "let"], ["p", " "], ["var", "m"], ["p", " "], ["op", "="], ["p", " "], ["fnc", "mean"], ["p", " "], ["var", "xs"]], [["p", " "], ["kw", "in"], ["p", " "], ["fnc", "mean"], ["p", " "], ["punc", "["], ["p", " "], ["punc", "("], ["var", "x"], ["p", " "], ["op", "-"], ["p", " "], ["var", "m"], ["punc", ")"], ["p", " "], ["op", "^"], ["p", " "], ["num", "2"], ["p", " "], ["op", "|"], ["p", " "], ["var", "x"], ["p", " "], ["op", "<-"], ["p", " "], ["var", "xs"], ["p", " "], ["punc", "]"]], [], [["cmd", "-- |"], ["cm", " Demo entry point."]], [["fnd", "main"], ["p", " "], ["op", "::"], ["p", " "], ["ty", "IO"], ["p", " "], ["punc", "("], ["punc", ")"]], [["fnd", "main"], ["p", " "], ["op", "="], ["p", " "], ["kw", "do"]], [["p", " "], ["kw", "let"], ["p", " "], ["var", "samples"], ["p", " "], ["op", "="], ["p", " "], ["punc", "["], ["num", "1.0"], ["punc", ","], ["p", " "], ["num", "2.5"], ["punc", ","], ["p", " "], ["num", "3.5"], ["punc", "]"]], [["p", " "], ["fnc", "putStrLn"], ["p", " "], ["punc", "("], ["str", "\"mean = \""], ["p", " "], ["op", "++"], ["p", " "], ["fnc", "show"], ["p", " "], ["punc", "("], ["fnc", "mean"], ["p", " "], ["var", "samples"], ["punc", "))"]]], "OCaml": [[["cmd", "(*"], ["cm", " Simple expression evaluator with variant types. "], ["cmd", "*)"]], [], [["kw", "type"], ["p", " "], ["ty", "expr"], ["p", " "], ["op", "="]], [["p", " "], ["p", " "], ["op", "|"], ["p", " "], ["ty", "Num"], ["p", " "], ["kw", "of"], ["p", " "], ["ty", "float"]], [["p", " "], ["p", " "], ["op", "|"], ["p", " "], ["ty", "Var"], ["p", " "], ["kw", "of"], ["p", " "], ["ty", "string"]], [["p", " "], ["p", " "], ["op", "|"], ["p", " "], ["ty", "Add"], ["p", " "], ["kw", "of"], ["p", " "], ["ty", "expr"], ["p", " "], ["op", "*"], ["p", " "], ["ty", "expr"]], [["p", " "], ["p", " "], ["op", "|"], ["p", " "], ["ty", "Mul"], ["p", " "], ["kw", "of"], ["p", " "], ["ty", "expr"], ["p", " "], ["op", "*"], ["p", " "], ["ty", "expr"]], [], [["cmd", "(**"], ["cm", " Evaluate [e] under environment [env]. "], ["cmd", "*)"]], [["kw", "let"], ["p", " "], ["kw", "rec"], ["p", " "], ["fnd", "eval"], ["p", " "], ["var", "env"], ["p", " "], ["var", "e"], ["p", " "], ["op", "="]], [["p", " "], ["kw", "match"], ["p", " "], ["var", "e"], ["p", " "], ["kw", "with"]], [["p", " "], ["op", "|"], ["p", " "], ["ty", "Num"], ["p", " "], ["var", "n"], ["p", " "], ["op", "->"], ["p", " "], ["var", "n"]], [["p", " "], ["op", "|"], ["p", " "], ["ty", "Var"], ["p", " "], ["var", "x"], ["p", " "], ["op", "->"], ["p", " "], ["ty", "List"], ["punc", "."], ["fnc", "assoc"], ["p", " "], ["var", "x"], ["p", " "], ["var", "env"]], [["p", " "], ["op", "|"], ["p", " "], ["ty", "Add"], ["p", " "], ["punc", "("], ["var", "a"], ["punc", ","], ["p", " "], ["var", "b"], ["punc", ")"], ["p", " "], ["op", "->"], ["p", " "], ["fnc", "eval"], ["p", " "], ["var", "env"], ["p", " "], ["var", "a"], ["p", " "], ["op", "+."], ["p", " "], ["fnc", "eval"], ["p", " "], ["var", "env"], ["p", " "], ["var", "b"]], [["p", " "], ["op", "|"], ["p", " "], ["ty", "Mul"], ["p", " "], ["punc", "("], ["var", "a"], ["punc", ","], ["p", " "], ["var", "b"], ["punc", ")"], ["p", " "], ["op", "->"], ["p", " "], ["fnc", "eval"], ["p", " "], ["var", "env"], ["p", " "], ["var", "a"], ["p", " "], ["op", "*."], ["p", " "], ["fnc", "eval"], ["p", " "], ["var", "env"], ["p", " "], ["var", "b"]], [], [["kw", "let"], ["p", " "], ["punc", "()"], ["p", " "], ["op", "="], ["p", " "], ["kw", "let"], ["p", " "], ["var", "env"], ["p", " "], ["op", "="], ["p", " "], ["punc", "["], ["p", " "], ["punc", "("], ["str", "\"x\""], ["punc", ","], ["p", " "], ["num", "3.0"], ["punc", ")"], ["p", " "], ["punc", "]"], ["p", " "], ["kw", "in"]], [["p", " "], ["kw", "let"], ["p", " "], ["var", "e"], ["p", " "], ["op", "="], ["p", " "], ["ty", "Add"], ["p", " "], ["punc", "("], ["ty", "Var"], ["p", " "], ["str", "\"x\""], ["punc", ","], ["p", " "], ["ty", "Num"], ["p", " "], ["num", "4.0"], ["punc", ")"], ["p", " "], ["kw", "in"]], [["p", " "], ["ty", "Printf"], ["punc", "."], ["fnc", "printf"], ["p", " "], ["str", "\"result = %g\\n\""], ["p", " "], ["punc", "("], ["fnc", "eval"], ["p", " "], ["var", "env"], ["p", " "], ["var", "e"], ["punc", ")"]]], "Scala": [[["cmd", "//"], ["cm", " Geometry helpers for 2D shapes"]], [["kw", "package"], ["p", " "], ["var", "geometry"]], [], [["kw", "import"], ["p", " "], ["var", "scala"], ["op", "."], ["var", "math"], ["op", "."], ["fnc", "sqrt"]], [], [["dec", "@inline"], ["p", " "], ["kw", "final"], ["p", " "], ["kw", "case"], ["p", " "], ["kw", "class"], ["p", " "], ["ty", "Point"], ["punc", "("], ["kw", "val"], ["p", " "], ["prop", "x"], ["op", ":"], ["p", " "], ["ty", "Double"], ["punc", ","], ["p", " "], ["kw", "val"], ["p", " "], ["prop", "y"], ["op", ":"], ["p", " "], ["ty", "Double"], ["punc", ")"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "def"], ["p", " "], ["fnd", "distanceTo"], ["punc", "("], ["var", "that"], ["op", ":"], ["p", " "], ["ty", "Point"], ["punc", ")"], ["op", ":"], ["p", " "], ["ty", "Double"], ["p", " "], ["op", "="], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "val"], ["p", " "], ["var", "dx"], ["p", " "], ["op", "="], ["p", " "], ["var", "x"], ["p", " "], ["op", "-"], ["p", " "], ["var", "that"], ["op", "."], ["prop", "x"]], [["p", " "], ["kw", "val"], ["p", " "], ["var", "dy"], ["p", " "], ["op", "="], ["p", " "], ["var", "y"], ["p", " "], ["op", "-"], ["p", " "], ["var", "that"], ["op", "."], ["prop", "y"]], [["p", " "], ["fnc", "sqrt"], ["punc", "("], ["var", "dx"], ["p", " "], ["op", "*"], ["p", " "], ["var", "dx"], ["p", " "], ["op", "+"], ["p", " "], ["var", "dy"], ["p", " "], ["op", "*"], ["p", " "], ["var", "dy"], ["punc", ")"]], [["p", " "], ["punc", "}"]], [["punc", "}"]], [], [["kw", "object"], ["p", " "], ["ty", "Geometry"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "val"], ["p", " "], ["var", "origin"], ["p", " "], ["op", "="], ["p", " "], ["ty", "Point"], ["punc", "("], ["num", "0.0"], ["punc", ","], ["p", " "], ["num", "0.0"], ["punc", ")"]], [["p", " "], ["kw", "val"], ["p", " "], ["var", "pts"], ["p", " "], ["op", "="], ["p", " "], ["ty", "List"], ["punc", "("], ["ty", "Point"], ["punc", "("], ["num", "3.0"], ["punc", ","], ["p", " "], ["num", "4.0"], ["punc", "),"], ["p", " "], ["ty", "Point"], ["punc", "("], ["num", "1.0"], ["punc", ","], ["p", " "], ["num", "2.0"], ["punc", "))"]], [["p", " "], ["kw", "val"], ["p", " "], ["var", "dists"], ["p", " "], ["op", "="], ["p", " "], ["kw", "for"], ["p", " "], ["punc", "("], ["var", "p"], ["p", " "], ["op", "<-"], ["p", " "], ["var", "pts"], ["punc", ")"], ["p", " "], ["kw", "yield"], ["p", " "], ["var", "origin"], ["op", "."], ["fnc", "distanceTo"], ["punc", "("], ["var", "p"], ["punc", ")"]], [], [["p", " "], ["kw", "def"], ["p", " "], ["fnd", "main"], ["punc", "("], ["var", "args"], ["op", ":"], ["p", " "], ["ty", "Array"], ["punc", "["], ["ty", "String"], ["punc", "]"], ["punc", ")"], ["op", ":"], ["p", " "], ["ty", "Unit"], ["p", " "], ["op", "="], ["p", " "], ["punc", "{"]], [["p", " "], ["var", "dists"], ["op", "."], ["fnc", "foreach"], ["punc", "("], ["var", "d"], ["p", " "], ["op", "=>"], ["p", " "], ["fnc", "println"], ["punc", "("], ["str", "s\"dist = $d\""], ["punc", ")"], ["punc", ")"]], [["p", " "], ["kw", "val"], ["p", " "], ["var", "ok"], ["p", " "], ["op", "="], ["p", " "], ["var", "dists"], ["op", "."], ["fnc", "nonEmpty"], ["p", " "], ["op", "&&"], ["p", " "], ["con", "true"]], [["p", " "], ["punc", "}"]], [["punc", "}"]]], "Kotlin": [[["cmd", "//"], ["cm", " User repository with a simple cache"]], [["kw", "package"], ["p", " "], ["var", "com"], ["op", "."], ["var", "example"], ["op", "."], ["var", "data"]], [], [["kw", "import"], ["p", " "], ["var", "kotlin"], ["op", "."], ["var", "collections"], ["op", "."], ["var", "mutableMapOf"]], [], [["kw", "data"], ["p", " "], ["kw", "class"], ["p", " "], ["ty", "User"], ["punc", "("], ["kw", "val"], ["p", " "], ["prop", "id"], ["op", ":"], ["p", " "], ["ty", "Int"], ["punc", ","], ["p", " "], ["kw", "val"], ["p", " "], ["prop", "name"], ["op", ":"], ["p", " "], ["ty", "String"], ["punc", ")"]], [], [["kw", "class"], ["p", " "], ["ty", "UserRepo"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "private"], ["p", " "], ["kw", "val"], ["p", " "], ["var", "cache"], ["p", " "], ["op", "="], ["p", " "], ["bi", "mutableMapOf"], ["punc", "<"], ["ty", "Int"], ["punc", ","], ["p", " "], ["ty", "User"], ["punc", ">"], ["punc", "()"]], [], [["p", " "], ["dec", "@JvmStatic"], ["p", " "]], [["p", " "], ["kw", "fun"], ["p", " "], ["fnd", "findById"], ["punc", "("], ["var", "id"], ["op", ":"], ["p", " "], ["ty", "Int"], ["punc", ")"], ["op", ":"], ["p", " "], ["ty", "User"], ["op", "?"], ["p", " "], ["op", "="], ["p", " "], ["var", "cache"], ["punc", "["], ["var", "id"], ["punc", "]"]], [], [["p", " "], ["kw", "fun"], ["p", " "], ["fnd", "save"], ["punc", "("], ["var", "user"], ["op", ":"], ["p", " "], ["ty", "User"], ["punc", ")"], ["p", " "], ["punc", "{"]], [["p", " "], ["var", "cache"], ["punc", "["], ["var", "user"], ["op", "."], ["prop", "id"], ["punc", "]"], ["p", " "], ["op", "="], ["p", " "], ["var", "user"]], [["p", " "], ["bi", "println"], ["punc", "("], ["str", "\"saved "], ["esc", "\\n"], ["str", "\""], ["p", " "], ["op", "+"], ["p", " "], ["var", "user"], ["op", "."], ["prop", "name"], ["punc", ")"]], [["p", " "], ["punc", "}"]], [["punc", "}"]], [], [["kw", "fun"], ["p", " "], ["fnd", "main"], ["punc", "()"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "val"], ["p", " "], ["var", "repo"], ["p", " "], ["op", "="], ["p", " "], ["ty", "UserRepo"], ["punc", "()"]], [["p", " "], ["var", "repo"], ["op", "."], ["fnc", "save"], ["punc", "("], ["ty", "User"], ["punc", "("], ["num", "1"], ["punc", ","], ["p", " "], ["str", "\"Ada\""], ["punc", "))"]], [["p", " "], ["kw", "val"], ["p", " "], ["var", "found"], ["p", " "], ["op", "="], ["p", " "], ["var", "repo"], ["op", "."], ["fnc", "findById"], ["punc", "("], ["num", "1"], ["punc", ")"], ["p", " "], ["op", "?:"], ["p", " "], ["kw", "return"]], [["p", " "], ["bi", "println"], ["punc", "("], ["var", "found"], ["punc", ")"]], [["punc", "}"]]], "Swift": [[["cmd", "//"], ["cm", " Account model with balance guard"]], [["kw", "import"], ["p", " "], ["ty", "Foundation"]], [], [["dec", "@frozen"], ["p", " "]], [["kw", "struct"], ["p", " "], ["ty", "Account"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "let"], ["p", " "], ["prop", "id"], ["op", ":"], ["p", " "], ["ty", "Int"]], [["p", " "], ["kw", "var"], ["p", " "], ["prop", "balance"], ["op", ":"], ["p", " "], ["ty", "Double"], ["p", " "], ["op", "="], ["p", " "], ["num", "0.0"]], [], [["p", " "], ["kw", "func"], ["p", " "], ["fnd", "withdraw"], ["punc", "("], ["var", "amount"], ["op", ":"], ["p", " "], ["ty", "Double"], ["punc", ")"], ["p", " "], ["op", "->"], ["p", " "], ["ty", "Bool"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "guard"], ["p", " "], ["var", "amount"], ["p", " "], ["op", "<="], ["p", " "], ["prop", "balance"], ["p", " "], ["kw", "else"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "return"], ["p", " "], ["con", "false"]], [["p", " "], ["punc", "}"]], [["p", " "], ["prop", "balance"], ["p", " "], ["op", "-="], ["p", " "], ["var", "amount"]], [["p", " "], ["kw", "return"], ["p", " "], ["con", "true"]], [["p", " "], ["punc", "}"]], [["punc", "}"]], [], [["kw", "let"], ["p", " "], ["var", "acct"], ["p", " "], ["op", "="], ["p", " "], ["ty", "Account"], ["punc", "("], ["var", "id"], ["op", ":"], ["p", " "], ["num", "7"], ["punc", ","], ["p", " "], ["var", "balance"], ["op", ":"], ["p", " "], ["num", "100.0"], ["punc", ")"]], [["kw", "var"], ["p", " "], ["var", "copy"], ["p", " "], ["op", "="], ["p", " "], ["var", "acct"]], [["kw", "let"], ["p", " "], ["var", "ok"], ["p", " "], ["op", "="], ["p", " "], ["var", "copy"], ["op", "."], ["fnc", "withdraw"], ["punc", "("], ["var", "amount"], ["op", ":"], ["p", " "], ["num", "30.0"], ["punc", ")"]], [["bi", "print"], ["punc", "("], ["str", "\"acct ok=\""], ["punc", ","], ["p", " "], ["var", "ok"], ["punc", ")"]]], "Lua": [[["cmd", "--"], ["cm", " Account module: balances and transfers"]], [["kw", "local"], ["p", " "], ["ty", "Account"], ["op", "="], ["punc", "{}"]], [["ty", "Account"], ["punc", "."], ["prop", "__index"], ["op", "="], ["ty", "Account"]], [], [["kw", "local"], ["p", " "], ["var", "rates"], ["op", "="], ["p", " "], ["punc", "{"], ["str", "\"usd\""], ["op", "="], ["num", "1.0"], ["punc", ","], ["p", " "], ["str", "\"eur\""], ["op", "="], ["num", "0.92"], ["punc", "}"]], [], [["kw", "function"], ["p", " "], ["ty", "Account"], ["op", "."], ["fnd", "new"], ["punc", "("], ["var", "name"], ["punc", ","], ["p", " "], ["var", "balance"], ["punc", ")"]], [["p", " "], ["kw", "local"], ["p", " "], ["var", "self"], ["op", "="], ["p", " "], ["fnc", "setmetatable"], ["punc", "("], ["punc", "{}"], ["punc", ","], ["p", " "], ["ty", "Account"], ["punc", ")"]], [["p", " "], ["var", "self"], ["punc", "."], ["prop", "name"], ["op", "="], ["var", "name"]], [["p", " "], ["var", "self"], ["punc", "."], ["prop", "balance"], ["op", "="], ["p", " "], ["var", "balance"], ["p", " "], ["kw", "or"], ["p", " "], ["num", "0"]], [["p", " "], ["kw", "return"], ["p", " "], ["var", "self"]], [["kw", "end"]], [], [["kw", "function"], ["p", " "], ["ty", "Account"], ["op", ":"], ["fnd", "report"], ["punc", "()"]], [["p", " "], ["kw", "for"], ["p", " "], ["var", "code"], ["punc", ","], ["p", " "], ["var", "rate"], ["p", " "], ["kw", "in"], ["p", " "], ["bi", "pairs"], ["punc", "("], ["var", "rates"], ["punc", ")"], ["p", " "], ["kw", "do"]], [["p", " "], ["bi", "print"], ["punc", "("], ["var", "code"], ["punc", ","], ["p", " "], ["var", "self"], ["punc", "."], ["prop", "balance"], ["p", " "], ["op", "*"], ["p", " "], ["var", "rate"], ["punc", ")"]], [["p", " "], ["kw", "end"]], [["p", " "], ["kw", "if"], ["p", " "], ["var", "self"], ["punc", "."], ["prop", "balance"], ["p", " "], ["op", "=="], ["p", " "], ["num", "0"], ["p", " "], ["kw", "then"]], [["p", " "], ["kw", "return"], ["p", " "], ["con", "nil"]], [["p", " "], ["kw", "end"]], [["p", " "], ["kw", "return"], ["p", " "], ["con", "true"]], [["kw", "end"]]], "Ruby": [[["cmd", "#"], ["cm", " Inventory tracker with tagged items"]], [["kw", "class"], ["p", " "], ["ty", "Inventory"]], [["p", " "], ["kw", "def"], ["p", " "], ["fnd", "initialize"], ["punc", "("], ["var", "items"], ["p", " "], ["op", "="], ["p", " "], ["punc", "[]"], ["punc", ")"]], [["p", " "], ["var", "@items"], ["p", " "], ["op", "="], ["p", " "], ["var", "items"]], [["p", " "], ["var", "@tags"], ["p", " "], ["op", "="], ["p", " "], ["punc", "{"], ["prop", "sku:"], ["p", " "], ["con", "nil"], ["punc", "}"]], [["p", " "], ["kw", "end"]], [], [["p", " "], ["kw", "def"], ["p", " "], ["fnd", "add"], ["punc", "("], ["var", "name"], ["punc", ","], ["p", " "], ["var", "price"], ["punc", ")"]], [["p", " "], ["kw", "return"], ["p", " "], ["con", "false"], ["p", " "], ["kw", "unless"], ["p", " "], ["var", "name"], ["p", " "], ["op", "=~"], ["p", " "], ["re", "/\\A\\w+\\z/"]], [["p", " "], ["var", "@items"], ["p", " "], ["op", "<<"], ["p", " "], ["punc", "{"], ["p", " "], ["prop", "name:"], ["p", " "], ["var", "name"], ["punc", ","], ["p", " "], ["prop", "price:"], ["p", " "], ["var", "price"], ["p", " "], ["punc", "}"]], [["p", " "], ["kw", "end"]], [], [["p", " "], ["kw", "def"], ["p", " "], ["fnd", "total"], ["punc", "("], ["var", "tax"], ["p", " "], ["op", "="], ["p", " "], ["num", "0.08"], ["punc", ")"]], [["p", " "], ["var", "sum"], ["p", " "], ["op", "="], ["p", " "], ["num", "0"]], [["p", " "], ["var", "@items"], ["punc", "."], ["fnc", "each"], ["p", " "], ["kw", "do"], ["p", " "], ["punc", "|"], ["var", "item"], ["punc", "|"]], [["p", " "], ["var", "sum"], ["p", " "], ["op", "+="], ["p", " "], ["var", "item"], ["punc", "["], ["prop", ":price"], ["punc", "]"]], [["p", " "], ["kw", "end"]], [["p", " "], ["bi", "printf"], ["punc", "("], ["str", "\"total: %.2f\\n\""], ["punc", ","], ["p", " "], ["var", "sum"], ["p", " "], ["op", "*"], ["p", " "], ["punc", "("], ["num", "1"], ["p", " "], ["op", "+"], ["p", " "], ["var", "tax"], ["punc", "))"]], [["p", " "], ["kw", "end"]], [["kw", "end"]]], "Perl": [[["cmd", "#"], ["cm", "!/usr/bin/perl"]], [["kw", "use"], ["p", " "], ["pp", "strict"], ["punc", ";"]], [["kw", "use"], ["p", " "], ["pp", "warnings"], ["punc", ";"]], [], [["cmd", "#"], ["cm", " Parse a config line into a hash"]], [["kw", "sub"], ["p", " "], ["fnd", "parse_config"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "my"], ["p", " "], ["punc", "("], ["var", "$line"], ["punc", ")"], ["p", " "], ["op", "="], ["p", " "], ["var", "@_"], ["punc", ";"]], [["p", " "], ["kw", "my"], ["p", " "], ["var", "%conf"], ["p", " "], ["op", "="], ["p", " "], ["punc", "()"], ["punc", ";"]], [], [["p", " "], ["kw", "if"], ["p", " "], ["punc", "("], ["var", "$line"], ["p", " "], ["op", "=~"], ["p", " "], ["re", "/^(\\w+)\\s*=\\s*(.+)$/"], ["punc", ")"], ["p", " "], ["punc", "{"]], [["p", " "], ["var", "$conf"], ["punc", "{"], ["var", "$1"], ["punc", "}"], ["p", " "], ["op", "="], ["p", " "], ["var", "$2"], ["punc", ";"]], [["p", " "], ["punc", "}"]], [], [["p", " "], ["kw", "return"], ["p", " "], ["op", "\\"], ["var", "%conf"], ["punc", ";"]], [["punc", "}"]], [], [["kw", "my"], ["p", " "], ["var", "$ref"], ["p", " "], ["op", "="], ["p", " "], ["fnc", "parse_config"], ["punc", "("], ["str", "\"host = localhost\""], ["punc", ")"], ["punc", ";"]], [["kw", "my"], ["p", " "], ["var", "@keys"], ["p", " "], ["op", "="], ["p", " "], ["bi", "keys"], ["p", " "], ["var", "%$ref"], ["punc", ";"]], [["bi", "print"], ["p", " "], ["var", "@keys"], ["punc", ";"]]], "R": [[["cmd", "#"], ["cm", " Summarize sales by region and fit a model"]], [["var", "library"], ["punc", "("], ["bi", "dplyr"], ["punc", ")"]], [], [["var", "sales"], ["p", " "], ["op", "<-"], ["p", " "], ["fnc", "read.csv"], ["punc", "("], ["str", "\"sales.csv\""], ["punc", ","], ["p", " "], ["prop", "stringsAsFactors"], ["p", " "], ["op", "="], ["p", " "], ["con", "FALSE"], ["punc", ")"]], [["var", "regions"], ["p", " "], ["op", "<-"], ["p", " "], ["bi", "c"], ["punc", "("], ["str", "\"North\""], ["punc", ","], ["p", " "], ["str", "\"South\""], ["punc", ","], ["p", " "], ["str", "\"East\""], ["punc", ","], ["p", " "], ["str", "\"West\""], ["punc", ")"]], [], [["cmd", "#"], ["cm", " Compute mean revenue per region"]], [["fnd", "summarize_region"], ["p", " "], ["op", "<-"], ["p", " "], ["kw", "function"], ["punc", "("], ["var", "df"], ["punc", ","], ["p", " "], ["var", "reg"], ["punc", ")"], ["p", " "], ["punc", "{"]], [["p", " "], ["var", "subset"], ["p", " "], ["op", "<-"], ["p", " "], ["var", "df"], ["punc", "["], ["var", "df"], ["op", "$"], ["prop", "region"], ["p", " "], ["op", "=="], ["p", " "], ["var", "reg"], ["punc", ","], ["p", " "], ["punc", "]"]], [["p", " "], ["kw", "if"], ["p", " "], ["punc", "("], ["fnc", "nrow"], ["punc", "("], ["var", "subset"], ["punc", ")"], ["p", " "], ["op", "=="], ["p", " "], ["num", "0"], ["punc", ")"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "return"], ["punc", "("], ["con", "NA"], ["punc", ")"]], [["p", " "], ["punc", "}"]], [["p", " "], ["fnc", "mean"], ["punc", "("], ["var", "subset"], ["op", "$"], ["prop", "revenue"], ["punc", ","], ["p", " "], ["prop", "na.rm"], ["p", " "], ["op", "="], ["p", " "], ["con", "TRUE"], ["punc", ")"]], [["punc", "}"]], [], [["var", "means"], ["p", " "], ["op", "<-"], ["p", " "], ["fnc", "sapply"], ["punc", "("], ["var", "regions"], ["punc", ","], ["p", " "], ["kw", "function"], ["punc", "("], ["var", "r"], ["punc", ")"], ["p", " "], ["fnc", "summarize_region"], ["punc", "("], ["var", "sales"], ["punc", ","], ["p", " "], ["var", "r"], ["punc", ")"], ["punc", ")"]], [["var", "sales"], ["p", " "], ["op", "%>%"], ["p", " "], ["fnc", "filter"], ["punc", "("], ["prop", "revenue"], ["p", " "], ["op", ">"], ["p", " "], ["num", "1000"], ["punc", ")"], ["p", " "], ["op", "%>%"], ["p", " "], ["fnc", "head"], ["punc", "("], ["num", "5"], ["punc", ")"]], [], [["var", "model"], ["p", " "], ["op", "<-"], ["p", " "], ["fnc", "lm"], ["punc", "("], ["prop", "revenue"], ["p", " "], ["op", "~"], ["p", " "], ["prop", "units"], ["p", " "], ["op", "+"], ["p", " "], ["prop", "region"], ["punc", ","], ["p", " "], ["prop", "data"], ["p", " "], ["op", "="], ["p", " "], ["var", "sales"], ["punc", ")"]], [["fnc", "print"], ["punc", "("], ["fnc", "summary"], ["punc", "("], ["var", "model"], ["punc", ")"], ["punc", ")"]]], "Erlang": [[["cmd", "%"], ["cm", " Bank account server with pattern matching"]], [["pp", "-module"], ["punc", "("], ["ty", "bank"], ["punc", ")."]], [["pp", "-export"], ["punc", "(["], ["fnc", "start"], ["op", "/"], ["num", "0"], ["punc", ","], ["p", " "], ["fnc", "balance"], ["op", "/"], ["num", "1"], ["punc", "])"], ["punc", "."]], [], [["fnd", "start"], ["punc", "()"], ["p", " "], ["op", "->"]], [["p", " "], ["fnc", "spawn"], ["punc", "("], ["kw", "fun"], ["punc", "()"], ["p", " "], ["op", "->"], ["p", " "], ["fnc", "loop"], ["punc", "("], ["num", "0"], ["punc", ")"], ["p", " "], ["kw", "end"], ["punc", ")."]], [], [["fnd", "loop"], ["punc", "("], ["var", "Balance"], ["punc", ")"], ["p", " "], ["op", "->"]], [["p", " "], ["kw", "receive"]], [["p", " "], ["punc", "{"], ["con", "deposit"], ["punc", ","], ["p", " "], ["var", "Amount"], ["punc", "}"], ["p", " "], ["kw", "when"], ["p", " "], ["var", "Amount"], ["p", " "], ["op", ">"], ["p", " "], ["num", "0"], ["p", " "], ["op", "->"]], [["p", " "], ["fnc", "loop"], ["punc", "("], ["var", "Balance"], ["p", " "], ["op", "+"], ["p", " "], ["var", "Amount"], ["punc", ")"], ["punc", ";"]], [["p", " "], ["punc", "{"], ["con", "withdraw"], ["punc", ","], ["p", " "], ["var", "Amount"], ["punc", "}"], ["p", " "], ["op", "->"]], [["p", " "], ["fnc", "loop"], ["punc", "("], ["var", "Balance"], ["p", " "], ["op", "-"], ["p", " "], ["var", "Amount"], ["punc", ")"], ["punc", ";"]], [["p", " "], ["punc", "{"], ["con", "balance"], ["punc", ","], ["p", " "], ["var", "From"], ["punc", "}"], ["p", " "], ["op", "->"]], [["p", " "], ["var", "From"], ["p", " "], ["op", "!"], ["p", " "], ["punc", "{"], ["con", "ok"], ["punc", ","], ["p", " "], ["var", "Balance"], ["punc", "}"], ["punc", ","], ["p", " "], ["fnc", "loop"], ["punc", "("], ["var", "Balance"], ["punc", ")"]], [["p", " "], ["kw", "end"], ["punc", "."]], [], [["fnd", "balance"], ["punc", "("], ["var", "Pid"], ["punc", ")"], ["p", " "], ["op", "->"]], [["p", " "], ["var", "Pid"], ["p", " "], ["op", "!"], ["p", " "], ["punc", "{"], ["con", "balance"], ["punc", ","], ["p", " "], ["fnc", "self"], ["punc", "()"], ["punc", "}"], ["punc", ","], ["p", " "], ["kw", "receive"], ["p", " "], ["punc", "{"], ["con", "ok"], ["punc", ","], ["p", " "], ["var", "B"], ["punc", "}"], ["p", " "], ["op", "->"], ["p", " "], ["var", "B"], ["p", " "], ["kw", "end"], ["punc", "."]]], "SQL": [[["cmd", "-- "], ["cm", "Monthly revenue by active customer"]], [["kw", "SELECT"], ["p", " "], ["prop", "c.id"], ["punc", ","], ["p", " "], ["prop", "c.name"], ["punc", ","]], [["p", " "], ["bi", "COUNT"], ["punc", "("], ["prop", "o.id"], ["punc", ")"], ["p", " "], ["kw", "AS"], ["p", " "], ["var", "order_count"], ["punc", ","]], [["p", " "], ["bi", "COALESCE"], ["punc", "("], ["bi", "SUM"], ["punc", "("], ["prop", "o.total"], ["punc", "),"], ["p", " "], ["num", "0"], ["punc", ")"], ["p", " "], ["kw", "AS"], ["p", " "], ["var", "revenue"]], [["kw", "FROM"], ["p", " "], ["prop", "customers"], ["p", " "], ["var", "c"]], [["kw", "JOIN"], ["p", " "], ["prop", "orders"], ["p", " "], ["var", "o"], ["p", " "], ["kw", "ON"], ["p", " "], ["prop", "o.customer_id"], ["p", " "], ["op", "="], ["p", " "], ["prop", "c.id"]], [["kw", "WHERE"], ["p", " "], ["prop", "c.active"], ["p", " "], ["op", "="], ["p", " "], ["con", "TRUE"]], [["p", " "], ["kw", "AND"], ["p", " "], ["prop", "o.created_at"], ["p", " "], ["op", ">="], ["p", " "], ["str", "'2024-01-01'"]], [["p", " "], ["kw", "AND"], ["p", " "], ["prop", "o.status"], ["p", " "], ["op", "<>"], ["p", " "], ["con", "NULL"]], [["kw", "GROUP BY"], ["p", " "], ["prop", "c.id"], ["punc", ","], ["p", " "], ["prop", "c.name"]], [["kw", "HAVING"], ["p", " "], ["bi", "COUNT"], ["punc", "("], ["prop", "o.id"], ["punc", ")"], ["p", " "], ["op", ">"], ["p", " "], ["num", "5"]], [["kw", "ORDER BY"], ["p", " "], ["var", "revenue"], ["p", " "], ["kw", "DESC"]], [["kw", "LIMIT"], ["p", " "], ["num", "25"], ["punc", ";"]], [], [["cmd", "-- "], ["cm", "Flag stale accounts for review"]], [["kw", "UPDATE"], ["p", " "], ["prop", "customers"]], [["kw", "SET"], ["p", " "], ["prop", "status"], ["p", " "], ["op", "="], ["p", " "], ["str", "'dormant'"]], [["kw", "WHERE"], ["p", " "], ["prop", "last_login"], ["p", " "], ["op", "<"], ["p", " "], ["bi", "CURRENT_DATE"], ["p", " "], ["op", "-"], ["p", " "], ["kw", "INTERVAL"], ["p", " "], ["str", "'90 days'"]], [["p", " "], ["kw", "AND"], ["p", " "], ["prop", "active"], ["p", " "], ["op", "="], ["p", " "], ["con", "FALSE"], ["punc", ";"]]], "PHP": [[["pp", "<?php"]], [["kw", "namespace"], ["p", " "], ["ty", "App\\Service"], ["punc", ";"]], [], [["cmd", "/** "], ["doc", "Computes invoice totals. */"]], [["dec", "#[Service]"]], [["kw", "class"], ["p", " "], ["ty", "InvoiceCalculator"]], [["punc", "{"]], [["p", " "], ["kw", "public"], ["p", " "], ["ty", "float"], ["p", " "], ["var", "$taxRate"], ["p", " "], ["op", "="], ["p", " "], ["num", "0.0825"], ["punc", ";"]], [], [["p", " "], ["kw", "public"], ["p", " "], ["kw", "function"], ["p", " "], ["fnd", "total"], ["punc", "("], ["kw", "array"], ["p", " "], ["var", "$items"], ["punc", ")"], ["op", ":"], ["p", " "], ["ty", "float"]], [["p", " "], ["punc", "{"]], [["p", " "], ["cmd", "// "], ["cm", "sum each line item"]], [["p", " "], ["var", "$prices"], ["p", " "], ["op", "="], ["p", " "], ["bi", "array_map"], ["punc", "("], ["kw", "fn"], ["punc", "("], ["var", "$i"], ["punc", ")"], ["p", " "], ["op", "=>"], ["p", " "], ["var", "$i"], ["op", "["], ["str", "'price'"], ["op", "]"], ["punc", ","], ["p", " "], ["var", "$items"], ["punc", ")"], ["punc", ";"]], [["p", " "], ["var", "$subtotal"], ["p", " "], ["op", "="], ["p", " "], ["bi", "array_sum"], ["punc", "("], ["var", "$prices"], ["punc", ")"], ["punc", ";"]], [], [["p", " "], ["kw", "if"], ["p", " "], ["punc", "("], ["var", "$subtotal"], ["p", " "], ["op", "==="], ["p", " "], ["num", "0"], ["punc", ")"], ["p", " "], ["punc", "{"]], [["p", " "], ["kw", "return"], ["p", " "], ["num", "0.0"], ["punc", ";"]], [["p", " "], ["punc", "}"]], [], [["p", " "], ["var", "$total"], ["p", " "], ["op", "="], ["p", " "], ["var", "$subtotal"], ["p", " "], ["op", "*"], ["p", " "], ["punc", "("], ["num", "1"], ["p", " "], ["op", "+"], ["p", " "], ["var", "$this"], ["op", "->"], ["prop", "taxRate"], ["punc", ")"], ["punc", ";"]], [["p", " "], ["fnc", "printf"], ["punc", "("], ["str", "\"Total: %.2f\\n\""], ["punc", ","], ["p", " "], ["var", "$total"], ["punc", ")"], ["punc", ";"]], [["p", " "], ["kw", "return"], ["p", " "], ["var", "$total"], ["punc", ";"]], [["p", " "], ["punc", "}"]], [["punc", "}"]]], "Ada": [[["cmd", "-- "], ["cm", "Compute factorial and print the result"]], [["pp", "with"], ["p", " "], ["var", "Ada.Text_IO"], ["punc", ";"]], [["pp", "use"], ["p", " "], ["var", "Ada.Text_IO"], ["punc", ";"]], [], [["kw", "procedure"], ["p", " "], ["fnd", "Factorial_Demo"], ["p", " "], ["kw", "is"]], [["p", " "], ["var", "N"], ["p", " "], ["punc", ":"], ["p", " "], ["ty", "Integer"], ["p", " "], ["op", ":="], ["p", " "], ["num", "5"], ["punc", ";"]], [["p", " "], ["var", "Result"], ["p", " "], ["punc", ":"], ["p", " "], ["ty", "Integer"], ["p", " "], ["op", ":="], ["p", " "], ["num", "1"], ["punc", ";"]], [["kw", "begin"]], [["p", " "], ["kw", "for"], ["p", " "], ["var", "I"], ["p", " "], ["kw", "in"], ["p", " "], ["num", "1"], ["p", " "], ["op", ".."], ["p", " "], ["var", "N"], ["p", " "], ["kw", "loop"]], [["p", " "], ["var", "Result"], ["p", " "], ["op", ":="], ["p", " "], ["var", "Result"], ["p", " "], ["op", "*"], ["p", " "], ["var", "I"], ["punc", ";"]], [["p", " "], ["kw", "end"], ["p", " "], ["kw", "loop"], ["punc", ";"]], [], [["p", " "], ["kw", "if"], ["p", " "], ["var", "Result"], ["p", " "], ["op", ">"], ["p", " "], ["num", "0"], ["p", " "], ["kw", "then"]], [["p", " "], ["bi", "Put_Line"], ["punc", "("], ["str", "\"Factorial = \""], ["p", " "], ["op", "&"], ["p", " "], ["var", "Integer"], ["punc", "'"], ["var", "Image"], ["punc", "("], ["var", "Result"], ["punc", "))"], ["punc", ";"]], [["p", " "], ["kw", "end"], ["p", " "], ["kw", "if"], ["punc", ";"]], [["kw", "end"], ["p", " "], ["fnd", "Factorial_Demo"], ["punc", ";"]]], "Fortran": [[["cmd", "! "], ["cm", "Sum the elements of an array"]], [["kw", "program"], ["p", " "], ["fnd", "array_sum"]], [["p", " "], ["kw", "implicit none"]], [["p", " "], ["ty", "integer"], ["p", " "], ["punc", "::"], ["p", " "], ["var", "i"], ["punc", ","], ["p", " "], ["var", "n"]], [["p", " "], ["ty", "real"], ["punc", "("], ["var", "kind"], ["op", "="], ["num", "8"], ["punc", ")"], ["p", " "], ["punc", "::"], ["p", " "], ["var", "total"]], [["p", " "], ["ty", "real"], ["punc", "("], ["var", "kind"], ["op", "="], ["num", "8"], ["punc", ")"], ["punc", ","], ["p", " "], ["kw", "dimension"], ["punc", "("], ["num", "5"], ["punc", ")"], ["p", " "], ["punc", "::"], ["p", " "], ["var", "a"]], [], [["p", " "], ["var", "n"], ["p", " "], ["op", "="], ["p", " "], ["num", "5"]], [["p", " "], ["var", "total"], ["p", " "], ["op", "="], ["p", " "], ["num", "0.0"]], [["p", " "], ["var", "a"], ["p", " "], ["op", "="], ["p", " "], ["punc", "["], ["num", "1.0"], ["punc", ","], ["p", " "], ["num", "2.0"], ["punc", ","], ["p", " "], ["num", "3.0"], ["punc", ","], ["p", " "], ["num", "4.0"], ["punc", ","], ["p", " "], ["num", "5.0"], ["punc", "]"]], [], [["p", " "], ["kw", "do"], ["p", " "], ["var", "i"], ["p", " "], ["op", "="], ["p", " "], ["num", "1"], ["punc", ","], ["p", " "], ["var", "n"]], [["p", " "], ["var", "total"], ["p", " "], ["op", "="], ["p", " "], ["var", "total"], ["p", " "], ["op", "+"], ["p", " "], ["var", "a"], ["punc", "("], ["var", "i"], ["punc", ")"]], [["p", " "], ["kw", "end do"]], [], [["p", " "], ["bi", "print"], ["p", " "], ["op", "*"], ["punc", ","], ["p", " "], ["str", "\"Sum = \""], ["punc", ","], ["p", " "], ["var", "total"]], [["kw", "end program"], ["p", " "], ["fnd", "array_sum"]]], "MATLAB": [[["cmd", "% "], ["cm", "Normalize a vector and report its length"]], [["kw", "function"], ["p", " "], ["var", "out"], ["p", " "], ["op", "="], ["p", " "], ["fnd", "normalize_vec"], ["punc", "("], ["var", "v"], ["punc", ")"]], [["p", " "], ["var", "n"], ["p", " "], ["op", "="], ["p", " "], ["bi", "length"], ["punc", "("], ["var", "v"], ["punc", ")"], ["punc", ";"]], [["p", " "], ["var", "acc"], ["p", " "], ["op", "="], ["p", " "], ["num", "0"], ["punc", ";"]], [], [["p", " "], ["kw", "for"], ["p", " "], ["var", "i"], ["p", " "], ["op", "="], ["p", " "], ["num", "1"], ["op", ":"], ["var", "n"]], [["p", " "], ["var", "acc"], ["p", " "], ["op", "="], ["p", " "], ["var", "acc"], ["p", " "], ["op", "+"], ["p", " "], ["var", "v"], ["punc", "("], ["var", "i"], ["punc", ")"], ["op", "^"], ["num", "2"], ["punc", ";"]], [["p", " "], ["kw", "end"]], [], [["p", " "], ["var", "mag"], ["p", " "], ["op", "="], ["p", " "], ["bi", "sqrt"], ["punc", "("], ["var", "acc"], ["punc", ")"], ["punc", ";"]], [["p", " "], ["kw", "if"], ["p", " "], ["var", "mag"], ["p", " "], ["op", "=="], ["p", " "], ["num", "0"]], [["p", " "], ["var", "out"], ["p", " "], ["op", "="], ["p", " "], ["bi", "zeros"], ["punc", "("], ["bi", "size"], ["punc", "("], ["var", "v"], ["punc", ")"], ["punc", ")"], ["punc", ";"]], [["p", " "], ["kw", "else"]], [["p", " "], ["var", "out"], ["p", " "], ["op", "="], ["p", " "], ["var", "v"], ["p", " "], ["op", "/"], ["p", " "], ["var", "mag"], ["punc", ";"]], [["p", " "], ["kw", "end"]], [], [["p", " "], ["bi", "disp"], ["punc", "("], ["str", "\"vector length:\""], ["punc", ")"], ["punc", ";"]], [["p", " "], ["bi", "disp"], ["punc", "("], ["var", "n"], ["punc", ")"], ["punc", ";"]], [["kw", "end"]]], "Assembly": [[["cmd", ";"], ["cm", " print a greeting via the write syscall"]], [["pp", "section"], ["p", " "], ["pp", ".data"]], [["p", " "], ["var", "msg"], ["p", " "], ["pp", "db"], ["p", " "], ["str", "\"Hello, world!\""], ["punc", ","], ["p", " "], ["num", "0xA"]], [["p", " "], ["con", "msglen"], ["p", " "], ["pp", "equ"], ["p", " "], ["var", "$"], ["p", " "], ["op", "-"], ["p", " "], ["var", "msg"]], [], [["pp", "section"], ["p", " "], ["pp", ".text"]], [["p", " "], ["bi", "global"], ["p", " "], ["fnc", "_start"]], [], [["fnd", "_start"], ["punc", ":"]], [["p", " "], ["kw", "mov"], ["p", " "], ["var", "rax"], ["punc", ","], ["p", " "], ["num", "1"], ["p", " "], ["cmd", ";"], ["cm", " sys_write"]], [["p", " "], ["kw", "mov"], ["p", " "], ["var", "rdi"], ["punc", ","], ["p", " "], ["num", "1"], ["p", " "], ["cmd", ";"], ["cm", " stdout"]], [["p", " "], ["kw", "lea"], ["p", " "], ["var", "rsi"], ["punc", ","], ["p", " "], ["punc", "["], ["var", "rel"], ["p", " "], ["var", "msg"], ["punc", "]"]], [["p", " "], ["kw", "mov"], ["p", " "], ["var", "rdx"], ["punc", ","], ["p", " "], ["con", "msglen"]], [["p", " "], ["kw", "syscall"]], [], [["p", " "], ["kw", "mov"], ["p", " "], ["var", "rax"], ["punc", ","], ["p", " "], ["num", "60"], ["p", " "], ["cmd", ";"], ["cm", " sys_exit"]], [["p", " "], ["kw", "xor"], ["p", " "], ["var", "rdi"], ["punc", ","], ["p", " "], ["var", "rdi"], ["p", " "], ["cmd", ";"], ["cm", " status 0"]], [["p", " "], ["kw", "syscall"]]]}, CATS=[["bg", "bg (ground)", "Aa Bb 123"], ["p", "fg", "other / whitespace"], ["kw", "keyword", "class def if return"], ["bi", "builtin", "len echo printf"], ["pp", "preprocessor", "#include #define"], ["fnd", "function \u00b7 def", "resolve push"], ["fnc", "function \u00b7 call", "printf rsync get"], ["dec", "decorator \u2192 type", "@dataclass"], ["ty", "type / class", "int str Order Queue"], ["prop", "property / field", "id name items"], ["con", "constant", "None nil NULL true"], ["num", "number", "8080 100 -1"], ["str", "string", "\"dupre\" \"fmt\""], ["esc", "escape", "\\n \\t"], ["re", "regexp", "/^#[0-9a-f]+/"], ["rxgb", "regexp backslash", "\\\\("], ["rxgc", "regexp construct", "\\( \\)"], ["doc", "docstring", "\"\"\"...\"\"\""], ["dmark", "doc mark", "\\[cmd] `sym'"], ["cm", "comment", "# reject nil"], ["cmd", "comment delim", "# // ;;"], ["var", "variable / use", "value key self"], ["op", "operator", ": = -> =="], ["neg", "negation char", "!"], ["punc", "punctuation", "{ } ( ) ;"], ["warn", "warn", "TODO FIXME"]], UI_FACES=[["cursor", "cursor", "Aa|"], ["region", "region (selection)", "selected text"], ["hl-line", "hl-line (current line)", "current line"], ["highlight", "highlight", "hover"], ["mode-line", "mode-line", "status active"], ["mode-line-highlight", "mode-line-highlight (hover)", "git:main"], ["mode-line-inactive", "mode-line-inactive", "status idle"], ["fringe", "fringe", "| |"], ["line-number", "line-number", " 42"], ["line-number-current-line", "line-number-current-line", "> 42"], ["minibuffer-prompt", "minibuffer-prompt", "M-x "], ["isearch", "isearch (match)", "match"], ["lazy-highlight", "lazy-highlight", "other match"], ["isearch-fail", "isearch-fail", "no match"], ["show-paren-match", "show-paren-match", "( )"], ["show-paren-mismatch", "show-paren-mismatch", ") ("], ["link", "link", "https://"], ["error", "error", "error!"], ["warning", "warning", "warning"], ["success", "success", "ok"], ["vertical-border", "vertical-border", "|"]], APPS={"org-mode": {"label": "org-mode", "preview": "org", "hover": "", "faces": [["org-document-title", "document title", {}], ["org-document-info", "document info", {}], ["org-document-info-keyword", "document info keyword", {}], ["org-level-1", "level 1", {}], ["org-level-2", "level 2", {}], ["org-level-3", "level 3", {}], ["org-level-4", "level 4", {}], ["org-level-5", "level 5", {}], ["org-level-6", "level 6", {}], ["org-level-7", "level 7", {}], ["org-level-8", "level 8", {}], ["org-headline-todo", "headline todo", {}], ["org-headline-done", "headline done", {}], ["org-todo", "todo", {}], ["org-done", "done", {}], ["org-priority", "priority", {}], ["org-tag", "tag", {}], ["org-tag-group", "tag group", {}], ["org-special-keyword", "special keyword", {}], ["org-drawer", "drawer", {}], ["org-property-value", "property value", {}], ["org-checkbox", "checkbox", {}], ["org-checkbox-statistics-todo", "checkbox statistics todo", {}], ["org-checkbox-statistics-done", "checkbox statistics done", {}], ["org-warning", "warning", {}], ["org-link", "link", {}], ["org-footnote", "footnote", {}], ["org-date", "date", {}], ["org-sexp-date", "sexp date", {}], ["org-date-selected", "date selected", {}], ["org-target", "target", {}], ["org-macro", "macro", {}], ["org-cite", "cite", {}], ["org-cite-key", "cite key", {}], ["org-block", "block", {}], ["org-block-begin-line", "block begin line", {}], ["org-block-end-line", "block end line", {}], ["org-code", "code", {}], ["org-verbatim", "verbatim", {}], ["org-inline-src-block", "inline src block", {}], ["org-quote", "quote", {}], ["org-verse", "verse", {}], ["org-latex-and-related", "latex and related", {}], ["org-table", "table", {}], ["org-table-header", "table header", {}], ["org-table-row", "table row", {}], ["org-formula", "formula", {}], ["org-column", "column", {}], ["org-column-title", "column title", {}], ["org-list-dt", "list dt", {}], ["org-meta-line", "meta line", {}], ["org-ellipsis", "ellipsis", {}], ["org-hide", "hide", {}], ["org-indent", "indent", {}], ["org-archived", "archived", {}], ["org-default", "default", {}], ["org-dispatcher-highlight", "dispatcher highlight", {}], ["org-agenda-structure", "agenda structure", {}], ["org-agenda-structure-secondary", "agenda structure secondary", {}], ["org-agenda-structure-filter", "agenda structure filter", {}], ["org-agenda-date", "agenda date", {}], ["org-agenda-date-today", "agenda date today", {}], ["org-agenda-date-weekend", "agenda date weekend", {}], ["org-agenda-date-weekend-today", "agenda date weekend today", {}], ["org-agenda-current-time", "agenda current time", {}], ["org-agenda-done", "agenda done", {}], ["org-agenda-dimmed-todo-face", "agenda dimmed todo", {}], ["org-agenda-calendar-event", "agenda calendar event", {}], ["org-agenda-calendar-sexp", "agenda calendar sexp", {}], ["org-agenda-calendar-daterange", "agenda calendar daterange", {}], ["org-agenda-diary", "agenda diary", {}], ["org-agenda-clocking", "agenda clocking", {}], ["org-agenda-column-dateline", "agenda column dateline", {}], ["org-agenda-restriction-lock", "agenda restriction lock", {}], ["org-agenda-filter-category", "agenda filter category", {}], ["org-agenda-filter-effort", "agenda filter effort", {}], ["org-agenda-filter-regexp", "agenda filter regexp", {}], ["org-agenda-filter-tags", "agenda filter tags", {}], ["org-scheduled", "scheduled", {}], ["org-scheduled-today", "scheduled today", {}], ["org-scheduled-previously", "scheduled previously", {}], ["org-upcoming-deadline", "upcoming deadline", {}], ["org-upcoming-distant-deadline", "upcoming distant deadline", {}], ["org-imminent-deadline", "imminent deadline", {}], ["org-time-grid", "time grid", {}], ["org-clock-overlay", "clock overlay", {}], ["org-mode-line-clock", "mode line clock", {}], ["org-mode-line-clock-overrun", "mode line clock overrun", {}]]}, "magit": {"label": "magit", "preview": "magit", "hover": "", "faces": [["magit-section-heading", "section heading", {"fg": "#8b6508", "weight": "bold", "extend": true}], ["magit-section-secondary-heading", "section secondary heading", {"weight": "bold", "extend": true}], ["magit-section-heading-selection", "section heading selection", {"fg": "#8b4c39", "extend": true}], ["magit-section-highlight", "section highlight", {"bg": "#f2f2f2", "extend": true}], ["magit-section-child-count", "section child count", {}], ["magit-diff-added", "diff added", {"fg": "#22aa22", "bg": "#ddffdd", "extend": true}], ["magit-diff-added-highlight", "diff added highlight", {"fg": "#22aa22", "bg": "#cceecc", "extend": true}], ["magit-diff-removed", "diff removed", {"fg": "#aa2222", "bg": "#ffdddd", "extend": true}], ["magit-diff-removed-highlight", "diff removed highlight", {"fg": "#aa2222", "bg": "#eecccc", "extend": true}], ["magit-diff-context", "diff context", {"fg": "#7f7f7f", "extend": true}], ["magit-diff-context-highlight", "diff context highlight", {"fg": "#7f7f7f", "bg": "#f2f2f2", "extend": true}], ["magit-diff-file-heading", "diff file heading", {"weight": "bold", "extend": true}], ["magit-diff-file-heading-highlight", "diff file heading highlight", {"extend": true, "inherit": "magit-section-highlight"}], ["magit-diff-file-heading-selection", "diff file heading selection", {"fg": "#8b4c39", "extend": true, "inherit": "magit-diff-file-heading-highlight"}], ["magit-diff-hunk-heading", "diff hunk heading", {"fg": "#333333", "bg": "#e5e5e5", "extend": true}], ["magit-diff-hunk-heading-highlight", "diff hunk heading highlight", {"fg": "#333333", "bg": "#cccccc", "extend": true}], ["magit-diff-hunk-heading-selection", "diff hunk heading selection", {"fg": "#8b4c39", "extend": true, "inherit": "magit-diff-hunk-heading-highlight"}], ["magit-diff-hunk-region", "diff hunk region", {"inherit": "bold"}], ["magit-diff-lines-heading", "diff lines heading", {"bg": "#cd8162", "extend": true, "inherit": "magit-diff-hunk-heading-highlight"}], ["magit-diff-lines-boundary", "diff lines boundary", {"extend": true, "inherit": "magit-diff-lines-heading"}], ["magit-diff-base", "diff base", {"fg": "#aaaa11", "bg": "#ffffcc", "extend": true}], ["magit-diff-base-highlight", "diff base highlight", {"fg": "#aaaa11", "bg": "#eeeebb", "extend": true}], ["magit-diff-our", "diff our", {"inherit": "magit-diff-removed"}], ["magit-diff-our-highlight", "diff our highlight", {"inherit": "magit-diff-removed-highlight"}], ["magit-diff-their", "diff their", {"inherit": "magit-diff-added"}], ["magit-diff-their-highlight", "diff their highlight", {"inherit": "magit-diff-added-highlight"}], ["magit-diff-conflict-heading", "diff conflict heading", {"inherit": "magit-diff-hunk-heading"}], ["magit-diff-conflict-heading-highlight", "diff conflict heading highlight", {"inherit": "magit-diff-hunk-heading-highlight"}], ["magit-diff-revision-summary", "diff revision summary", {"inherit": "magit-diff-hunk-heading"}], ["magit-diff-revision-summary-highlight", "diff revision summary highlight", {"inherit": "magit-diff-hunk-heading-highlight"}], ["magit-diff-whitespace-warning", "diff whitespace warning", {"inherit": "trailing-whitespace"}], ["magit-diffstat-added", "diffstat added", {"fg": "#22aa22"}], ["magit-diffstat-removed", "diffstat removed", {"fg": "#aa2222"}], ["magit-branch-current", "branch current", {"inherit": "magit-branch-local"}], ["magit-branch-local", "branch local", {"fg": "#4a708b"}], ["magit-branch-remote", "branch remote", {"fg": "#6e8b3d"}], ["magit-branch-remote-head", "branch remote head", {"inherit": "magit-branch-remote"}], ["magit-branch-upstream", "branch upstream", {"slant": "italic"}], ["magit-branch-warning", "branch warning", {"inherit": "warning"}], ["magit-head", "head", {"inherit": "magit-branch-local"}], ["magit-tag", "tag", {"fg": "#8b6914"}], ["magit-hash", "hash", {"fg": "#999999"}], ["magit-filename", "filename", {}], ["magit-dimmed", "dimmed", {"fg": "#7f7f7f"}], ["magit-keyword", "keyword", {"inherit": "font-lock-string-face"}], ["magit-keyword-squash", "keyword squash", {"inherit": "font-lock-warning-face"}], ["magit-refname", "refname", {"fg": "#4d4d4d"}], ["magit-refname-stash", "refname stash", {"inherit": "magit-refname"}], ["magit-refname-wip", "refname wip", {"inherit": "magit-refname"}], ["magit-refname-pullreq", "refname pullreq", {"inherit": "magit-refname"}], ["magit-log-author", "log author", {"fg": "#b22222"}], ["magit-log-date", "log date", {"fg": "#4d4d4d"}], ["magit-log-graph", "log graph", {"fg": "#4d4d4d"}], ["magit-header-line", "header line", {"inherit": "magit-section-heading"}], ["magit-header-line-key", "header line key", {"inherit": "font-lock-builtin-face"}], ["magit-header-line-log-select", "header line log select", {"inherit": "bold"}], ["magit-process-ok", "process ok", {"fg": "#00ff00", "inherit": "magit-section-heading"}], ["magit-process-ng", "process ng", {"fg": "#ff0000", "inherit": "magit-section-heading"}], ["magit-mode-line-process", "mode line process", {"inherit": "mode-line-emphasis"}], ["magit-mode-line-process-error", "mode line process error", {"inherit": "error"}], ["magit-bisect-good", "bisect good", {"fg": "#556b2f"}], ["magit-bisect-bad", "bisect bad", {"fg": "#8b3a3a"}], ["magit-bisect-skip", "bisect skip", {"fg": "#b8860b"}], ["magit-blame-heading", "blame heading", {"extend": true, "inherit": "magit-blame-highlight"}], ["magit-blame-highlight", "blame highlight", {"fg": "#000000", "bg": "#cccccc", "extend": true}], ["magit-blame-hash", "blame hash", {}], ["magit-blame-name", "blame name", {}], ["magit-blame-date", "blame date", {}], ["magit-blame-summary", "blame summary", {}], ["magit-blame-dimmed", "blame dimmed", {"inherit": "magit-dimmed"}], ["magit-blame-margin", "blame margin", {"inherit": "magit-blame-highlight"}], ["magit-cherry-equivalent", "cherry equivalent", {"fg": "#ff00ff"}], ["magit-cherry-unmatched", "cherry unmatched", {"fg": "#00ffff"}], ["magit-signature-good", "signature good", {"fg": "#00ff00"}], ["magit-signature-bad", "signature bad", {"fg": "#ff0000", "weight": "bold"}], ["magit-signature-untrusted", "signature untrusted", {"fg": "#66cdaa"}], ["magit-signature-expired", "signature expired", {"fg": "#ffa500"}], ["magit-signature-expired-key", "signature expired key", {"inherit": "magit-signature-expired"}], ["magit-signature-revoked", "signature revoked", {"fg": "#d02090"}], ["magit-signature-error", "signature error", {"fg": "#add8e6"}], ["magit-reflog-commit", "reflog commit", {"fg": "#00ff00"}], ["magit-reflog-amend", "reflog amend", {"fg": "#ff00ff"}], ["magit-reflog-merge", "reflog merge", {"fg": "#00ff00"}], ["magit-reflog-checkout", "reflog checkout", {"fg": "#0000ff"}], ["magit-reflog-reset", "reflog reset", {"fg": "#ff0000"}], ["magit-reflog-rebase", "reflog rebase", {"fg": "#ff00ff"}], ["magit-reflog-cherry-pick", "reflog cherry pick", {"fg": "#00ff00"}], ["magit-reflog-remote", "reflog remote", {"fg": "#00ffff"}], ["magit-reflog-other", "reflog other", {"fg": "#00ffff"}], ["magit-sequence-pick", "sequence pick", {"inherit": "default"}], ["magit-sequence-stop", "sequence stop", {"fg": "#6e8b3d"}], ["magit-sequence-part", "sequence part", {"fg": "#8b6914"}], ["magit-sequence-head", "sequence head", {"fg": "#4a708b"}], ["magit-sequence-drop", "sequence drop", {"fg": "#cd5c5c"}], ["magit-sequence-done", "sequence done", {"inherit": "magit-hash"}], ["magit-sequence-onto", "sequence onto", {"inherit": "magit-sequence-done"}], ["magit-sequence-exec", "sequence exec", {"inherit": "magit-hash"}], ["magit-left-margin", "left margin", {"inherit": "default"}], ["git-commit-comment-action", "git commit comment action", {"inherit": "bold"}], ["git-commit-comment-branch-local", "git commit comment branch local", {"inherit": "magit-branch-local"}], ["git-commit-comment-branch-remote", "git commit comment branch remote", {"inherit": "magit-branch-remote"}], ["git-commit-comment-detached", "git commit comment detached", {"inherit": "git-commit-comment-branch-local"}], ["git-commit-comment-file", "git commit comment file", {"inherit": "git-commit-trailer-value"}], ["git-commit-comment-heading", "git commit comment heading", {"inherit": "git-commit-trailer-token"}], ["git-commit-keyword", "git commit keyword", {"inherit": "font-lock-string-face"}], ["git-commit-nonempty-second-line", "git commit nonempty second line", {"inherit": "font-lock-warning-face"}], ["git-commit-overlong-summary", "git commit overlong summary", {"inherit": "font-lock-warning-face"}], ["git-commit-summary", "git commit summary", {"inherit": "font-lock-type-face"}], ["git-commit-trailer-token", "git commit trailer token", {"inherit": "font-lock-keyword-face"}], ["git-commit-trailer-value", "git commit trailer value", {"inherit": "font-lock-string-face"}]]}, "elfeed": {"label": "elfeed", "preview": "elfeed", "hover": "", "faces": [["elfeed-search-date-face", "search date", {"fg": "#aaa"}], ["elfeed-search-title-face", "search title", {"fg": "#000"}], ["elfeed-search-unread-title-face", "search unread title", {"weight": "bold"}], ["elfeed-search-feed-face", "search feed", {"fg": "#aa0"}], ["elfeed-search-tag-face", "search tag", {"fg": "#070"}], ["elfeed-search-unread-count-face", "search unread count", {"fg": "#000"}], ["elfeed-search-filter-face", "search filter", {"inherit": "mode-line-buffer-id"}], ["elfeed-search-last-update-face", "search last update", {}], ["elfeed-log-date-face", "log date", {"inherit": "font-lock-type-face"}], ["elfeed-log-error-level-face", "log error level", {"fg": "#ff0000"}], ["elfeed-log-warn-level-face", "log warn level", {"fg": "#daa520"}], ["elfeed-log-info-level-face", "log info level", {"fg": "#00bfff"}], ["elfeed-log-debug-level-face", "log debug level", {"fg": "#ee00ee"}]]}, "mu4e": {"label": "mu4e", "preview": "mu4e", "hover": "", "faces": [["mu4e-title-face", "title", {}], ["mu4e-context-face", "context", {}], ["mu4e-modeline-face", "modeline", {}], ["mu4e-ok-face", "ok", {}], ["mu4e-warning-face", "warning", {}], ["mu4e-header-title-face", "header title", {}], ["mu4e-header-key-face", "header key", {}], ["mu4e-header-value-face", "header value", {}], ["mu4e-header-face", "header", {}], ["mu4e-header-highlight-face", "header highlight", {}], ["mu4e-header-marks-face", "header marks", {}], ["mu4e-unread-face", "unread", {}], ["mu4e-flagged-face", "flagged", {}], ["mu4e-replied-face", "replied", {}], ["mu4e-forwarded-face", "forwarded", {}], ["mu4e-draft-face", "draft", {}], ["mu4e-trashed-face", "trashed", {}], ["mu4e-related-face", "related", {}], ["mu4e-contact-face", "contact", {}], ["mu4e-special-header-value-face", "special header value", {}], ["mu4e-url-number-face", "url number", {}], ["mu4e-link-face", "link", {}], ["mu4e-footer-face", "footer", {}], ["mu4e-region-code", "region code", {}], ["mu4e-system-face", "system", {}], ["mu4e-highlight-face", "highlight", {}], ["mu4e-compose-separator-face", "compose separator", {}]]}, "gnus": {"label": "gnus", "preview": "gnus", "hover": "Article-view faces, reused by mu4e's article view.", "faces": [["gnus-header-name", "header name", {}], ["gnus-header-from", "header from", {}], ["gnus-header-subject", "header subject", {}], ["gnus-header-content", "header content", {}], ["gnus-header-newsgroups", "header newsgroups", {}], ["gnus-cite-1", "cite 1", {}], ["gnus-cite-2", "cite 2", {}], ["gnus-cite-3", "cite 3", {}], ["gnus-cite-4", "cite 4", {}], ["gnus-cite-5", "cite 5", {}], ["gnus-cite-6", "cite 6", {}], ["gnus-cite-7", "cite 7", {}], ["gnus-cite-8", "cite 8", {}], ["gnus-cite-9", "cite 9", {}], ["gnus-cite-10", "cite 10", {}], ["gnus-cite-11", "cite 11", {}], ["gnus-cite-attribution", "cite attribution", {}], ["gnus-signature", "signature", {}], ["gnus-button", "button", {}], ["gnus-emphasis-bold", "emphasis bold", {}], ["gnus-emphasis-italic", "emphasis italic", {}], ["gnus-emphasis-underline", "emphasis underline", {}], ["gnus-emphasis-strikethru", "emphasis strikethru", {}], ["gnus-emphasis-highlight-words", "emphasis highlight words", {}]]}, "org-faces": {"label": "org-faces", "preview": "orgfaces", "hover": "", "faces": [["org-faces-todo", "todo", {}], ["org-faces-project", "project", {}], ["org-faces-doing", "doing", {}], ["org-faces-waiting", "waiting", {}], ["org-faces-verify", "verify", {}], ["org-faces-stalled", "stalled", {}], ["org-faces-delegated", "delegated", {}], ["org-faces-failed", "failed", {}], ["org-faces-done", "done", {}], ["org-faces-cancelled", "cancelled", {}], ["org-faces-priority-a", "priority a", {}], ["org-faces-priority-b", "priority b", {}], ["org-faces-priority-c", "priority c", {}], ["org-faces-priority-d", "priority d", {}], ["org-faces-todo-dim", "todo dim", {}], ["org-faces-project-dim", "project dim", {}], ["org-faces-doing-dim", "doing dim", {}], ["org-faces-waiting-dim", "waiting dim", {}], ["org-faces-verify-dim", "verify dim", {}], ["org-faces-stalled-dim", "stalled dim", {}], ["org-faces-delegated-dim", "delegated dim", {}], ["org-faces-failed-dim", "failed dim", {}], ["org-faces-done-dim", "done dim", {}], ["org-faces-cancelled-dim", "cancelled dim", {}], ["org-faces-priority-a-dim", "priority a dim", {}], ["org-faces-priority-b-dim", "priority b dim", {}], ["org-faces-priority-c-dim", "priority c dim", {}], ["org-faces-priority-d-dim", "priority d dim", {}]]}, "ansi-color": {"label": "ansi-color", "preview": "ansicolor", "hover": "The 16 ANSI palette faces. Reused by vterm, eshell, compilation, and eat, whose own color faces inherit these.", "faces": [["ansi-color-black", "black", {}], ["ansi-color-red", "red", {}], ["ansi-color-green", "green", {}], ["ansi-color-yellow", "yellow", {}], ["ansi-color-blue", "blue", {}], ["ansi-color-magenta", "magenta", {}], ["ansi-color-cyan", "cyan", {}], ["ansi-color-white", "white", {}], ["ansi-color-bright-black", "bright black", {}], ["ansi-color-bright-red", "bright red", {}], ["ansi-color-bright-green", "bright green", {}], ["ansi-color-bright-yellow", "bright yellow", {}], ["ansi-color-bright-blue", "bright blue", {}], ["ansi-color-bright-magenta", "bright magenta", {}], ["ansi-color-bright-cyan", "bright cyan", {}], ["ansi-color-bright-white", "bright white", {}]]}, "eat": {"label": "emulate a terminal (eat)", "preview": "eat", "hover": "", "faces": [["eat-term-color-black", "term color black", {}], ["eat-term-color-red", "term color red", {}], ["eat-term-color-green", "term color green", {}], ["eat-term-color-yellow", "term color yellow", {}], ["eat-term-color-blue", "term color blue", {}], ["eat-term-color-magenta", "term color magenta", {}], ["eat-term-color-cyan", "term color cyan", {}], ["eat-term-color-white", "term color white", {}], ["eat-term-color-bright-black", "term color bright black", {}], ["eat-term-color-bright-red", "term color bright red", {}], ["eat-term-color-bright-green", "term color bright green", {}], ["eat-term-color-bright-yellow", "term color bright yellow", {}], ["eat-term-color-bright-blue", "term color bright blue", {}], ["eat-term-color-bright-magenta", "term color bright magenta", {}], ["eat-term-color-bright-cyan", "term color bright cyan", {}], ["eat-term-color-bright-white", "term color bright white", {}], ["eat-term-bold", "term bold", {}], ["eat-term-faint", "term faint", {}], ["eat-term-italic", "term italic", {}], ["eat-term-slow-blink", "term slow blink", {}], ["eat-term-fast-blink", "term fast blink", {}], ["eat-shell-prompt-annotation-success", "shell prompt annotation success", {}], ["eat-shell-prompt-annotation-running", "shell prompt annotation running", {}], ["eat-shell-prompt-annotation-failure", "shell prompt annotation failure", {}]]}, "auto-dim-other-buffers": {"label": "auto-dim", "preview": "autodim", "hover": "", "faces": [["auto-dim-other-buffers", "auto dim other buffers", {}], ["auto-dim-other-buffers-hide", "hide", {}]]}, "dashboard": {"label": "dashboard", "preview": "dashboard", "hover": "", "faces": [["dashboard-banner-logo-title", "banner logo title", {"inherit": "default"}], ["dashboard-text-banner", "text banner", {"inherit": "font-lock-keyword-face"}], ["dashboard-heading", "heading", {"inherit": "font-lock-keyword-face"}], ["dashboard-items-face", "items", {"inherit": "widget-button"}], ["dashboard-navigator", "navigator", {"inherit": "font-lock-keyword-face"}], ["dashboard-no-items-face", "no items", {"inherit": "widget-button"}], ["dashboard-footer-face", "footer", {"inherit": "font-lock-doc-face"}], ["dashboard-footer-icon-face", "footer icon", {"inherit": "dashboard-footer-face"}]]}, "lsp-mode": {"label": "language server protocol (lsp)", "preview": "lsp", "hover": "", "faces": [["lsp-signature-face", "signature", {"inherit": "lsp-details-face"}], ["lsp-signature-highlight-function-argument", "signature highlight function argument", {"inherit": "eldoc-highlight-function-argument"}], ["lsp-signature-posframe", "signature posframe", {"inherit": "tooltip"}], ["lsp-face-highlight-read", "face highlight read", {"underline": {"style": "line", "color": null}, "inherit": "highlight"}], ["lsp-face-highlight-write", "face highlight write", {"weight": "bold", "inherit": "highlight"}], ["lsp-face-highlight-textual", "face highlight textual", {"inherit": "highlight"}], ["lsp-face-rename", "face rename", {"underline": {"style": "line", "color": null}}], ["lsp-rename-placeholder-face", "rename placeholder", {"inherit": "font-lock-variable-name-face"}], ["lsp-inlay-hint-face", "inlay hint", {"inherit": "font-lock-comment-face"}], ["lsp-inlay-hint-parameter-face", "inlay hint parameter", {"inherit": "lsp-inlay-hint-face"}], ["lsp-inlay-hint-type-face", "inlay hint type", {"inherit": "lsp-inlay-hint-face"}], ["lsp-details-face", "details", {"inherit": "shadow", "height": 0.8}], ["lsp-installation-buffer-face", "installation buffer", {"fg": "#00ff00"}], ["lsp-installation-finished-buffer-face", "installation finished buffer", {"fg": "#ffa500"}]]}, "git-gutter": {"label": "git-gutter", "preview": "gitgutter", "hover": "", "faces": [["git-gutter:added", "added", {"fg": "#00ff00", "weight": "bold", "inherit": "default"}], ["git-gutter:modified", "modified", {"fg": "#ff00ff", "weight": "bold", "inherit": "default"}], ["git-gutter:deleted", "deleted", {"fg": "#ff0000", "weight": "bold", "inherit": "default"}], ["git-gutter:unchanged", "unchanged", {"bg": "#ffff00", "inherit": "default"}], ["git-gutter:separator", "separator", {"fg": "#00ffff", "weight": "bold", "inherit": "default"}]]}, "flycheck": {"label": "flycheck", "preview": "flycheck", "hover": "", "faces": [["flycheck-error", "error", {"underline": {"style": "line", "color": null}}], ["flycheck-warning", "warning", {"underline": {"style": "line", "color": null}}], ["flycheck-info", "info", {"underline": {"style": "line", "color": null}}], ["flycheck-fringe-error", "fringe error", {"inherit": "error"}], ["flycheck-fringe-warning", "fringe warning", {"inherit": "warning"}], ["flycheck-fringe-info", "fringe info", {"inherit": "success"}], ["flycheck-delimited-error", "delimited error", {}], ["flycheck-error-delimiter", "error delimiter", {}], ["flycheck-error-list-error", "error list error", {"inherit": "error"}], ["flycheck-error-list-warning", "error list warning", {"inherit": "warning"}], ["flycheck-error-list-info", "error list info", {"inherit": "success"}], ["flycheck-error-list-error-message", "error list error message", {}], ["flycheck-error-list-checker-name", "error list checker name", {"inherit": "font-lock-function-name-face"}], ["flycheck-error-list-column-number", "error list column number", {}], ["flycheck-error-list-line-number", "error list line number", {}], ["flycheck-error-list-filename", "error list filename", {"inherit": "mode-line-buffer-id"}], ["flycheck-error-list-id", "error list id", {"inherit": "font-lock-type-face"}], ["flycheck-error-list-id-with-explainer", "error list id with explainer", {"box": {"style": "released", "width": 1, "color": null}, "inherit": "flycheck-error-list-id"}], ["flycheck-error-list-highlight", "error list highlight", {"weight": "bold"}], ["flycheck-verify-select-checker", "verify select checker", {"box": {"style": "released", "width": 1, "color": null}}]]}, "dired": {"label": "dired", "preview": "dired", "hover": "Directory-listing faces, reused by dirvish (a dired frontend).", "faces": [["dired-header", "header", {}], ["dired-directory", "directory", {}], ["dired-symlink", "symlink", {}], ["dired-broken-symlink", "broken symlink", {}], ["dired-special", "special", {}], ["dired-set-id", "set id", {}], ["dired-perm-write", "perm write", {}], ["dired-mark", "mark", {}], ["dired-marked", "marked", {}], ["dired-flagged", "flagged", {}], ["dired-ignored", "ignored", {}], ["dired-warning", "warning", {}]]}, "dirvish": {"label": "dirvish", "preview": "dirvish", "hover": "", "faces": [["dirvish-inactive", "inactive", {"inherit": "shadow"}], ["dirvish-free-space", "free space", {"inherit": "font-lock-constant-face"}], ["dirvish-hl-line", "hl line", {"extend": true, "inherit": "highlight"}], ["dirvish-hl-line-inactive", "hl line inactive", {"extend": true, "inherit": "region"}], ["dirvish-file-modes", "file modes", {"fg": "#6b6b6b"}], ["dirvish-file-link-number", "file link number", {"inherit": "font-lock-constant-face"}], ["dirvish-file-user-id", "file user id", {"inherit": "font-lock-preprocessor-face"}], ["dirvish-file-group-id", "file group id", {"inherit": "dirvish-file-user-id"}], ["dirvish-file-size", "file size", {"underline": {"style": "line", "color": null}, "inherit": "completions-annotations"}], ["dirvish-file-time", "file time", {"fg": "#979797"}], ["dirvish-file-inode-number", "file inode number", {"inherit": "dirvish-file-link-number"}], ["dirvish-file-device-number", "file device number", {"inherit": "dirvish-file-link-number"}], ["dirvish-subtree-guide", "subtree guide", {"bg": "unspecified", "underline": {"style": "line", "color": null}, "inherit": "dired-ignored"}], ["dirvish-subtree-state", "subtree state", {"bg": "unspecified", "underline": {"style": "line", "color": null}, "inherit": "dired-ignored"}], ["dirvish-collapse-dir-face", "collapse dir", {"inherit": "dired-directory"}], ["dirvish-collapse-empty-dir-face", "collapse empty dir", {"inherit": "shadow"}], ["dirvish-collapse-file-face", "collapse file", {"inherit": "default"}], ["dirvish-emerge-group-title", "emerge group title", {"inherit": "dired-ignored"}], ["dirvish-media-info-heading", "media info heading", {"inherit": ["dired-header", "bold"]}], ["dirvish-media-info-property-key", "media info property key", {"inherit": ["italic"]}], ["dirvish-narrow-match-face-0", "narrow match 0", {"fg": "#223fbf", "weight": "bold"}], ["dirvish-narrow-match-face-1", "narrow match 1", {"fg": "#8f0075", "weight": "bold"}], ["dirvish-narrow-match-face-2", "narrow match 2", {"fg": "#145a00", "weight": "bold"}], ["dirvish-narrow-match-face-3", "narrow match 3", {"fg": "#804000", "weight": "bold"}], ["dirvish-narrow-split", "narrow split", {"inherit": "font-lock-negation-char-face"}], ["dirvish-proc-running", "proc running", {"inherit": "warning"}], ["dirvish-proc-finished", "proc finished", {"inherit": "success"}], ["dirvish-proc-failed", "proc failed", {"inherit": "error"}], ["dirvish-git-commit-message-face", "git commit message", {"bg": "unspecified", "underline": {"style": "line", "color": null}, "inherit": "dired-ignored"}], ["dirvish-vc-added-state", "vc added state", {"inherit": "vc-locally-added-state"}], ["dirvish-vc-edited-state", "vc edited state", {"inherit": "vc-edited-state"}], ["dirvish-vc-removed-state", "vc removed state", {"inherit": "vc-removed-state"}], ["dirvish-vc-conflict-state", "vc conflict state", {"inherit": "vc-conflict-state"}], ["dirvish-vc-locked-state", "vc locked state", {"inherit": "vc-locked-state"}], ["dirvish-vc-missing-state", "vc missing state", {"inherit": "vc-missing-state"}], ["dirvish-vc-needs-merge-face", "vc needs merge", {"bg": "#efcbcf"}], ["dirvish-vc-needs-update-state", "vc needs update state", {"inherit": "vc-needs-update-state"}], ["dirvish-vc-unregistered-face", "vc unregistered", {"inherit": "font-lock-constant-face"}]]}, "calibredb": {"label": "calibredb", "preview": "calibredb", "hover": "", "faces": [["calibredb-search-header-library-name-face", "search header library name", {}], ["calibredb-search-header-library-path-face", "search header library path", {}], ["calibredb-search-header-total-face", "search header total", {}], ["calibredb-search-header-filter-face", "search header filter", {}], ["calibredb-search-header-sort-face", "search header sort", {}], ["calibredb-search-header-highlight-face", "search header highlight", {}], ["calibredb-id-face", "id", {}], ["calibredb-title-face", "title", {}], ["calibredb-author-face", "author", {}], ["calibredb-format-face", "format", {}], ["calibredb-size-face", "size", {}], ["calibredb-tag-face", "tag", {}], ["calibredb-date-face", "date", {}], ["calibredb-mark-face", "mark", {}], ["calibredb-series-face", "series", {}], ["calibredb-publisher-face", "publisher", {}], ["calibredb-pubdate-face", "pubdate", {}], ["calibredb-language-face", "language", {}], ["calibredb-comment-face", "comment", {}], ["calibredb-archive-face", "archive", {}], ["calibredb-favorite-face", "favorite", {}], ["calibredb-file-face", "file", {}], ["calibredb-ids-face", "ids", {}], ["calibredb-highlight-face", "highlight", {}], ["calibredb-current-page-button-face", "current page button", {}], ["calibredb-mouse-face", "mouse", {}], ["calibredb-title-detailed-view-face", "title detailed view", {}], ["calibredb-edit-annotation-header-title-face", "edit annotation header title", {}]]}, "nov-reading": {"label": "nov reading view", "preview": "novreading", "hover": "", "faces": [["cj/nov-reading-sepia", "sepia", {}], ["cj/nov-reading-dark", "dark", {}], ["cj/nov-reading-light", "light", {}], ["cj/nov-reading-sepia-heading", "sepia heading", {}], ["cj/nov-reading-sepia-link", "sepia link", {}], ["cj/nov-reading-dark-heading", "dark heading", {}], ["cj/nov-reading-dark-link", "dark link", {}], ["cj/nov-reading-light-heading", "light heading", {}], ["cj/nov-reading-light-link", "light link", {}]]}, "erc": {"label": "erc", "preview": "erc", "hover": "", "faces": [["erc-header-line", "header line", {}], ["erc-timestamp-face", "timestamp", {}], ["erc-notice-face", "notice", {}], ["erc-default-face", "default", {}], ["erc-current-nick-face", "current nick", {}], ["erc-my-nick-face", "my nick", {}], ["erc-my-nick-prefix-face", "my nick prefix", {}], ["erc-nick-default-face", "nick default", {}], ["erc-nick-prefix-face", "nick prefix", {}], ["erc-button-nick-default-face", "button nick default", {}], ["erc-nick-msg-face", "nick msg", {}], ["erc-direct-msg-face", "direct msg", {}], ["erc-action-face", "action", {}], ["erc-keyword-face", "keyword", {}], ["erc-pal-face", "pal", {}], ["erc-fool-face", "fool", {}], ["erc-dangerous-host-face", "dangerous host", {}], ["erc-error-face", "error", {}], ["erc-input-face", "input", {}], ["erc-prompt-face", "prompt", {}], ["erc-command-indicator-face", "command indicator", {}], ["erc-information", "information", {}], ["erc-button", "button", {}], ["erc-bold-face", "bold", {}], ["erc-italic-face", "italic", {}], ["erc-underline-face", "underline", {}], ["erc-inverse-face", "inverse", {}], ["erc-spoiler-face", "spoiler", {}], ["erc-fill-wrap-merge-indicator-face", "fill wrap merge indicator", {}], ["erc-keep-place-indicator-arrow", "keep place indicator arrow", {}], ["erc-keep-place-indicator-line", "keep place indicator line", {}]]}, "org-drill": {"label": "org-drill", "preview": "orgdrill", "hover": "", "faces": [["org-drill-hidden-cloze-face", "hidden cloze", {}], ["org-drill-visible-cloze-face", "visible cloze", {}], ["org-drill-visible-cloze-hint-face", "visible cloze hint", {}]]}, "org-noter": {"label": "org-noter", "preview": "orgnoter", "hover": "", "faces": [["org-noter-notes-exist-face", "notes exist", {}], ["org-noter-no-notes-exist-face", "no notes exist", {}]]}, "signel": {"label": "signel", "preview": "signel", "hover": "", "faces": [["signel-timestamp-face", "timestamp", {}], ["signel-my-msg-face", "my msg", {}], ["signel-other-msg-face", "other msg", {}], ["signel-error-face", "error", {}]]}, "pearl": {"label": "pearl", "preview": "pearl", "hover": "", "faces": [["pearl-preamble-summary", "preamble summary", {}], ["pearl-editable-comment", "editable comment", {}], ["pearl-readonly-comment", "readonly comment", {}], ["pearl-modified-highlight", "modified highlight", {}], ["pearl-modified-local", "modified local", {}], ["pearl-modified-unknown", "modified unknown", {}]]}, "slack": {"label": "slack", "preview": "slack", "hover": "", "faces": [["slack-room-info-title-face", "room info title", {}], ["slack-room-info-title-room-name-face", "room info title room name", {}], ["slack-room-info-section-title-face", "room info section title", {}], ["slack-room-info-section-label-face", "room info section label", {}], ["slack-room-unread-face", "room unread", {}], ["slack-message-output-header", "message output header", {}], ["slack-message-output-text", "message output text", {}], ["slack-message-output-reaction", "message output reaction", {}], ["slack-message-output-reaction-pressed", "message output reaction pressed", {}], ["slack-message-deleted-face", "message deleted", {}], ["slack-new-message-marker-face", "new message marker", {}], ["slack-all-thread-buffer-thread-header-face", "all thread buffer thread header", {}], ["slack-message-mention-face", "message mention", {}], ["slack-message-mention-me-face", "message mention me", {}], ["slack-message-mention-keyword-face", "message mention keyword", {}], ["slack-channel-button-face", "channel button", {}], ["slack-mrkdwn-bold-face", "mrkdwn bold", {}], ["slack-mrkdwn-italic-face", "mrkdwn italic", {}], ["slack-mrkdwn-code-face", "mrkdwn code", {}], ["slack-mrkdwn-code-block-face", "mrkdwn code block", {}], ["slack-mrkdwn-strike-face", "mrkdwn strike", {}], ["slack-mrkdwn-blockquote-face", "mrkdwn blockquote", {}], ["slack-mrkdwn-list-face", "mrkdwn list", {}], ["slack-attachment-header", "attachment header", {}], ["slack-attachment-footer", "attachment footer", {}], ["slack-attachment-pad", "attachment pad", {}], ["slack-attachment-field-title", "attachment field title", {}], ["slack-message-attachment-preview-header-face", "message attachment preview header", {}], ["slack-preview-face", "preview", {}], ["slack-block-highlight-source-overlay-face", "block highlight source overlay", {}], ["slack-message-action-face", "message action", {}], ["slack-message-action-primary-face", "message action primary", {}], ["slack-message-action-danger-face", "message action danger", {}], ["slack-button-block-element-face", "button block element", {}], ["slack-button-primary-block-element-face", "button primary block element", {}], ["slack-button-danger-block-element-face", "button danger block element", {}], ["slack-select-block-element-face", "select block element", {}], ["slack-overflow-block-element-face", "overflow block element", {}], ["slack-date-picker-block-element-face", "date picker block element", {}], ["slack-dialog-title-face", "dialog title", {}], ["slack-dialog-element-label-face", "dialog element label", {}], ["slack-dialog-element-hint-face", "dialog element hint", {}], ["slack-dialog-element-placeholder-face", "dialog element placeholder", {}], ["slack-dialog-element-error-face", "dialog element error", {}], ["slack-dialog-submit-button-face", "dialog submit button", {}], ["slack-dialog-cancel-button-face", "dialog cancel button", {}], ["slack-dialog-select-element-input-face", "dialog select element input", {}], ["slack-user-active-face", "user active", {}], ["slack-user-dnd-face", "user dnd", {}], ["slack-user-profile-header-face", "user profile header", {}], ["slack-user-profile-property-name-face", "user profile property name", {}], ["slack-profile-image-face", "profile image", {}], ["slack-search-result-message-header-face", "search result message header", {}], ["slack-search-result-message-username-face", "search result message username", {}], ["slack-modeline-has-unreads-face", "modeline has unreads", {}], ["slack-modeline-channel-has-unreads-face", "modeline channel has unreads", {}], ["slack-modeline-thread-has-unreads-face", "modeline thread has unreads", {}]]}, "telega": {"label": "telega", "preview": "telega", "hover": "", "faces": [["telega-root-heading", "root heading", {}], ["telega-tracking", "tracking", {}], ["telega-unread-unmuted-modeline", "unread unmuted modeline", {}], ["telega-username", "username", {}], ["telega-user-online-status", "user online status", {}], ["telega-user-non-online-status", "user non online status", {}], ["telega-secret-title", "secret title", {}], ["telega-contact-birthdays-today", "contact birthdays today", {}], ["telega-muted-count", "muted count", {}], ["telega-unmuted-count", "unmuted count", {}], ["telega-mention-count", "mention count", {}], ["telega-has-chatbuf-brackets", "has chatbuf brackets", {}], ["telega-delim-face", "delim", {}], ["telega-shadow", "shadow", {}], ["telega-link", "link", {}], ["telega-blue", "blue", {}], ["telega-red", "red", {}], ["telega-msg-heading", "msg heading", {}], ["telega-msg-user-title", "msg user title", {}], ["telega-msg-self-title", "msg self title", {}], ["telega-msg-deleted", "msg deleted", {}], ["telega-msg-sponsored", "msg sponsored", {}], ["telega-msg-inline-reply", "msg inline reply", {}], ["telega-msg-inline-forward", "msg inline forward", {}], ["telega-msg-inline-other", "msg inline other", {}], ["telega-entity-type-bold", "entity type bold", {}], ["telega-entity-type-italic", "entity type italic", {}], ["telega-entity-type-underline", "entity type underline", {}], ["telega-entity-type-strikethrough", "entity type strikethrough", {}], ["telega-entity-type-code", "entity type code", {}], ["telega-entity-type-pre", "entity type pre", {}], ["telega-entity-type-blockquote", "entity type blockquote", {}], ["telega-entity-type-mention", "entity type mention", {}], ["telega-entity-type-hashtag", "entity type hashtag", {}], ["telega-entity-type-cashtag", "entity type cashtag", {}], ["telega-entity-type-botcommand", "entity type botcommand", {}], ["telega-entity-type-texturl", "entity type texturl", {}], ["telega-entity-type-spoiler", "entity type spoiler", {}], ["telega-reaction", "reaction", {}], ["telega-reaction-chosen", "reaction chosen", {}], ["telega-reaction-paid", "reaction paid", {}], ["telega-reaction-paid-chosen", "reaction paid chosen", {}], ["telega-highlight-text-face", "highlight text", {}], ["telega-button-highlight", "button highlight", {}], ["telega-chat-prompt", "chat prompt", {}], ["telega-chat-prompt-aux", "chat prompt aux", {}], ["telega-chat-input-attachment", "chat input attachment", {}], ["telega-topic-button", "topic button", {}], ["telega-filter-active", "filter active", {}], ["telega-filter-button-active", "filter button active", {}], ["telega-filter-button-inactive", "filter button inactive", {}], ["telega-checklist-stats-done", "checklist stats done", {}], ["telega-checklist-stats-todo", "checklist stats todo", {}], ["telega-box-button", "box button", {}], ["telega-box-button-active", "box button active", {}], ["telega-box-button-default-active", "box button default active", {}], ["telega-box-button-default-passive", "box button default passive", {}], ["telega-box-button-primary-active", "box button primary active", {}], ["telega-box-button-primary-passive", "box button primary passive", {}], ["telega-box-button-success-active", "box button success active", {}], ["telega-box-button-success-passive", "box button success passive", {}], ["telega-box-button-danger-active", "box button danger active", {}], ["telega-box-button-danger-passive", "box button danger passive", {}], ["telega-box-button-ui-active", "box button ui active", {}], ["telega-box-button-ui-passive", "box button ui passive", {}], ["telega-box-button2-active", "box button2 active", {}], ["telega-box-button2-passive", "box button2 passive", {}], ["telega-box-button2-white-foreground", "box button2 white foreground", {}], ["telega-describe-item-title", "describe item title", {}], ["telega-describe-section-title", "describe section title", {}], ["telega-describe-subsection-title", "describe subsection title", {}], ["telega-enckey-00", "enckey 00", {}], ["telega-enckey-01", "enckey 01", {}], ["telega-enckey-10", "enckey 10", {}], ["telega-enckey-11", "enckey 11", {}], ["telega-palette-builtin-blue", "palette builtin blue", {}], ["telega-palette-builtin-green", "palette builtin green", {}], ["telega-palette-builtin-orange", "palette builtin orange", {}], ["telega-palette-builtin-purple", "palette builtin purple", {}], ["telega-webpage-title", "webpage title", {}], ["telega-webpage-subtitle", "webpage subtitle", {}], ["telega-webpage-header", "webpage header", {}], ["telega-webpage-subheader", "webpage subheader", {}], ["telega-webpage-outline", "webpage outline", {}], ["telega-webpage-fixed", "webpage fixed", {}], ["telega-webpage-preformatted", "webpage preformatted", {}], ["telega-webpage-marked", "webpage marked", {}], ["telega-webpage-strike-through", "webpage strike through", {}], ["telega-webpage-chat-link", "webpage chat link", {}], ["telega-link-preview-sitename", "link preview sitename", {}], ["telega-link-preview-title", "link preview title", {}]]}, "shr": {"label": "simple html renderer (shr)", "preview": "shr", "hover": "Simple HTML Renderer. Reused by eww, nov (epub reading), and mu4e / message for HTML mail.", "faces": [["shr-h1", "h1", {}], ["shr-h2", "h2", {}], ["shr-h3", "h3", {}], ["shr-h4", "h4", {}], ["shr-h5", "h5", {}], ["shr-h6", "h6", {}], ["shr-text", "text", {}], ["shr-link", "link", {}], ["shr-selected-link", "selected link", {}], ["shr-code", "code", {}], ["shr-mark", "mark", {}], ["shr-strike-through", "strike through", {}], ["shr-sup", "sup", {}], ["shr-abbreviation", "abbreviation", {}], ["shr-sliced-image", "sliced image", {}]]}, "nerd-icons": {"label": "nerd-icons", "preview": "nerdicons", "faces": [["nerd-icons-blue", "blue", {"fg": "#6a9fb5"}], ["nerd-icons-blue-alt", "blue alt", {"fg": "#2188b6"}], ["nerd-icons-cyan", "cyan", {"fg": "#75b5aa"}], ["nerd-icons-cyan-alt", "cyan alt", {"fg": "#0595bd"}], ["nerd-icons-dblue", "dblue", {"fg": "#446674"}], ["nerd-icons-dcyan", "dcyan", {"fg": "#48746d"}], ["nerd-icons-dgreen", "dgreen", {"fg": "#6d8143"}], ["nerd-icons-dmaroon", "dmaroon", {"fg": "#72584b"}], ["nerd-icons-dorange", "dorange", {"fg": "#915b2d"}], ["nerd-icons-dpink", "dpink", {"fg": "#7e5d5f"}], ["nerd-icons-dpurple", "dpurple", {"fg": "#694863"}], ["nerd-icons-dred", "dred", {"fg": "#843031"}], ["nerd-icons-dsilver", "dsilver", {"fg": "#838484"}], ["nerd-icons-dyellow", "dyellow", {"fg": "#b48d56"}], ["nerd-icons-green", "green", {"fg": "#90a959"}], ["nerd-icons-lblue", "lblue", {"fg": "#677174"}], ["nerd-icons-lcyan", "lcyan", {"fg": "#2c7d6e"}], ["nerd-icons-lgreen", "lgreen", {"fg": "#3d6837"}], ["nerd-icons-lmaroon", "lmaroon", {"fg": "#ce7a4e"}], ["nerd-icons-lorange", "lorange", {"fg": "#ffa500"}], ["nerd-icons-lpink", "lpink", {"fg": "#ff505b"}], ["nerd-icons-lpurple", "lpurple", {"fg": "#e69dd6"}], ["nerd-icons-lred", "lred", {"fg": "#eb595a"}], ["nerd-icons-lsilver", "lsilver", {"fg": "#7f7869"}], ["nerd-icons-lyellow", "lyellow", {"fg": "#ff9300"}], ["nerd-icons-maroon", "maroon", {"fg": "#8f5536"}], ["nerd-icons-orange", "orange", {"fg": "#d4843e"}], ["nerd-icons-pink", "pink", {"fg": "#fc505b"}], ["nerd-icons-purple", "purple", {"fg": "#68295b"}], ["nerd-icons-purple-alt", "purple alt", {"fg": "#5d54e1"}], ["nerd-icons-red", "red", {"fg": "#ac4142"}], ["nerd-icons-red-alt", "red alt", {"fg": "#843031"}], ["nerd-icons-silver", "silver", {"fg": "#716e68"}], ["nerd-icons-yellow", "yellow", {"fg": "#ffcc0e"}]], "legend": [{"key": "ext:el", "label": "init.el", "face": "nerd-icons-purple", "category": "extension", "glyph": "\ue632"}, {"key": "ext:py", "label": "app.py", "face": "nerd-icons-dblue", "category": "extension", "glyph": "\ue73c"}, {"key": "ext:org", "label": "notes.org", "face": "nerd-icons-lgreen", "category": "extension", "glyph": "\ue633"}, {"key": "ext:md", "label": "README.md", "face": "nerd-icons-lblue", "category": "extension", "glyph": "\uf48a"}, {"key": "ext:ts", "label": "main.ts", "face": "nerd-icons-blue-alt", "category": "extension", "glyph": "\udb81\udee6"}, {"key": "ext:html", "label": "index.html", "face": "nerd-icons-orange", "category": "extension", "glyph": "\ue736"}, {"key": "ext:rs", "label": "lib.rs", "face": "nerd-icons-maroon", "category": "extension", "glyph": "\ue7a8"}, {"key": "ext:js", "label": "app.js", "face": "nerd-icons-yellow", "category": "extension", "glyph": "\ue781"}, {"key": "ext:yml", "label": "ci.yml", "face": "nerd-icons-dyellow", "category": "extension", "glyph": "\ueb52"}, {"key": "ext:c", "label": "main.c", "face": "nerd-icons-blue", "category": "extension", "glyph": "\ue61e"}, {"key": "dir", "label": "src/", "face": "nerd-icons-yellow", "category": "dir", "glyph": "\ue6ad"}, {"key": "cmd", "label": "M-x command", "face": "nerd-icons-blue", "category": "command", "glyph": "\uea8c"}, {"key": "buf", "label": "*scratch*", "face": "nerd-icons-purple", "category": "buffer", "glyph": "\ue632"}], "gallery": [{"face": "nerd-icons-dpink", "hue": 5, "glyphs": [{"glyph": "\udb84\udd83", "name": "nf-md-bash"}, {"glyph": "\udb82\udc77", "name": "nf-md-graphql"}, {"glyph": "\udb81\udfec", "name": "nf-md-sass"}, {"glyph": "\ue662", "name": "nf-seti-graphql"}, {"glyph": "\ue67a", "name": "nf-seti-ocaml"}]}, {"face": "nerd-icons-pink", "hue": 5, "glyphs": [{"glyph": "\ue711", "name": "nf-dev-apple"}, {"glyph": "\udb81\udfec", "name": "nf-md-sass"}, {"glyph": "\uf4ae", "name": "nf-oct-code_of_conduct"}]}, {"face": "nerd-icons-dorange", "hue": 13, "glyphs": [{"glyph": "\ueb52", "name": "nf-cod-settings"}, {"glyph": "\ue779", "name": "nf-dev-gnu"}, {"glyph": "\ue7a8", "name": "nf-dev-rust"}, {"glyph": "\uf43d", "name": "nf-oct-key"}, {"glyph": "\ue673", "name": "nf-seti-makefile"}]}, {"face": "nerd-icons-lorange", "hue": 13, "glyphs": [{"glyph": "\ue6b0", "name": "nf-custom-common_lisp"}, {"glyph": "\ue62d", "name": "nf-custom-elixir"}, {"glyph": "\ue74d", "name": "nf-dev-bower"}, {"glyph": "\uf1c9", "name": "nf-fa-file_code_o"}, {"glyph": "\uf143", "name": "nf-fa-rss_square"}, {"glyph": "\ue62d", "name": "nf-seti-elixir"}, {"glyph": "\ue67e", "name": "nf-seti-perl"}]}, {"face": "nerd-icons-lred", "hue": 13, "glyphs": [{"glyph": "\ueb9c", "name": "nf-cod-library"}, {"glyph": "\ueb48", "name": "nf-cod-ruby"}, {"glyph": "\ue763", "name": "nf-dev-gulp"}, {"glyph": "\ue736", "name": "nf-dev-html5"}, {"glyph": "\ue807", "name": "nf-dev-jest"}, {"glyph": "\ue755", "name": "nf-dev-swift"}, {"glyph": "\uf022", "name": "nf-fa-list_alt"}, {"glyph": "\uf200", "name": "nf-fa-pie_chart"}, {"glyph": "\udb80\ude19", "name": "nf-md-file_document"}, {"glyph": "\uf4d2", "name": "nf-oct-file_diff"}, {"glyph": "\ue62d", "name": "nf-seti-elixir"}, {"glyph": "\ue65d", "name": "nf-seti-git"}, {"glyph": "\ue69b", "name": "nf-seti-tex"}]}, {"face": "nerd-icons-orange", "hue": 13, "glyphs": [{"glyph": "\ueb52", "name": "nf-cod-settings"}, {"glyph": "\ue6b0", "name": "nf-custom-common_lisp"}, {"glyph": "\ue632", "name": "nf-custom-emacs"}, {"glyph": "\ue634", "name": "nf-custom-kotlin"}, {"glyph": "\ue6b1", "name": "nf-custom-scheme"}, {"glyph": "\ue6b2", "name": "nf-custom-toml"}, {"glyph": "\ue7ad", "name": "nf-dev-aws"}, {"glyph": "\ue7bc", "name": "nf-dev-d3js"}, {"glyph": "\ue7eb", "name": "nf-dev-gitlab"}, {"glyph": "\ue736", "name": "nf-dev-html5"}, {"glyph": "\ue80f", "name": "nf-dev-jupyter"}, {"glyph": "\ue82a", "name": "nf-dev-matlab"}, {"glyph": "\uf143", "name": "nf-fa-rss_square"}, {"glyph": "\udb81\uddee", "name": "nf-md-disc"}, {"glyph": "\udb83\ude2d", "name": "nf-md-file_png_box"}, {"glyph": "\udb80\ude27", "name": "nf-md-file_powerpoint"}, {"glyph": "\udb81\uddc4", "name": "nf-md-zip_box"}, {"glyph": "\uf43d", "name": "nf-oct-key"}, {"glyph": "\ue666", "name": "nf-seti-haxe"}, {"glyph": "\ue634", "name": "nf-seti-kotlin"}, {"glyph": "\ue6a9", "name": "nf-seti-zig"}, {"glyph": "\ue6aa", "name": "nf-seti-zip"}]}, {"face": "nerd-icons-red", "hue": 14, "glyphs": [{"glyph": "\ueb48", "name": "nf-cod-ruby"}, {"glyph": "\ue6b1", "name": "nf-custom-scheme"}, {"glyph": "\ue794", "name": "nf-dev-cmake"}, {"glyph": "\ue7b1", "name": "nf-dev-erlang"}, {"glyph": "\ue725", "name": "nf-dev-git_branch"}, {"glyph": "\ue728", "name": "nf-dev-git_compare"}, {"glyph": "\ue777", "name": "nf-dev-haskell"}, {"glyph": "\ue71e", "name": "nf-dev-npm"}, {"glyph": "\ue737", "name": "nf-dev-scala"}, {"glyph": "\uf269", "name": "nf-fa-firefox"}, {"glyph": "\uf1fc", "name": "nf-fa-paint_brush"}, {"glyph": "\uf303", "name": "nf-linux-archlinux"}, {"glyph": "\udb81\ude1a", "name": "nf-md-chip"}, {"glyph": "\udb86\ude9d", "name": "nf-md-file_document_plus"}, {"glyph": "\uf417", "name": "nf-oct-git_commit"}, {"glyph": "\uf419", "name": "nf-oct-git_merge"}, {"glyph": "\uf456", "name": "nf-oct-lock"}, {"glyph": "\ue65d", "name": "nf-seti-git"}, {"glyph": "\ue66c", "name": "nf-seti-jade"}, {"glyph": "\ue686", "name": "nf-seti-pug"}, {"glyph": "\ue68d", "name": "nf-seti-sbt"}, {"glyph": "\ue697", "name": "nf-seti-svelte"}]}, {"face": "nerd-icons-red-alt", "hue": 14, "glyphs": [{"glyph": "\ue687", "name": "nf-seti-reasonml"}]}, {"face": "nerd-icons-maroon", "hue": 15, "glyphs": [{"glyph": "\ue751", "name": "nf-dev-coffeescript"}, {"glyph": "\ue7a8", "name": "nf-dev-rust"}, {"glyph": "\uf456", "name": "nf-oct-lock"}, {"glyph": "\uf4ed", "name": "nf-oct-log"}]}, {"face": "nerd-icons-lmaroon", "hue": 15, "glyphs": [{"glyph": "\ue751", "name": "nf-dev-coffeescript"}, {"glyph": "\ue7a1", "name": "nf-dev-prolog"}, {"glyph": "\udb80\udeea", "name": "nf-md-image_album"}, {"glyph": "\uf471", "name": "nf-oct-file_binary"}, {"glyph": "\uf410", "name": "nf-oct-file_zip"}, {"glyph": "\ue685", "name": "nf-seti-prolog"}]}, {"face": "nerd-icons-dred", "hue": 15, "glyphs": [{"glyph": "\ueaeb", "name": "nf-cod-file_pdf"}, {"glyph": "\ueb48", "name": "nf-cod-ruby"}, {"glyph": "\ue7b1", "name": "nf-dev-erlang"}, {"glyph": "\ue71e", "name": "nf-dev-npm"}, {"glyph": "\uf031", "name": "nf-fa-font"}, {"glyph": "\uf001", "name": "nf-fa-music"}, {"glyph": "\udb81\uded3", "name": "nf-md-feather"}, {"glyph": "\udb81\udff5", "name": "nf-md-form_textbox_password"}, {"glyph": "\udb80\udee9", "name": "nf-md-image"}, {"glyph": "\udb83\udcb9", "name": "nf-md-playlist_music_outline"}, {"glyph": "\ue687", "name": "nf-seti-reasonml"}]}, {"face": "nerd-icons-dmaroon", "hue": 15, "glyphs": [{"glyph": "\ue7a8", "name": "nf-dev-rust"}]}, {"face": "nerd-icons-lyellow", "hue": 45, "glyphs": [{"glyph": "\ueb52", "name": "nf-cod-settings"}, {"glyph": "\ue768", "name": "nf-dev-clojure"}, {"glyph": "\ue76a", "name": "nf-dev-clojure_alt"}, {"glyph": "\ue74c", "name": "nf-dev-grunt"}, {"glyph": "\uf249", "name": "nf-fa-sticky_note"}, {"glyph": "\uf45e", "name": "nf-oct-checklist"}, {"glyph": "\ue62d", "name": "nf-seti-elixir"}, {"glyph": "\ue664", "name": "nf-seti-haml"}, {"glyph": "\ue695", "name": "nf-seti-stylelint"}]}, {"face": "nerd-icons-dyellow", "hue": 45, "glyphs": [{"glyph": "\ueb52", "name": "nf-cod-settings"}, {"glyph": "\ue758", "name": "nf-dev-less"}, {"glyph": "\ue7a8", "name": "nf-dev-rust"}]}, {"face": "nerd-icons-yellow", "hue": 45, "glyphs": [{"glyph": "\ueacd", "name": "nf-cod-dashboard"}, {"glyph": "\ueb52", "name": "nf-cod-settings"}, {"glyph": "\ue62f", "name": "nf-custom-crystal"}, {"glyph": "\ue632", "name": "nf-custom-emacs"}, {"glyph": "\ue741", "name": "nf-dev-awk"}, {"glyph": "\ue749", "name": "nf-dev-css3"}, {"glyph": "\ue781", "name": "nf-dev-javascript"}, {"glyph": "\ue87d", "name": "nf-dev-qt"}, {"glyph": "\ue7a8", "name": "nf-dev-rust"}, {"glyph": "\ue8d9", "name": "nf-dev-vitest"}, {"glyph": "\uf0e7", "name": "nf-fa-bolt"}, {"glyph": "\uf143", "name": "nf-fa-rss_square"}, {"glyph": "\uf249", "name": "nf-fa-sticky_note"}, {"glyph": "\udb82\ude25", "name": "nf-md-babel"}, {"glyph": "\udb81\ude26", "name": "nf-md-code_json"}, {"glyph": "\uf4ed", "name": "nf-oct-log"}, {"glyph": "\ue639", "name": "nf-seti-babel"}, {"glyph": "\ue62f", "name": "nf-seti-crystal"}, {"glyph": "\ue677", "name": "nf-seti-nim"}, {"glyph": "\ue631", "name": "nf-seti-puppet"}]}, {"face": "nerd-icons-green", "hue": 79, "glyphs": [{"glyph": "\ueacd", "name": "nf-cod-dashboard"}, {"glyph": "\ue6b5", "name": "nf-custom-ada"}, {"glyph": "\ue61e", "name": "nf-custom-c"}, {"glyph": "\ue768", "name": "nf-dev-clojure"}, {"glyph": "\ue76a", "name": "nf-dev-clojure_alt"}, {"glyph": "\ue718", "name": "nf-dev-nodejs_small"}, {"glyph": "\ue795", "name": "nf-dev-terminal"}, {"glyph": "\uee36", "name": "nf-fa-file_arrow_down"}, {"glyph": "\uf0fd", "name": "nf-fa-h_square"}, {"glyph": "\uf001", "name": "nf-fa-music"}, {"glyph": "\uf1ea", "name": "nf-fa-newspaper"}, {"glyph": "\uf1fc", "name": "nf-fa-paint_brush"}, {"glyph": "\udb80\udcbd", "name": "nf-md-book_open"}, {"glyph": "\udb83\udd78", "name": "nf-md-file_gif_box"}, {"glyph": "\udb84\udce2", "name": "nf-md-file_table_box_multiple"}, {"glyph": "\udb80\udf1b", "name": "nf-md-language_csharp"}, {"glyph": "\uf472", "name": "nf-oct-database"}, {"glyph": "\uf43d", "name": "nf-oct-key"}, {"glyph": "\ue65d", "name": "nf-seti-git"}]}, {"face": "nerd-icons-dgreen", "hue": 79, "glyphs": [{"glyph": "\ue62b", "name": "nf-custom-vim"}, {"glyph": "\ue72b", "name": "nf-dev-apache"}, {"glyph": "\ue776", "name": "nf-dev-nginx"}, {"glyph": "\udb80\ude1b", "name": "nf-md-file_excel"}, {"glyph": "\uf4d2", "name": "nf-oct-file_diff"}, {"glyph": "\uf40f", "name": "nf-oct-file_media"}, {"glyph": "\uf4ed", "name": "nf-oct-log"}]}, {"face": "nerd-icons-lgreen", "hue": 83, "glyphs": [{"glyph": "\ue633", "name": "nf-custom-orgmode"}, {"glyph": "\ue794", "name": "nf-dev-cmake"}, {"glyph": "\ue769", "name": "nf-dev-perl"}, {"glyph": "\ue759", "name": "nf-dev-stylus"}, {"glyph": "\uf1ea", "name": "nf-fa-newspaper"}, {"glyph": "\udb82\udd84", "name": "nf-md-map_search"}, {"glyph": "\udb80\udf99", "name": "nf-md-nodejs"}, {"glyph": "\uf45e", "name": "nf-oct-checklist"}, {"glyph": "\uf4d2", "name": "nf-oct-file_diff"}, {"glyph": "\ue698", "name": "nf-seti-svg"}, {"glyph": "\ue6a0", "name": "nf-seti-vue"}]}, {"face": "nerd-icons-cyan", "hue": 189, "glyphs": [{"glyph": "\ue775", "name": "nf-dev-groovy"}, {"glyph": "\uf080", "name": "nf-fa-bar_chart"}, {"glyph": "\uf15c", "name": "nf-fa-file_text"}, {"glyph": "\uf031", "name": "nf-fa-font"}, {"glyph": "\uf303", "name": "nf-linux-archlinux"}, {"glyph": "\udb85\udd17", "name": "nf-md-file_document_multiple"}, {"glyph": "\udb80\ude27", "name": "nf-md-file_powerpoint"}, {"glyph": "\udb82\udce8", "name": "nf-md-gentoo"}, {"glyph": "\udb82\udfc2", "name": "nf-md-script_text"}, {"glyph": "\udb81\udcce", "name": "nf-md-star"}, {"glyph": "\ue650", "name": "nf-seti-docker"}]}, {"face": "nerd-icons-dcyan", "hue": 190, "glyphs": [{"glyph": "\uf031", "name": "nf-fa-font"}]}, {"face": "nerd-icons-cyan-alt", "hue": 192, "glyphs": [{"glyph": "\ue775", "name": "nf-dev-groovy"}]}, {"face": "nerd-icons-lcyan", "hue": 197, "glyphs": [{"glyph": "\ueb9c", "name": "nf-cod-library"}, {"glyph": "\ue795", "name": "nf-dev-terminal"}, {"glyph": "\uf405", "name": "nf-oct-book"}]}, {"face": "nerd-icons-lsilver", "hue": 210, "glyphs": [{"glyph": "\uebc4", "name": "nf-cod-terminal_cmd"}, {"glyph": "\ue73d", "name": "nf-dev-php"}, {"glyph": "\ue795", "name": "nf-dev-terminal"}, {"glyph": "\uf0fc", "name": "nf-fa-beer"}, {"glyph": "\uf013", "name": "nf-fa-cog"}, {"glyph": "\udb84\udc7b", "name": "nf-md-file_cog"}, {"glyph": "\udb83\udd13", "name": "nf-md-fountain_pen_tip"}, {"glyph": "\uf425", "name": "nf-oct-tools"}, {"glyph": "\ue673", "name": "nf-seti-makefile"}]}, {"face": "nerd-icons-silver", "hue": 210, "glyphs": [{"glyph": "\ue6b4", "name": "nf-custom-prettier"}, {"glyph": "\ue74d", "name": "nf-dev-bower"}, {"glyph": "\ue706", "name": "nf-dev-database"}, {"glyph": "\uf187", "name": "nf-fa-archive"}, {"glyph": "\uf085", "name": "nf-fa-cogs"}, {"glyph": "\uf001", "name": "nf-fa-music"}, {"glyph": "\uf472", "name": "nf-oct-database"}, {"glyph": "\ue652", "name": "nf-seti-editorconfig"}, {"glyph": "\ue660", "name": "nf-seti-gradle"}, {"glyph": "\ue66f", "name": "nf-seti-jinja"}]}, {"face": "nerd-icons-dsilver", "hue": 210, "glyphs": [{"glyph": "\ueae8", "name": "nf-cod-file_binary"}, {"glyph": "\ue632", "name": "nf-custom-emacs"}, {"glyph": "\ue73c", "name": "nf-dev-python"}, {"glyph": "\uf1c9", "name": "nf-fa-file_code"}, {"glyph": "\uf0c5", "name": "nf-fa-files_o"}, {"glyph": "\uf369", "name": "nf-linux-xorg"}, {"glyph": "\uf471", "name": "nf-oct-file_binary"}, {"glyph": "\uf42f", "name": "nf-oct-mail"}, {"glyph": "\uf487", "name": "nf-oct-package"}]}, {"face": "nerd-icons-lblue", "hue": 211, "glyphs": [{"glyph": "\ueb9c", "name": "nf-cod-library"}, {"glyph": "\ue632", "name": "nf-custom-emacs"}, {"glyph": "\ue7d2", "name": "nf-dev-eslint"}, {"glyph": "\ue728", "name": "nf-dev-git_compare"}, {"glyph": "\ue7ba", "name": "nf-dev-react"}, {"glyph": "\ue8e3", "name": "nf-dev-webpack"}, {"glyph": "\uf1c9", "name": "nf-fa-file_code_o"}, {"glyph": "\uf120", "name": "nf-fa-terminal"}, {"glyph": "\udb80\udcba", "name": "nf-md-book"}, {"glyph": "\udb81\ude70", "name": "nf-md-file_restore"}, {"glyph": "\uf43d", "name": "nf-oct-key"}, {"glyph": "\uf48a", "name": "nf-oct-markdown"}, {"glyph": "\ue650", "name": "nf-seti-docker"}, {"glyph": "\ue62d", "name": "nf-seti-elixir"}, {"glyph": "\ue68a", "name": "nf-seti-r"}]}, {"face": "nerd-icons-blue", "hue": 212, "glyphs": [{"glyph": "\ue6b5", "name": "nf-custom-ada"}, {"glyph": "\ue61e", "name": "nf-custom-c"}, {"glyph": "\ue61d", "name": "nf-custom-cpp"}, {"glyph": "\ue62c", "name": "nf-custom-elm"}, {"glyph": "\ue632", "name": "nf-custom-emacs"}, {"glyph": "\ue6b1", "name": "nf-custom-scheme"}, {"glyph": "\ue768", "name": "nf-dev-clojure"}, {"glyph": "\ue76a", "name": "nf-dev-clojure_alt"}, {"glyph": "\ue794", "name": "nf-dev-cmake"}, {"glyph": "\ue798", "name": "nf-dev-dart"}, {"glyph": "\ue7a7", "name": "nf-dev-fsharp"}, {"glyph": "\ue767", "name": "nf-dev-jenkins"}, {"glyph": "\ue795", "name": "nf-dev-terminal"}, {"glyph": "\uf293", "name": "nf-fa-bluetooth"}, {"glyph": "\uf02d", "name": "nf-fa-book"}, {"glyph": "\uf268", "name": "nf-fa-chrome"}, {"glyph": "\uf008", "name": "nf-fa-film"}, {"glyph": "\uf129", "name": "nf-fa-info"}, {"glyph": "\uf0d0", "name": "nf-fa-magic"}, {"glyph": "\uf1fc", "name": "nf-fa-paint_brush"}, {"glyph": "\ue217", "name": "nf-fae-telegram"}, {"glyph": "\udb80\udcba", "name": "nf-md-book"}, {"glyph": "\udb81\udde6", "name": "nf-md-copyright"}, {"glyph": "\udb80\ude2c", "name": "nf-md-file_word"}, {"glyph": "\udb82\udce8", "name": "nf-md-gentoo"}, {"glyph": "\udb81\udee6", "name": "nf-md-language_typescript"}, {"glyph": "\udb82\uded1", "name": "nf-md-mastodon"}, {"glyph": "\udb84\udd05", "name": "nf-md-nix"}, {"glyph": "\udb82\ude0a", "name": "nf-md-powershell"}, {"glyph": "\uf4bc", "name": "nf-oct-cpu"}, {"glyph": "\uf4d1", "name": "nf-oct-file_badge"}, {"glyph": "\uf40f", "name": "nf-oct-file_media"}, {"glyph": "\uf43d", "name": "nf-oct-key"}, {"glyph": "\uf412", "name": "nf-oct-tag"}, {"glyph": "\ue637", "name": "nf-seti-asm"}, {"glyph": "\ue642", "name": "nf-seti-clojure"}, {"glyph": "\ue650", "name": "nf-seti-docker"}, {"glyph": "\ue62c", "name": "nf-seti-elm"}, {"glyph": "\ue65e", "name": "nf-seti-go2"}, {"glyph": "\ue65f", "name": "nf-seti-godot"}]}, {"face": "nerd-icons-dblue", "hue": 212, "glyphs": [{"glyph": "\ueb9c", "name": "nf-cod-library"}, {"glyph": "\ue7b0", "name": "nf-dev-docker"}, {"glyph": "\ue73c", "name": "nf-dev-python"}, {"glyph": "\uf008", "name": "nf-fa-film"}, {"glyph": "\uf1fc", "name": "nf-fa-paint_brush"}, {"glyph": "\udb80\ude25", "name": "nf-md-file_jpg_box"}, {"glyph": "\udb80\udf1b", "name": "nf-md-language_csharp"}, {"glyph": "\uf472", "name": "nf-oct-database"}, {"glyph": "\uf40f", "name": "nf-oct-file_media"}, {"glyph": "\uf437", "name": "nf-oct-graph"}, {"glyph": "\ue620", "name": "nf-seti-lua"}]}, {"face": "nerd-icons-blue-alt", "hue": 213, "glyphs": [{"glyph": "\ue7a7", "name": "nf-dev-fsharp"}, {"glyph": "\udb81\udee6", "name": "nf-md-language_typescript"}, {"glyph": "\udb81\udf08", "name": "nf-md-react"}, {"glyph": "\ue615", "name": "nf-seti-config"}, {"glyph": "\ue6a7", "name": "nf-seti-yarn"}]}, {"face": "nerd-icons-lpurple", "hue": 265, "glyphs": [{"glyph": "\udb83\udc7a", "name": "nf-md-eslint"}, {"glyph": "\udb80\udf1e", "name": "nf-md-language_javascript"}, {"glyph": "\ue62d", "name": "nf-seti-elixir"}]}, {"face": "nerd-icons-purple", "hue": 272, "glyphs": [{"glyph": "\ue61d", "name": "nf-custom-cpp"}, {"glyph": "\ue632", "name": "nf-custom-emacs"}, {"glyph": "\ue738", "name": "nf-dev-java"}, {"glyph": "\ue795", "name": "nf-dev-terminal"}, {"glyph": "\uf0fd", "name": "nf-fa-h_square"}, {"glyph": "\uf129", "name": "nf-fa-info"}, {"glyph": "\uf1fc", "name": "nf-fa-paint_brush"}, {"glyph": "\ue217", "name": "nf-fae-telegram"}, {"glyph": "\udb83\udc7a", "name": "nf-md-eslint"}, {"glyph": "\udb84\ude1a", "name": "nf-md-language_fortran"}, {"glyph": "\udb81\ude10", "name": "nf-md-microsoft_visual_studio"}, {"glyph": "\ue624", "name": "nf-seti-julia"}, {"glyph": "\ue673", "name": "nf-seti-makefile"}]}, {"face": "nerd-icons-purple-alt", "hue": 272, "glyphs": [{"glyph": "\ue8e0", "name": "nf-dev-wasm"}, {"glyph": "\udb84\udc62", "name": "nf-md-terraform"}, {"glyph": "\ue6a1", "name": "nf-seti-wasm"}]}, {"face": "nerd-icons-dpurple", "hue": 272, "glyphs": [{"glyph": "\ue738", "name": "nf-dev-java"}, {"glyph": "\uf0e6", "name": "nf-fa-comments_o"}, {"glyph": "\uf01c", "name": "nf-fa-inbox"}, {"glyph": "\uf129", "name": "nf-fa-info"}, {"glyph": "\uf03a", "name": "nf-fa-list"}, {"glyph": "\uf1fc", "name": "nf-fa-paint_brush"}, {"glyph": "\uf002", "name": "nf-fa-search"}, {"glyph": "\uf0ce", "name": "nf-fa-table"}]}, {"face": "nerd-icons-lpink", "hue": 356, "glyphs": [{"glyph": "\ue795", "name": "nf-dev-terminal"}, {"glyph": "\uf461", "name": "nf-oct-bookmark"}, {"glyph": "\ue67a", "name": "nf-seti-ocaml"}]}]}, "2048-game": {"label": "2048-game", "preview": "generic", "faces": [["twentyfortyeight-face-1024", "twentyfortyeight 1024", {"fg": "#000000", "bg": "#ffd700"}], ["twentyfortyeight-face-128", "twentyfortyeight 128", {"fg": "#ffffff", "bg": "#8b0000"}], ["twentyfortyeight-face-16", "twentyfortyeight 16", {"fg": "#000000", "bg": "#ffa500"}], ["twentyfortyeight-face-2", "twentyfortyeight 2", {"fg": "#000000", "bg": "#f0e68c"}], ["twentyfortyeight-face-2048", "twentyfortyeight 2048", {"fg": "#000000", "bg": "#ffff00"}], ["twentyfortyeight-face-256", "twentyfortyeight 256", {"fg": "#ffffff", "bg": "#8b008b"}], ["twentyfortyeight-face-32", "twentyfortyeight 32", {"fg": "#000000", "bg": "#ff4500"}], ["twentyfortyeight-face-4", "twentyfortyeight 4", {"fg": "#000000", "bg": "#deb887"}], ["twentyfortyeight-face-512", "twentyfortyeight 512", {"fg": "#000000", "bg": "#ff00ff"}], ["twentyfortyeight-face-64", "twentyfortyeight 64", {"fg": "#ffffff", "bg": "#b22222"}], ["twentyfortyeight-face-8", "twentyfortyeight 8", {"fg": "#000000", "bg": "#cd8500"}]]}, "alert": {"label": "alert", "preview": "generic", "faces": [["alert-high-face", "high", {"fg": "#ff8c00", "weight": "bold"}], ["alert-low-face", "low", {"fg": "#00008b"}], ["alert-moderate-face", "moderate", {"fg": "#ffd700", "weight": "bold"}], ["alert-normal-face", "normal", {}], ["alert-trivial-face", "trivial", {"fg": "#9400d3"}], ["alert-urgent-face", "urgent", {"fg": "#ff0000", "weight": "bold"}]]}, "all-the-icons": {"label": "all-the-icons", "preview": "generic", "faces": [["all-the-icons-blue", "blue", {"fg": "#6a9fb5"}], ["all-the-icons-blue-alt", "blue alt", {"fg": "#2188b6"}], ["all-the-icons-cyan", "cyan", {"fg": "#75b5aa"}], ["all-the-icons-cyan-alt", "cyan alt", {"fg": "#0595bd"}], ["all-the-icons-dblue", "dblue", {"fg": "#446674"}], ["all-the-icons-dcyan", "dcyan", {"fg": "#48746d"}], ["all-the-icons-dgreen", "dgreen", {"fg": "#6d8143"}], ["all-the-icons-dmaroon", "dmaroon", {"fg": "#72584b"}], ["all-the-icons-dorange", "dorange", {"fg": "#915b2d"}], ["all-the-icons-dpink", "dpink", {"fg": "#7e5d5f"}], ["all-the-icons-dpurple", "dpurple", {"fg": "#694863"}], ["all-the-icons-dred", "dred", {"fg": "#843031"}], ["all-the-icons-dsilver", "dsilver", {"fg": "#838484"}], ["all-the-icons-dyellow", "dyellow", {"fg": "#b48d56"}], ["all-the-icons-green", "green", {"fg": "#90a959"}], ["all-the-icons-lblue", "lblue", {"fg": "#677174"}], ["all-the-icons-lcyan", "lcyan", {"fg": "#2c7d6e"}], ["all-the-icons-lgreen", "lgreen", {"fg": "#3d6837"}], ["all-the-icons-lmaroon", "lmaroon", {"fg": "#ce7a4e"}], ["all-the-icons-lorange", "lorange", {"fg": "#ffa500"}], ["all-the-icons-lpink", "lpink", {"fg": "#ff505b"}], ["all-the-icons-lpurple", "lpurple", {"fg": "#e69dd6"}], ["all-the-icons-lred", "lred", {"fg": "#eb595a"}], ["all-the-icons-lsilver", "lsilver", {"fg": "#7f7869"}], ["all-the-icons-lyellow", "lyellow", {"fg": "#ff9300"}], ["all-the-icons-maroon", "maroon", {"fg": "#8f5536"}], ["all-the-icons-orange", "orange", {"fg": "#d4843e"}], ["all-the-icons-pink", "pink", {"fg": "#fc505b"}], ["all-the-icons-purple", "purple", {"fg": "#68295b"}], ["all-the-icons-purple-alt", "purple alt", {"fg": "#5d54e1"}], ["all-the-icons-red", "red", {"fg": "#ac4142"}], ["all-the-icons-red-alt", "red alt", {"fg": "#843031"}], ["all-the-icons-silver", "silver", {"fg": "#716e68"}], ["all-the-icons-yellow", "yellow", {"fg": "#ffcc0e"}]]}, "company": {"label": "company", "preview": "generic", "faces": [["company-echo", "echo", {}], ["company-echo-common", "echo common", {"fg": "#8b1a1a"}], ["company-preview", "preview", {"inherit": ["company-tooltip-selection", "company-tooltip"]}], ["company-preview-common", "preview common", {"inherit": "company-tooltip-common-selection"}], ["company-preview-search", "preview search", {"inherit": "company-tooltip-common-selection"}], ["company-tooltip", "tooltip", {"fg": "#000000", "bg": "#fff8dc"}], ["company-tooltip-annotation", "tooltip annotation", {"fg": "#8b1a1a"}], ["company-tooltip-annotation-selection", "tooltip annotation selection", {"inherit": "company-tooltip-annotation"}], ["company-tooltip-common", "tooltip common", {"fg": "#8b0000"}], ["company-tooltip-common-selection", "tooltip common selection", {"inherit": "company-tooltip-common"}], ["company-tooltip-deprecated", "tooltip deprecated", {"strike": {"color": null}}], ["company-tooltip-mouse", "tooltip mouse", {"inherit": "highlight"}], ["company-tooltip-quick-access", "tooltip quick access", {"inherit": "company-tooltip-annotation"}], ["company-tooltip-quick-access-selection", "tooltip quick access selection", {"inherit": "company-tooltip-annotation-selection"}], ["company-tooltip-scrollbar-thumb", "tooltip scrollbar thumb", {"bg": "#cd5c5c"}], ["company-tooltip-scrollbar-track", "tooltip scrollbar track", {"bg": "#f5deb3"}], ["company-tooltip-search", "tooltip search", {"inherit": "highlight"}], ["company-tooltip-search-selection", "tooltip search selection", {"inherit": "highlight"}], ["company-tooltip-selection", "tooltip selection", {"bg": "#add8e6"}]]}, "company-box": {"label": "company-box", "preview": "generic", "faces": [["company-box-annotation", "annotation", {"inherit": "company-tooltip-annotation"}], ["company-box-background", "background", {"inherit": "company-tooltip"}], ["company-box-candidate", "candidate", {"fg": "#000000"}], ["company-box-numbers", "numbers", {"inherit": "company-box-candidate"}], ["company-box-scrollbar", "scrollbar", {"inherit": "company-tooltip-selection"}], ["company-box-selection", "selection", {"extend": true, "inherit": "company-tooltip-selection"}]]}, "consult": {"label": "consult", "preview": "generic", "faces": [["consult-async-failed", "async failed", {"inherit": "error"}], ["consult-async-finished", "async finished", {"inherit": "success"}], ["consult-async-running", "async running", {"inherit": "consult-narrow-indicator"}], ["consult-async-split", "async split", {"inherit": "font-lock-negation-char-face"}], ["consult-bookmark", "bookmark", {"inherit": "font-lock-constant-face"}], ["consult-buffer", "buffer", {}], ["consult-file", "file", {"inherit": "font-lock-function-name-face"}], ["consult-grep-context", "grep context", {"inherit": "shadow"}], ["consult-help", "help", {"inherit": "shadow"}], ["consult-highlight-mark", "highlight mark", {"inherit": "consult-highlight-match"}], ["consult-highlight-match", "highlight match", {"inherit": "match"}], ["consult-key", "key", {"inherit": "font-lock-keyword-face"}], ["consult-line-number", "line number", {"inherit": "consult-key"}], ["consult-line-number-prefix", "line number prefix", {"inherit": "line-number"}], ["consult-line-number-wrapped", "line number wrapped", {"inherit": "warning"}], ["consult-narrow-indicator", "narrow indicator", {"inherit": "warning"}], ["consult-preview-insertion", "preview insertion", {"inherit": "region"}], ["consult-preview-line", "preview line", {"extend": true, "inherit": "consult-preview-insertion"}], ["consult-preview-match", "preview match", {"inherit": "isearch"}], ["consult-separator", "separator", {}]]}, "embark": {"label": "embark", "preview": "generic", "faces": [["embark-collect-annotation", "collect annotation", {"inherit": "completions-annotations"}], ["embark-collect-candidate", "collect candidate", {"inherit": "default"}], ["embark-collect-group-separator", "collect group separator", {"slant": "italic", "strike": {"color": null}, "inherit": "shadow"}], ["embark-collect-group-title", "collect group title", {"slant": "italic", "inherit": "shadow"}], ["embark-keybinding", "keybinding", {"inherit": "success"}], ["embark-keybinding-repeat", "keybinding repeat", {"inherit": "font-lock-builtin-face"}], ["embark-keymap", "keymap", {"slant": "italic"}], ["embark-selected", "selected", {"inherit": "match"}], ["embark-target", "target", {"inherit": "highlight"}], ["embark-verbose-indicator-documentation", "verbose indicator documentation", {"inherit": "completions-annotations"}], ["embark-verbose-indicator-shadowed", "verbose indicator shadowed", {"inherit": "shadow"}], ["embark-verbose-indicator-title", "verbose indicator title", {"weight": "bold", "height": 1.1}]]}, "emms": {"label": "emacs multimedia system (emms)", "preview": "generic", "faces": [["emms-browser-album-face", "browser album", {}], ["emms-browser-albumartist-face", "browser albumartist", {}], ["emms-browser-artist-face", "browser artist", {}], ["emms-browser-composer-face", "browser composer", {}], ["emms-browser-performer-face", "browser performer", {}], ["emms-browser-track-face", "browser track", {}], ["emms-browser-year/genre-face", "browser year/genre", {}], ["emms-metaplaylist-mode-current-face", "metaplaylist mode current", {"fg": "#ffffff", "bg": "#cd0000"}], ["emms-metaplaylist-mode-face", "metaplaylist mode", {"fg": "#cd0000"}], ["emms-playlist-selected-face", "playlist selected", {"fg": "#ffffff", "bg": "#0000cd"}], ["emms-playlist-track-face", "playlist track", {"fg": "#0000ff"}]]}, "flyspell-correct": {"label": "flyspell-correct", "preview": "generic", "faces": [["flyspell-correct-highlight-face", "highlight", {"inherit": "isearch"}]]}, "ghostel": {"label": "ghostel", "preview": "generic", "faces": [["ghostel-color-black", "color black", {"inherit": "ansi-color-black"}], ["ghostel-color-blue", "color blue", {"inherit": "ansi-color-blue"}], ["ghostel-color-bright-black", "color bright black", {"inherit": "ansi-color-bright-black"}], ["ghostel-color-bright-blue", "color bright blue", {"inherit": "ansi-color-bright-blue"}], ["ghostel-color-bright-cyan", "color bright cyan", {"inherit": "ansi-color-bright-cyan"}], ["ghostel-color-bright-green", "color bright green", {"inherit": "ansi-color-bright-green"}], ["ghostel-color-bright-magenta", "color bright magenta", {"inherit": "ansi-color-bright-magenta"}], ["ghostel-color-bright-red", "color bright red", {"inherit": "ansi-color-bright-red"}], ["ghostel-color-bright-white", "color bright white", {"inherit": "ansi-color-bright-white"}], ["ghostel-color-bright-yellow", "color bright yellow", {"inherit": "ansi-color-bright-yellow"}], ["ghostel-color-cyan", "color cyan", {"inherit": "ansi-color-cyan"}], ["ghostel-color-green", "color green", {"inherit": "ansi-color-green"}], ["ghostel-color-magenta", "color magenta", {"inherit": "ansi-color-magenta"}], ["ghostel-color-red", "color red", {"inherit": "ansi-color-red"}], ["ghostel-color-white", "color white", {"inherit": "ansi-color-white"}], ["ghostel-color-yellow", "color yellow", {"inherit": "ansi-color-yellow"}], ["ghostel-default", "default", {"inherit": "default"}], ["ghostel-fake-cursor", "fake cursor", {"box": {"style": "line", "width": 1, "color": null}}], ["ghostel-fake-cursor-box", "fake cursor box", {"inherit": "cursor"}]]}, "highlight-indent-guides": {"label": "highlight-indent-guides", "preview": "generic", "faces": [["highlight-indent-guides-character-face", "character", {}], ["highlight-indent-guides-even-face", "even", {}], ["highlight-indent-guides-odd-face", "odd", {}], ["highlight-indent-guides-stack-character-face", "stack character", {}], ["highlight-indent-guides-stack-even-face", "stack even", {}], ["highlight-indent-guides-stack-odd-face", "stack odd", {}], ["highlight-indent-guides-top-character-face", "top character", {}], ["highlight-indent-guides-top-even-face", "top even", {}], ["highlight-indent-guides-top-odd-face", "top odd", {}]]}, "hl-todo": {"label": "hl-todo", "preview": "generic", "faces": [["hl-todo", "hl todo", {"fg": "#cc9393", "weight": "bold"}], ["hl-todo-flymake-type", "flymake type", {"inherit": "font-lock-keyword-face"}]]}, "json-mode": {"label": "json-mode", "preview": "generic", "faces": [["json-mode-object-name-face", "object name", {}]]}, "llama": {"label": "llama", "preview": "generic", "faces": [["llama-##-macro", "## macro", {"inherit": "font-lock-function-call-face"}], ["llama-deleted-argument", "deleted argument", {"box": {"style": "line", "width": 1, "color": "#ff0000"}}], ["llama-llama-macro", "llama macro", {"inherit": "font-lock-keyword-face"}], ["llama-mandatory-argument", "mandatory argument", {"inherit": "font-lock-variable-use-face"}], ["llama-optional-argument", "optional argument", {"inherit": "font-lock-type-face"}]]}, "lv": {"label": "lv", "preview": "generic", "faces": [["lv-separator", "separator", {"bg": "#cccccc"}]]}, "magit-section": {"label": "magit-section", "preview": "generic", "faces": [["magit-left-margin", "magit left margin", {"inherit": "default"}], ["magit-section-child-count", "child count", {}], ["magit-section-heading", "heading", {"fg": "#8b6508", "weight": "bold", "extend": true}], ["magit-section-heading-selection", "heading selection", {"fg": "#8b4c39", "extend": true}], ["magit-section-highlight", "highlight", {"bg": "#f2f2f2", "extend": true}], ["magit-section-secondary-heading", "secondary heading", {"weight": "bold", "extend": true}]]}, "malyon": {"label": "malyon", "preview": "generic", "faces": [["malyon-face-bold", "face bold", {"inherit": "bold"}], ["malyon-face-error", "face error", {"inherit": "error"}], ["malyon-face-italic", "face italic", {"inherit": "italic"}], ["malyon-face-plain", "face plain", {"inherit": "default"}], ["malyon-face-reverse", "face reverse", {"inverse": true, "inherit": "default"}]]}, "marginalia": {"label": "marginalia", "preview": "generic", "faces": [["marginalia-archive", "archive", {"inherit": "warning"}], ["marginalia-char", "char", {"inherit": "marginalia-key"}], ["marginalia-date", "date", {"inherit": "marginalia-key"}], ["marginalia-documentation", "documentation", {"inherit": "completions-annotations"}], ["marginalia-file-name", "file name", {"inherit": "marginalia-documentation"}], ["marginalia-file-owner", "file owner", {"inherit": "font-lock-preprocessor-face"}], ["marginalia-file-priv-dir", "file priv dir", {"inherit": "font-lock-keyword-face"}], ["marginalia-file-priv-exec", "file priv exec", {"inherit": "font-lock-function-name-face"}], ["marginalia-file-priv-link", "file priv link", {"inherit": "font-lock-keyword-face"}], ["marginalia-file-priv-no", "file priv no", {"inherit": "shadow"}], ["marginalia-file-priv-other", "file priv other", {"inherit": "font-lock-constant-face"}], ["marginalia-file-priv-rare", "file priv rare", {"inherit": "font-lock-variable-name-face"}], ["marginalia-file-priv-read", "file priv read", {"inherit": "font-lock-type-face"}], ["marginalia-file-priv-write", "file priv write", {"inherit": "font-lock-builtin-face"}], ["marginalia-function", "function", {"inherit": "font-lock-function-name-face"}], ["marginalia-installed", "installed", {"inherit": "success"}], ["marginalia-key", "key", {"inherit": "font-lock-keyword-face"}], ["marginalia-lighter", "lighter", {"inherit": "marginalia-size"}], ["marginalia-list", "list", {"inherit": "font-lock-constant-face"}], ["marginalia-mode", "mode", {"inherit": "marginalia-key"}], ["marginalia-modified", "modified", {"inherit": "font-lock-negation-char-face"}], ["marginalia-null", "null", {"inherit": "font-lock-comment-face"}], ["marginalia-number", "number", {"inherit": "font-lock-constant-face"}], ["marginalia-off", "off", {"inherit": "error"}], ["marginalia-on", "on", {"inherit": "success"}], ["marginalia-size", "size", {"inherit": "marginalia-number"}], ["marginalia-string", "string", {"inherit": "font-lock-string-face"}], ["marginalia-symbol", "symbol", {"inherit": "font-lock-type-face"}], ["marginalia-true", "true", {"inherit": "font-lock-builtin-face"}], ["marginalia-type", "type", {"inherit": "marginalia-key"}], ["marginalia-value", "value", {"inherit": "marginalia-key"}], ["marginalia-version", "version", {"inherit": "marginalia-number"}]]}, "markdown-mode": {"label": "markdown-mode", "preview": "markdown", "faces": [["markdown-blockquote-face", "markdown blockquote", {"inherit": "font-lock-doc-face"}], ["markdown-bold-face", "markdown bold", {"inherit": "bold"}], ["markdown-code-face", "markdown code", {"inherit": "fixed-pitch"}], ["markdown-comment-face", "markdown comment", {"inherit": "font-lock-comment-face"}], ["markdown-footnote-marker-face", "markdown footnote marker", {"inherit": "markdown-markup-face"}], ["markdown-footnote-text-face", "markdown footnote text", {"inherit": "font-lock-comment-face"}], ["markdown-gfm-checkbox-face", "markdown gfm checkbox", {"inherit": "font-lock-builtin-face"}], ["markdown-header-delimiter-face", "markdown header delimiter", {"inherit": "markdown-markup-face"}], ["markdown-header-face", "markdown header", {"weight": "bold", "inherit": ["font-lock-function-name-face"]}], ["markdown-header-face-1", "markdown header 1", {"inherit": "markdown-header-face"}], ["markdown-header-face-2", "markdown header 2", {"inherit": "markdown-header-face"}], ["markdown-header-face-3", "markdown header 3", {"inherit": "markdown-header-face"}], ["markdown-header-face-4", "markdown header 4", {"inherit": "markdown-header-face"}], ["markdown-header-face-5", "markdown header 5", {"inherit": "markdown-header-face"}], ["markdown-header-face-6", "markdown header 6", {"inherit": "markdown-header-face"}], ["markdown-header-rule-face", "markdown header rule", {"inherit": "markdown-markup-face"}], ["markdown-highlight-face", "markdown highlight", {"inherit": "highlight"}], ["markdown-highlighting-face", "markdown highlighting", {"fg": "#000000", "bg": "#ffff00"}], ["markdown-hr-face", "markdown hr", {"inherit": "markdown-markup-face"}], ["markdown-html-attr-name-face", "markdown html attr name", {"inherit": "font-lock-variable-name-face"}], ["markdown-html-attr-value-face", "markdown html attr value", {"inherit": "font-lock-string-face"}], ["markdown-html-entity-face", "markdown html entity", {"inherit": "font-lock-variable-name-face"}], ["markdown-html-tag-delimiter-face", "markdown html tag delimiter", {"inherit": "markdown-markup-face"}], ["markdown-html-tag-name-face", "markdown html tag name", {"inherit": "font-lock-type-face"}], ["markdown-inline-code-face", "markdown inline code", {"inherit": ["markdown-code-face", "font-lock-constant-face"]}], ["markdown-italic-face", "markdown italic", {"inherit": "italic"}], ["markdown-language-info-face", "markdown language info", {"inherit": "font-lock-string-face"}], ["markdown-language-keyword-face", "markdown language keyword", {"inherit": "font-lock-type-face"}], ["markdown-line-break-face", "markdown line break", {"underline": {"style": "line", "color": null}, "inherit": "font-lock-constant-face"}], ["markdown-link-face", "markdown link", {"inherit": "link"}], ["markdown-link-title-face", "markdown link title", {"inherit": "font-lock-comment-face"}], ["markdown-list-face", "markdown list", {"inherit": "markdown-markup-face"}], ["markdown-markup-face", "markdown markup", {"inherit": "shadow"}], ["markdown-math-face", "markdown math", {"inherit": "font-lock-string-face"}], ["markdown-metadata-key-face", "markdown metadata key", {"inherit": "font-lock-variable-name-face"}], ["markdown-metadata-value-face", "markdown metadata value", {"inherit": "font-lock-string-face"}], ["markdown-missing-link-face", "markdown missing link", {"inherit": "font-lock-warning-face"}], ["markdown-plain-url-face", "markdown plain url", {"inherit": "markdown-link-face"}], ["markdown-pre-face", "markdown pre", {"inherit": ["markdown-code-face", "font-lock-constant-face"]}], ["markdown-reference-face", "markdown reference", {"inherit": "markdown-markup-face"}], ["markdown-strike-through-face", "markdown strike through", {"strike": {"color": null}}], ["markdown-table-face", "markdown table", {"inherit": ["markdown-code-face"]}], ["markdown-url-face", "markdown url", {"inherit": "font-lock-string-face"}]]}, "nerd-icons-completion": {"label": "nerd-icons-completion", "preview": "generic", "faces": [["nerd-icons-completion-dir-face", "dir", {}]]}, "orderless": {"label": "orderless", "preview": "generic", "faces": [["orderless-match-face-0", "match 0", {"fg": "#223fbf", "weight": "bold"}], ["orderless-match-face-1", "match 1", {"fg": "#8f0075", "weight": "bold"}], ["orderless-match-face-2", "match 2", {"fg": "#145a00", "weight": "bold"}], ["orderless-match-face-3", "match 3", {"fg": "#804000", "weight": "bold"}]]}, "org-roam": {"label": "org-roam", "preview": "generic", "faces": [["org-roam-dailies-calendar-note", "dailies calendar note", {"underline": {"style": "line", "color": null}, "inherit": ["org-link"]}], ["org-roam-dim", "dim", {"fg": "#999999"}], ["org-roam-header-line", "header line", {"fg": "#8b6508", "weight": "bold", "extend": true}], ["org-roam-olp", "olp", {"fg": "#999999"}], ["org-roam-preview-heading", "preview heading", {"fg": "#4d4d4d", "bg": "#cccccc", "extend": true}], ["org-roam-preview-heading-highlight", "preview heading highlight", {"fg": "#4d4d4d", "bg": "#bfbfbf", "extend": true}], ["org-roam-preview-heading-selection", "preview heading selection", {"fg": "#8b4c39", "extend": true, "inherit": "org-roam-preview-heading-highlight"}], ["org-roam-preview-region", "preview region", {"inherit": "bold"}], ["org-roam-title", "title", {"weight": "bold"}]]}, "org-superstar": {"label": "org-superstar", "preview": "generic", "faces": [["org-superstar-first", "first", {"inherit": "org-warning"}], ["org-superstar-header-bullet", "header bullet", {}], ["org-superstar-item", "item", {"inherit": "default"}], ["org-superstar-leading", "leading", {"fg": "#bebebe", "inherit": "default"}]]}, "prescient": {"label": "prescient", "preview": "generic", "faces": [["prescient-primary-highlight", "primary highlight", {"weight": "bold"}], ["prescient-secondary-highlight", "secondary highlight", {"underline": {"style": "line", "color": null}, "inherit": "prescient-primary-highlight"}]]}, "rainbow-delimiters": {"label": "rainbow-delimiters", "preview": "generic", "faces": [["rainbow-delimiters-base-error-face", "base error", {"fg": "#88090b", "inherit": "rainbow-delimiters-base-face"}], ["rainbow-delimiters-base-face", "base", {"inherit": "unspecified"}], ["rainbow-delimiters-depth-1-face", "depth 1", {"fg": "#707183", "inherit": "rainbow-delimiters-base-face"}], ["rainbow-delimiters-depth-2-face", "depth 2", {"fg": "#7388d6", "inherit": "rainbow-delimiters-base-face"}], ["rainbow-delimiters-depth-3-face", "depth 3", {"fg": "#909183", "inherit": "rainbow-delimiters-base-face"}], ["rainbow-delimiters-depth-4-face", "depth 4", {"fg": "#709870", "inherit": "rainbow-delimiters-base-face"}], ["rainbow-delimiters-depth-5-face", "depth 5", {"fg": "#907373", "inherit": "rainbow-delimiters-base-face"}], ["rainbow-delimiters-depth-6-face", "depth 6", {"fg": "#6276ba", "inherit": "rainbow-delimiters-base-face"}], ["rainbow-delimiters-depth-7-face", "depth 7", {"fg": "#858580", "inherit": "rainbow-delimiters-base-face"}], ["rainbow-delimiters-depth-8-face", "depth 8", {"fg": "#80a880", "inherit": "rainbow-delimiters-base-face"}], ["rainbow-delimiters-depth-9-face", "depth 9", {"fg": "#887070", "inherit": "rainbow-delimiters-base-face"}], ["rainbow-delimiters-mismatched-face", "mismatched", {"inherit": "rainbow-delimiters-unmatched-face"}], ["rainbow-delimiters-unmatched-face", "unmatched", {"inherit": "rainbow-delimiters-base-error-face"}]]}, "symbol-overlay": {"label": "symbol-overlay", "preview": "generic", "faces": [["symbol-overlay-default-face", "default", {"inherit": "highlight"}], ["symbol-overlay-face-1", "face 1", {"fg": "#000000", "bg": "#1e90ff"}], ["symbol-overlay-face-2", "face 2", {"fg": "#000000", "bg": "#ff69b4"}], ["symbol-overlay-face-3", "face 3", {"fg": "#000000", "bg": "#ffff00"}], ["symbol-overlay-face-4", "face 4", {"fg": "#000000", "bg": "#da70d6"}], ["symbol-overlay-face-5", "face 5", {"fg": "#000000", "bg": "#ff0000"}], ["symbol-overlay-face-6", "face 6", {"fg": "#000000", "bg": "#fa8072"}], ["symbol-overlay-face-7", "face 7", {"fg": "#000000", "bg": "#00ff7f"}], ["symbol-overlay-face-8", "face 8", {"fg": "#000000", "bg": "#40e0d0"}]]}, "tmr": {"label": "tmr", "preview": "generic", "faces": [["tmr-description", "description", {"inherit": "bold"}], ["tmr-duration", "duration", {}], ["tmr-end-time", "end time", {"inherit": "error"}], ["tmr-finished", "finished", {"inherit": "error"}], ["tmr-is-acknowledged", "is acknowledged", {"inherit": "success"}], ["tmr-must-be-acknowledged", "must be acknowledged", {"inherit": "warning"}], ["tmr-start-time", "start time", {"inherit": "success"}], ["tmr-tabulated-acknowledgement", "tabulated acknowledgement", {"inherit": "bold"}], ["tmr-tabulated-description", "tabulated description", {"inherit": "font-lock-doc-face"}], ["tmr-tabulated-end-time", "tabulated end time", {"fg": "#800040"}], ["tmr-tabulated-remaining-time", "tabulated remaining time", {"fg": "#603f00"}], ["tmr-tabulated-start-time", "tabulated start time", {"fg": "#004476"}]]}, "transient": {"label": "transient", "preview": "generic", "faces": [["transient-active-infix", "active infix", {"inherit": "highlight"}], ["transient-argument", "argument", {"weight": "bold", "inherit": "font-lock-string-face"}], ["transient-delimiter", "delimiter", {"inherit": "shadow"}], ["transient-disabled-suffix", "disabled suffix", {"fg": "#000000", "bg": "#ff0000", "weight": "bold"}], ["transient-enabled-suffix", "enabled suffix", {"fg": "#000000", "bg": "#00ff00", "weight": "bold"}], ["transient-heading", "heading", {"inherit": "font-lock-keyword-face"}], ["transient-higher-level", "higher level", {"box": {"style": "line", "width": 1, "color": "#999999"}}], ["transient-inactive-argument", "inactive argument", {"inherit": "shadow"}], ["transient-inactive-value", "inactive value", {"inherit": "shadow"}], ["transient-inapt-argument", "inapt argument", {"weight": "bold", "inherit": "shadow"}], ["transient-inapt-suffix", "inapt suffix", {"slant": "italic", "inherit": "shadow"}], ["transient-key", "key", {"inherit": "font-lock-builtin-face"}], ["transient-key-exit", "key exit", {"fg": "#aa2222", "inherit": "transient-key"}], ["transient-key-noop", "key noop", {"fg": "#cccccc", "inherit": "transient-key"}], ["transient-key-recurse", "key recurse", {"fg": "#2266ff", "inherit": "transient-key"}], ["transient-key-return", "key return", {"fg": "#aaaa11", "inherit": "transient-key"}], ["transient-key-stack", "key stack", {"fg": "#dd4488", "inherit": "transient-key"}], ["transient-key-stay", "key stay", {"fg": "#22aa22", "inherit": "transient-key"}], ["transient-mismatched-key", "mismatched key", {"box": {"style": "line", "width": 1, "color": "#ff00ff"}}], ["transient-nonstandard-key", "nonstandard key", {"box": {"style": "line", "width": 1, "color": "#00ffff"}}], ["transient-unreachable", "unreachable", {"inherit": "shadow"}], ["transient-unreachable-key", "unreachable key", {"inherit": ["shadow", "transient-key"]}], ["transient-value", "value", {"weight": "bold", "inherit": "font-lock-string-face"}]]}, "vertico": {"label": "vertico", "preview": "generic", "faces": [["vertico-current", "current", {"extend": true, "inherit": "highlight"}], ["vertico-group-separator", "group separator", {"strike": {"color": null}, "inherit": "vertico-group-title"}], ["vertico-group-title", "group title", {"slant": "italic", "inherit": "shadow"}], ["vertico-multiline", "multiline", {"inherit": "shadow"}]]}, "web-mode": {"label": "web-mode", "preview": "generic", "faces": [["web-mode-annotation-face", "annotation", {"inherit": "web-mode-comment-face"}], ["web-mode-annotation-html-face", "annotation html", {"slant": "italic", "inherit": "web-mode-annotation-face"}], ["web-mode-annotation-tag-face", "annotation tag", {"underline": {"style": "line", "color": null}, "inherit": "web-mode-annotation-face"}], ["web-mode-annotation-type-face", "annotation type", {"weight": "bold", "inherit": "web-mode-annotation-face"}], ["web-mode-annotation-value-face", "annotation value", {"slant": "italic", "inherit": "web-mode-annotation-face"}], ["web-mode-block-attr-name-face", "block attr name", {"fg": "#8fbc8f"}], ["web-mode-block-attr-value-face", "block attr value", {"fg": "#5f9ea0"}], ["web-mode-block-comment-face", "block comment", {"inherit": "web-mode-comment-face"}], ["web-mode-block-control-face", "block control", {"inherit": "font-lock-preprocessor-face"}], ["web-mode-block-delimiter-face", "block delimiter", {"inherit": "font-lock-preprocessor-face"}], ["web-mode-block-face", "block", {"bg": "#ffffe0"}], ["web-mode-block-string-face", "block string", {"inherit": "web-mode-string-face"}], ["web-mode-bold-face", "bold", {"weight": "bold"}], ["web-mode-builtin-face", "builtin", {"inherit": "font-lock-builtin-face"}], ["web-mode-comment-face", "comment", {"inherit": "font-lock-comment-face"}], ["web-mode-comment-keyword-face", "comment keyword", {"weight": "bold"}], ["web-mode-constant-face", "constant", {"inherit": "font-lock-constant-face"}], ["web-mode-css-at-rule-face", "css at rule", {"inherit": "font-lock-constant-face"}], ["web-mode-css-color-face", "css color", {"inherit": "font-lock-builtin-face"}], ["web-mode-css-comment-face", "css comment", {"inherit": "web-mode-comment-face"}], ["web-mode-css-function-face", "css function", {"inherit": "font-lock-builtin-face"}], ["web-mode-css-priority-face", "css priority", {"inherit": "font-lock-builtin-face"}], ["web-mode-css-property-name-face", "css property name", {"inherit": "font-lock-variable-name-face"}], ["web-mode-css-pseudo-class-face", "css pseudo class", {"inherit": "font-lock-builtin-face"}], ["web-mode-css-selector-class-face", "css selector class", {"inherit": "font-lock-keyword-face"}], ["web-mode-css-selector-face", "css selector", {"inherit": "font-lock-keyword-face"}], ["web-mode-css-selector-tag-face", "css selector tag", {"inherit": "font-lock-keyword-face"}], ["web-mode-css-string-face", "css string", {"inherit": "web-mode-string-face"}], ["web-mode-css-variable-face", "css variable", {"slant": "italic", "inherit": "web-mode-variable-name-face"}], ["web-mode-current-column-highlight-face", "current column highlight", {"bg": "#3e3c36"}], ["web-mode-current-element-highlight-face", "current element highlight", {"fg": "#ffffff", "bg": "#000000"}], ["web-mode-doctype-face", "doctype", {"fg": "#bebebe"}], ["web-mode-error-face", "error", {"bg": "#ff0000"}], ["web-mode-filter-face", "filter", {"inherit": "font-lock-function-name-face"}], ["web-mode-folded-face", "folded", {"underline": {"style": "line", "color": null}}], ["web-mode-function-call-face", "function call", {"inherit": "font-lock-function-name-face"}], ["web-mode-function-name-face", "function name", {"inherit": "font-lock-function-name-face"}], ["web-mode-html-attr-custom-face", "html attr custom", {"inherit": "web-mode-html-attr-name-face"}], ["web-mode-html-attr-engine-face", "html attr engine", {"inherit": "web-mode-block-delimiter-face"}], ["web-mode-html-attr-equal-face", "html attr equal", {"inherit": "web-mode-html-attr-name-face"}], ["web-mode-html-attr-name-face", "html attr name", {"fg": "#8b8989"}], ["web-mode-html-attr-value-face", "html attr value", {"inherit": "font-lock-string-face"}], ["web-mode-html-entity-face", "html entity", {"slant": "italic"}], ["web-mode-html-tag-bracket-face", "html tag bracket", {"fg": "#242424"}], ["web-mode-html-tag-custom-face", "html tag custom", {"inherit": "web-mode-html-tag-face"}], ["web-mode-html-tag-face", "html tag", {"fg": "#8b8989"}], ["web-mode-html-tag-namespaced-face", "html tag namespaced", {"inherit": "web-mode-block-control-face"}], ["web-mode-html-tag-unclosed-face", "html tag unclosed", {"underline": {"style": "line", "color": null}, "inherit": "web-mode-html-tag-face"}], ["web-mode-inlay-face", "inlay", {"bg": "#ffffe0"}], ["web-mode-interpolate-color1-face", "interpolate color1", {"inherit": "web-mode-string-face"}], ["web-mode-interpolate-color2-face", "interpolate color2", {"inherit": "web-mode-string-face"}], ["web-mode-interpolate-color3-face", "interpolate color3", {"inherit": "web-mode-string-face"}], ["web-mode-interpolate-color4-face", "interpolate color4", {"inherit": "web-mode-string-face"}], ["web-mode-italic-face", "italic", {"slant": "italic"}], ["web-mode-javascript-comment-face", "javascript comment", {"inherit": "web-mode-comment-face"}], ["web-mode-javascript-string-face", "javascript string", {"inherit": "web-mode-string-face"}], ["web-mode-json-comment-face", "json comment", {"inherit": "web-mode-comment-face"}], ["web-mode-json-context-face", "json context", {"fg": "#cd69c9"}], ["web-mode-json-key-face", "json key", {"fg": "#dda0dd"}], ["web-mode-json-string-face", "json string", {"inherit": "web-mode-string-face"}], ["web-mode-jsx-depth-1-face", "jsx depth 1", {"bg": "#000053"}], ["web-mode-jsx-depth-2-face", "jsx depth 2", {"bg": "#001970"}], ["web-mode-jsx-depth-3-face", "jsx depth 3", {"bg": "#002984"}], ["web-mode-jsx-depth-4-face", "jsx depth 4", {"bg": "#49599a"}], ["web-mode-jsx-depth-5-face", "jsx depth 5", {"bg": "#9499b7"}], ["web-mode-keyword-face", "keyword", {"inherit": "font-lock-keyword-face"}], ["web-mode-param-name-face", "param name", {"fg": "#cdc9c9"}], ["web-mode-part-comment-face", "part comment", {"inherit": "web-mode-comment-face"}], ["web-mode-part-face", "part", {"inherit": "web-mode-block-face"}], ["web-mode-part-string-face", "part string", {"inherit": "web-mode-string-face"}], ["web-mode-preprocessor-face", "preprocessor", {"inherit": "font-lock-preprocessor-face"}], ["web-mode-script-face", "script", {"inherit": "web-mode-part-face"}], ["web-mode-sql-keyword-face", "sql keyword", {"weight": "bold", "slant": "italic"}], ["web-mode-string-face", "string", {"inherit": "font-lock-string-face"}], ["web-mode-style-face", "style", {"inherit": "web-mode-part-face"}], ["web-mode-symbol-face", "symbol", {"fg": "#eeb422"}], ["web-mode-type-face", "type", {"inherit": "font-lock-type-face"}], ["web-mode-underline-face", "underline", {"underline": {"style": "line", "color": null}}], ["web-mode-variable-name-face", "variable name", {"inherit": "font-lock-variable-name-face"}], ["web-mode-warning-face", "warning", {"inherit": "font-lock-warning-face"}], ["web-mode-whitespace-face", "whitespace", {"bg": "#68228b"}]]}, "wttrin": {"label": "wttrin", "preview": "generic", "faces": [["wttrin-instructions", "instructions", {}], ["wttrin-key", "key", {}], ["wttrin-mode-line-stale", "mode line stale", {}], ["wttrin-staleness-header", "staleness header", {}]]}, "yasnippet": {"label": "yasnippet", "preview": "generic", "faces": [["yas--field-debug-face", "yas field debug", {}], ["yas-field-highlight-face", "yas field highlight", {"inherit": "region"}]]}}; const COLOR_NAMES=[["alice-blue", "#f0f8ff"], ["antique-white", "#faebd7"], ["aquamarine", "#7fffd4"], ["azure", "#f0ffff"], ["beige", "#f5f5dc"], ["bisque", "#ffe4c4"], ["black", "#000000"], ["blanched-almond", "#ffebcd"], ["blue", "#0000ff"], ["blue-violet", "#8a2be2"], ["brown", "#a52a2a"], ["burlywood", "#deb887"], ["cadet-blue", "#5f9ea0"], ["chartreuse", "#7fff00"], ["chocolate", "#d2691e"], ["coral", "#ff7f50"], ["cornflower-blue", "#6495ed"], ["cornsilk", "#fff8dc"], ["cyan", "#00ffff"], ["dark-blue", "#00008b"], ["dark-cyan", "#008b8b"], ["dark-goldenrod", "#b8860b"], ["dark-green", "#006400"], ["dark-grey", "#a9a9a9"], ["dark-khaki", "#bdb76b"], ["dark-magenta", "#8b008b"], ["dark-olive", "#556b2f"], ["dark-orange", "#ff8c00"], ["dark-orchid", "#9932cc"], ["dark-red", "#8b0000"], ["dark-salmon", "#e9967a"], ["dark-sea", "#8fbc8f"], ["dark-slate", "#2f4f4f"], ["dark-slate", "#483d8b"], ["dark-turquoise", "#00ced1"], ["dark-violet", "#9400d3"], ["deep-pink", "#ff1493"], ["deep-sky", "#00bfff"], ["dim-gray", "#696969"], ["dodger-blue", "#1e90ff"], ["firebrick", "#b22222"], ["floral-white", "#fffaf0"], ["forest-green", "#228b22"], ["gainsboro", "#dcdcdc"], ["ghost-white", "#f8f8ff"], ["gold", "#ffd700"], ["goldenrod", "#daa520"], ["gray", "#bebebe"], ["green", "#00ff00"], ["green-yellow", "#adff2f"], ["honeydew", "#f0fff0"], ["hot-pink", "#ff69b4"], ["indian-red", "#cd5c5c"], ["ivory", "#fffff0"], ["khaki", "#f0e68c"], ["lavender", "#e6e6fa"], ["lavender-blush", "#fff0f5"], ["lawn-green", "#7cfc00"], ["lemon-chiffon", "#fffacd"], ["light-blue", "#add8e6"], ["light-coral", "#f08080"], ["light-cyan", "#e0ffff"], ["light-goldenrod", "#eedd82"], ["light-goldenrod", "#fafad2"], ["light-green", "#90ee90"], ["light-grey", "#d3d3d3"], ["light-pink", "#ffb6c1"], ["light-salmon", "#ffa07a"], ["light-sea", "#20b2aa"], ["light-sky", "#87cefa"], ["light-slate", "#778899"], ["light-slate", "#8470ff"], ["light-steel", "#b0c4de"], ["light-yellow", "#ffffe0"], ["lime-green", "#32cd32"], ["linen", "#faf0e6"], ["magenta", "#ff00ff"], ["maroon", "#b03060"], ["medium-aquamarine", "#66cdaa"], ["medium-blue", "#0000cd"], ["medium-orchid", "#ba55d3"], ["medium-purple", "#9370db"], ["medium-sea", "#3cb371"], ["medium-slate", "#7b68ee"], ["medium-spring", "#00fa9a"], ["medium-turquoise", "#48d1cc"], ["medium-violet", "#c71585"], ["midnight-blue", "#191970"], ["mint-cream", "#f5fffa"], ["misty-rose", "#ffe4e1"], ["moccasin", "#ffe4b5"], ["navajo-white", "#ffdead"], ["navy", "#000080"], ["old-lace", "#fdf5e6"], ["olive-drab", "#6b8e23"], ["orange", "#ffa500"], ["orange-red", "#ff4500"], ["orchid", "#da70d6"], ["pale-goldenrod", "#eee8aa"], ["pale-green", "#98fb98"], ["pale-turquoise", "#afeeee"], ["pale-violet", "#db7093"], ["papaya-whip", "#ffefd5"], ["peach-puff", "#ffdab9"], ["peru", "#cd853f"], ["pink", "#ffc0cb"], ["plum", "#dda0dd"], ["powder-blue", "#b0e0e6"], ["purple", "#a020f0"], ["red", "#ff0000"], ["rosy-brown", "#bc8f8f"], ["royal-blue", "#4169e1"], ["saddle-brown", "#8b4513"], ["salmon", "#fa8072"], ["sandy-brown", "#f4a460"], ["sea-green", "#2e8b57"], ["seashell", "#fff5ee"], ["sienna", "#a0522d"], ["sky-blue", "#87ceeb"], ["slate-blue", "#6a5acd"], ["slate-gray", "#708090"], ["snow", "#fffafa"], ["spring-green", "#00ff7f"], ["steel-blue", "#4682b4"], ["tan", "#d2b48c"], ["thistle", "#d8bfd8"], ["tomato", "#ff6347"], ["turquoise", "#40e0d0"], ["violet", "#ee82ee"], ["violet-red", "#d02090"], ["wheat", "#f5deb3"], ["white", "#ffffff"], ["white-smoke", "#f5f5f5"], ["yellow", "#ffff00"], ["yellow-green", "#9acd32"]]; const FACE_DOCS={"flyspell-duplicate": "Flyspell face for words that appear twice in a row.", "flyspell-incorrect": "Flyspell face for misspelled words.", "hl-line": "Default face for highlighting the current line in Hl-Line mode.", "ghostel-default": "Base face used to derive ghostel terminal default fg/bg colors.", "ghostel-fake-cursor-box": "Face for the solid hint cursor drawn for box-style cursors.", "ghostel-fake-cursor": "Face for the hollow hint cursor drawn in copy and Emacs modes.", "ghostel-color-bright-white": "Face used to render bright white color code.", "ghostel-color-bright-cyan": "Face used to render bright cyan color code.", "ghostel-color-bright-magenta": "Face used to render bright magenta color code.", "ghostel-color-bright-blue": "Face used to render bright blue color code.", "ghostel-color-bright-yellow": "Face used to render bright yellow color code.", "ghostel-color-bright-green": "Face used to render bright green color code.", "ghostel-color-bright-red": "Face used to render bright red color code.", "ghostel-color-bright-black": "Face used to render bright black color code.", "ghostel-color-white": "Face used to render white color code.", "ghostel-color-cyan": "Face used to render cyan color code.", "ghostel-color-magenta": "Face used to render magenta color code.", "ghostel-color-blue": "Face used to render blue color code.", "ghostel-color-yellow": "Face used to render yellow color code.", "ghostel-color-green": "Face used to render green color code.", "ghostel-color-red": "Face used to render red color code.", "ghostel-color-black": "Face used to render black color code.", "apropos-misc-button": "Button face indicating a miscellaneous object type in Apropos.", "apropos-user-option-button": "Button face indicating a user option in Apropos.", "apropos-variable-button": "Button face indicating a variable in Apropos.", "apropos-function-button": "Button face indicating a function, macro, or command in Apropos.", "apropos-button": "Face for buttons that indicate a face in Apropos.", "apropos-property": "Face for property name in Apropos output, or nil for none.", "apropos-keybinding": "Face for lists of keybinding in Apropos output.", "apropos-symbol": "Face for the symbol name in Apropos output.", "hl-todo-flymake-type": "Face used for the Flymake diagnostics type \u2018hl-todo-flymake\u2019.", "hl-todo": "Base face used to highlight TODO and similar keywords.", "org-roam-dailies-calendar-note": "Face for dates with a daily-note in the calendar.", "org-roam-dim": "Face for the dimmer part of the widgets.", "org-roam-preview-region": "Face used by \u2018org-roam-highlight-preview-region-using-face\u2019.", "org-roam-preview-heading-selection": "Face for selected preview headings.", "org-roam-preview-heading-highlight": "Face for current preview headings.", "org-roam-preview-heading": "Face for preview headings.", "org-roam-olp": "Face for the OLP of the node.", "org-roam-title": "Face for Org-roam titles.", "org-roam-header-line": "Face for the \u2018header-line\u2019 in some Org-roam modes.", "malyon-face-reverse": "Face for reverse-video text.", "malyon-face-italic": "Italic face for game text.", "malyon-face-error": "Face for game errors.", "malyon-face-bold": "Bold face for game text.", "malyon-face-plain": "Basic face for game text.", "twentyfortyeight-face-2048": "Face for the tile 2048.", "twentyfortyeight-face-1024": "Face for the tile 1024.", "twentyfortyeight-face-512": "Face for the tile 512.", "twentyfortyeight-face-256": "Face for the tile 256.", "twentyfortyeight-face-128": "Face for the tile 128.", "twentyfortyeight-face-64": "Face for the tile 64.", "twentyfortyeight-face-32": "Face for the tile 32.", "twentyfortyeight-face-16": "Face for the tile 16.", "twentyfortyeight-face-8": "Face for the tile 8.", "twentyfortyeight-face-4": "Face for the tile 4.", "twentyfortyeight-face-2": "Face for the tile 2.", "tmr-mode-line-urgent": "Face for timers that will expire in the next 30 seconds.", "tmr-mode-line-soon": "Face for timers that will expire in the next 2 minutes.", "tmr-mode-line-active": "Face for active timers in the mode-line.", "tmr-tabulated-description": "Description of timer in the \u2018tmr-tabulated-view\u2019.", "tmr-tabulated-acknowledgement": "Acknowledgement indicator in the \u2018tmr-tabulated-view\u2019.", "tmr-tabulated-paused": "Face for styling the description of a paused timer.", "tmr-tabulated-remaining-time": "Remaining time in the \u2018tmr-tabulated-view\u2019.", "tmr-tabulated-end-time": "End time in the \u2018tmr-tabulated-view\u2019.", "tmr-tabulated-start-time": "Start time in the \u2018tmr-tabulated-view\u2019.", "tmr-paused": "Face for styling the description of a paused timer.", "tmr-finished": "Face for styling the description of a finished timer.", "tmr-must-be-acknowledged": "Face for styling the acknowledgment confirmation.", "tmr-is-acknowledged": "Face for styling the acknowledgment confirmation.", "tmr-end-time": "Face for styling the start time of a timer.", "tmr-start-time": "Face for styling the start time of a timer.", "tmr-description": "Face for styling the description of a timer.", "tmr-duration": "Face for styling the duration of a timer.", "magit-blame-date": "Face used for dates when blaming.", "magit-blame-name": "Face used for author and committer names when blaming.", "magit-blame-hash": "Face used for commit hashes when blaming.", "magit-blame-summary": "Face used for commit summaries when blaming.", "magit-blame-heading": "Face used for blame headings by default when blaming.", "magit-blame-dimmed": "Face used for the blame margin in some cases when blaming.", "magit-blame-margin": "Face used for the blame margin by default when blaming.", "magit-blame-highlight": "Face used for highlighting when blaming.", "magit-reflog-other": "Face for other commands in reflogs.", "magit-reflog-remote": "Face for pull and clone commands in reflogs.", "magit-reflog-cherry-pick": "Face for cherry-pick commands in reflogs.", "magit-reflog-rebase": "Face for rebase commands in reflogs.", "magit-reflog-reset": "Face for reset commands in reflogs.", "magit-reflog-checkout": "Face for checkout commands in reflogs.", "magit-reflog-merge": "Face for merge, checkout and branch commands in reflogs.", "magit-reflog-amend": "Face for amend commands in reflogs.", "magit-reflog-commit": "Face for commit commands in reflogs.", "magit-bisect-bad": "Face for bad bisect revisions.", "magit-bisect-skip": "Face for skipped bisect revisions.", "magit-bisect-good": "Face for good bisect revisions.", "magit-sequence-exec": "Face used in sequence sections.", "magit-sequence-onto": "Face used in sequence sections.", "magit-sequence-done": "Face used in sequence sections.", "magit-sequence-drop": "Face used in sequence sections.", "magit-sequence-head": "Face used in sequence sections.", "magit-sequence-part": "Face used in sequence sections.", "magit-sequence-stop": "Face used in sequence sections.", "magit-sequence-pick": "Face used in sequence sections.", "magit-filename": "Face for filenames.", "magit-cherry-equivalent": "Face for equivalent cherry commits.", "magit-cherry-unmatched": "Face for unmatched cherry commits.", "magit-signature-error": "Face for signatures that cannot be checked (e.g., missing key).", "magit-signature-revoked": "Face for signatures made by a revoked key.", "magit-signature-expired-key": "Face for signatures made by an expired key.", "magit-signature-expired": "Face for signatures that have expired.", "magit-signature-untrusted": "Face for good untrusted signatures.", "magit-signature-bad": "Face for bad signatures.", "magit-signature-good": "Face for good signatures.", "magit-keyword-squash": "Face for squash! and similar keywords in commit messages.", "magit-keyword": "Face for parts of commit messages inside brackets.", "magit-refname-pullreq": "Face for pullreq refnames.", "magit-refname-wip": "Face for wip refnames.", "magit-refname-stash": "Face for stash refnames.", "magit-refname": "Face for refnames without a dedicated face.", "magit-head": "Face for the symbolic ref \u2018HEAD\u2019.", "magit-branch-warning": "Face for warning about (missing) branch.", "magit-branch-upstream": "Face for upstream branch.", "magit-branch-current": "Face for current branch.", "magit-branch-local": "Face for local branches.", "magit-branch-remote-head": "Face for current branch.", "magit-branch-remote": "Face for remote branch head labels shown in log buffer.", "magit-tag": "Face for tag labels shown in log buffer.", "magit-hash": "Face for the commit object name in the log output.", "magit-dimmed": "Face for text that shouldn\u2019t stand out.", "magit-header-line-key": "Face for keys in the \u2018header-line\u2019.", "magit-header-line": "Face for the \u2018header-line\u2019 in some Magit modes.", "magit-header-line-log-select": "Face for the \u2018header-line\u2019 in \u2018magit-log-select-mode\u2019.", "magit-log-date": "Face for the date part of the log output.", "magit-log-author": "Face for the author part of the log output.", "magit-log-graph": "Face for the graph part of the log output.", "magit-diffstat-removed": "Face for removal indicator in diffstat.", "magit-diffstat-added": "Face for addition indicator in diffstat.", "magit-diff-whitespace-warning": "Face for highlighting whitespace errors added lines.", "magit-diff-context-highlight": "Face for lines in the current context in a diff.", "magit-diff-their-highlight": "Face for lines in a diff for their side in a conflict.", "magit-diff-base-highlight": "Face for lines in a diff for the base side in a conflict.", "magit-diff-our-highlight": "Face for lines in a diff for our side in a conflict.", "magit-diff-removed-highlight": "Face for lines in a diff that have been removed.", "magit-diff-added-highlight": "Face for lines in a diff that have been added.", "magit-diff-context": "Face for lines in a diff that are unchanged.", "magit-diff-their": "Face for lines in a diff for their side in a conflict.", "magit-diff-base": "Face for lines in a diff for the base side in a conflict.", "magit-diff-our": "Face for lines in a diff for our side in a conflict.", "magit-diff-removed": "Face for lines in a diff that have been removed.", "magit-diff-added": "Face for lines in a diff that have been added.", "magit-diff-conflict-heading": "Face for conflict markers.", "magit-diff-lines-boundary": "Face for boundary of marked lines in diff hunk.", "magit-diff-lines-heading": "Face for diff hunk heading when lines are marked.", "magit-diff-revision-summary-highlight": "Face for highlighted commit message summaries.", "magit-diff-revision-summary": "Face for commit message summaries.", "magit-diff-conflict-heading-highlight": "Face for conflict markers.", "magit-diff-hunk-region": "Face used by \u2018magit-diff-highlight-hunk-region-using-face\u2019.", "magit-diff-hunk-heading-selection": "Face for selected diff hunk headings.", "magit-diff-hunk-heading-highlight": "Face for current diff hunk headings.", "magit-diff-hunk-heading": "Face for diff hunk headings.", "magit-diff-file-heading-selection": "Face for selected diff file headings.", "magit-diff-file-heading-highlight": "Face for current diff file headings.", "magit-diff-file-heading": "Face for diff file headings.", "smerge-refined-added": "Face used for added characters shown by \u2018smerge-refine\u2019.", "smerge-refined-removed": "Face used for removed characters shown by \u2018smerge-refine\u2019.", "smerge-refined-changed": "Face used for char-based changes shown by \u2018smerge-refine\u2019.", "smerge-markers": "Face for the conflict markers.", "smerge-base": "Face for the base code.", "smerge-lower": "Face for the \u2018lower\u2019 version of a conflict.", "smerge-upper": "Face for the \u2018upper\u2019 version of a conflict.", "git-commit-comment-action": "Face used for actions in commit message comments.", "git-commit-comment-file": "Face used for file names in commit message comments.", "git-commit-comment-heading": "Face used for headings in commit message comments.", "git-commit-comment-detached": "Face used for detached \u2018HEAD\u2019 in commit message comments.", "git-commit-comment-branch-remote": "Face used for names of remote branches in commit message comments.", "git-commit-comment-branch-local": "Face used for names of local branches in commit message comments.", "git-commit-trailer-value": "Face used for Git trailer values in commit messages.", "git-commit-trailer-token": "Face used for Git trailer tokens in commit messages.", "git-commit-keyword": "Face used for keywords in commit messages.", "git-commit-nonempty-second-line": "Face used for non-whitespace on the second line of commit messages.", "git-commit-overlong-summary": "Face used for the tail of overlong commit message summaries.", "git-commit-summary": "Face used for the summary in commit messages.", "log-edit-unknown-header": "Face for unknown headers in \u2018log-edit-mode\u2019 buffers.", "log-edit-header": "Face for the headers in \u2018log-edit-mode\u2019 buffers.", "log-edit-headers-separator": "Face for the separator line in \u2018log-edit-mode\u2019 buffers.", "log-edit-summary": "Face for the summary in \u2018log-edit-mode\u2019 buffers.", "change-log-acknowledgment": "Face for highlighting acknowledgments.", "change-log-function": "Face for highlighting items of the form \u2018<....>\u2019.", "change-log-conditionals": "Face for highlighting conditionals of the form \u2018[...]\u2019.", "change-log-list": "Face for highlighting parenthesized lists of functions or variables.", "change-log-file": "Face for highlighting file names.", "change-log-email": "Face for highlighting author email addresses.", "change-log-name": "Face for highlighting author names.", "change-log-date": "Face used to highlight dates in date lines.", "magit-mode-line-process-error": "Face for \u2018mode-line-process\u2019 error status.", "magit-mode-line-process": "Face for \u2018mode-line-process\u2019 status when Git is running for side-effects.", "magit-process-ng": "Face for non-zero exit-status.", "magit-process-ok": "Face for zero exit-status.", "which-func": "Face used to highlight mode line function names.", "magit-left-margin": "Face used for the left margin.", "magit-section-child-count": "Face used for child counts at the end of some section headings.", "magit-section-heading-selection": "Face for selected section headings.", "magit-section-secondary-heading": "Face for section headings of some secondary headings.", "magit-section-heading": "Face for section headings.", "magit-section-highlight": "Face for highlighting the current section.", "llama-deleted-argument": "Face used for deleted arguments \u2018_%1\u2019...\u2018_%9\u2019, \u2018_&1\u2019...\u2018_&9\u2019 and \u2018_&*\u2019.", "llama-optional-argument": "Face used for optional arguments \u2018&1\u2019 through \u2018&9\u2019, \u2018&\u2019 and \u2018&*\u2019.", "llama-mandatory-argument": "Face used for mandatory arguments \u2018%1\u2019 through \u2018%9\u2019 and \u2018%\u2019.", "llama-llama-macro": "Face used for the name of the \u2018llama\u2019 macro.", "llama-##-macro": "Face used for the name of the \u2018##\u2019 macro.", "table-cell": "Face used for table cell contents.", "which-key-docstring-face": "Face for docstrings.", "which-key-special-key-face": "Face for special keys (SPC, TAB, RET).", "which-key-group-description-face": "Face for the key description when it is a group or prefix.", "which-key-highlighted-command-face": "Default face for highlighted command descriptions.", "which-key-local-map-description-face": "Face for the key description when it is found in \u2018current-local-map\u2019.", "which-key-command-description-face": "Face for the key description when it is a command.", "which-key-note-face": "Face for notes or hints occasionally provided.", "which-key-separator-face": "Face for the separator (default separator is an arrow).", "which-key-key-face": "Face for which-key keys.", "org-superstar-first": "Face used to display the first bullet of an inline task.", "org-superstar-ordered-item": "Face used to display ordered list item bullets.", "org-superstar-item": "Face used to display prettified item bullets.", "org-superstar-header-bullet": "Face containing distinguishing features headline bullets.", "org-superstar-leading": "Face used to display prettified leading stars in a headline.", "org-indent": "Face for outline indentation.", "company-box-numbers": "company-box-numbers is an alias for the face `company-tooltip'.", "company-box-scrollbar": "Face used for the scrollbar.", "company-box-background": "company-box-background is an alias for the face `company-tooltip'.", "company-box-selection": "company-box-selection is an alias for the face `company-tooltip-selection'.", "company-box-annotation": "company-box-annotation is an alias for the face `company-tooltip-annotation'.", "company-box-candidate": "company-box-candidate is an alias for the face `company-tooltip'.", "makefile-makepp-perl": "Face to use for additionally highlighting Perl code in Font-Lock mode.", "makefile-shell": "Face to use for additionally highlighting Shell commands in Font-Lock mode.", "makefile-targets": "Face to use for additionally highlighting rule targets in Font-Lock mode.", "makefile-space": "Face to use for highlighting leading spaces in Font-Lock mode.", "grep-heading": "Face of headings when \u2018grep-use-headings\u2019 is non-nil.", "ibuffer-locked-buffer": "Face used for locked buffers in Ibuffer.", "org-drill-hidden-cloze-face": "The face used to hide the contents of cloze phrases.", "org-drill-visible-cloze-hint-face": "The face used to hide the contents of cloze phrases.", "org-drill-visible-cloze-face": "The face used to hide the contents of cloze phrases.", "alert-trivial-face": "Trivial alert face.", "alert-low-face": "Low alert face.", "alert-normal-face": "Normal alert face.", "alert-moderate-face": "Moderate alert face.", "alert-high-face": "High alert face.", "alert-urgent-face": "Urgent alert face.", "org-faces-priority-d-dim": "Dimmed [#D] priority cookie for non-selected windows.", "org-faces-priority-c-dim": "Dimmed [#C] priority cookie for non-selected windows.", "org-faces-priority-b-dim": "Dimmed [#B] priority cookie for non-selected windows.", "org-faces-priority-a-dim": "Dimmed [#A] priority cookie for non-selected windows.", "org-faces-cancelled-dim": "Dimmed CANCELLED keyword for non-selected windows.", "org-faces-done-dim": "Dimmed DONE keyword for non-selected windows.", "org-faces-failed-dim": "Dimmed FAILED keyword for non-selected windows.", "org-faces-delegated-dim": "Dimmed DELEGATED keyword for non-selected windows.", "org-faces-stalled-dim": "Dimmed STALLED keyword for non-selected windows.", "org-faces-verify-dim": "Dimmed VERIFY keyword for non-selected windows.", "org-faces-waiting-dim": "Dimmed WAITING keyword for non-selected windows.", "org-faces-doing-dim": "Dimmed DOING keyword for non-selected windows.", "org-faces-project-dim": "Dimmed PROJECT keyword for non-selected windows.", "org-faces-todo-dim": "Dimmed TODO keyword for non-selected windows.", "org-faces-priority-d": "Face for the [#D] priority cookie.", "org-faces-priority-c": "Face for the [#C] priority cookie.", "org-faces-priority-b": "Face for the [#B] priority cookie.", "org-faces-priority-a": "Face for the [#A] priority cookie.", "org-faces-cancelled": "Face for the CANCELLED keyword.", "org-faces-done": "Face for the DONE keyword.", "org-faces-failed": "Face for the FAILED keyword.", "org-faces-delegated": "Face for the DELEGATED keyword.", "org-faces-stalled": "Face for the STALLED keyword.", "org-faces-verify": "Face for the VERIFY keyword.", "org-faces-waiting": "Face for the WAITING keyword.", "org-faces-doing": "Face for the DOING keyword.", "org-faces-project": "Face for the PROJECT keyword.", "org-faces-todo": "Face for the TODO keyword.", "eww-valid-certificate": "Face for web pages with valid certificates.", "eww-invalid-certificate": "Face for web pages with invalid certificates.", "eww-form-textarea": "Face for eww textarea inputs.", "eww-form-text": "Face for eww text inputs.", "eww-form-select": "Face for eww buffer buttons.", "eww-form-checkbox": "Face for eww buffer buttons.", "eww-form-file": "Face for eww buffer buttons.", "eww-form-submit": "Face for eww buffer buttons.", "gnus-header-content": "Face used for displaying header content.", "gnus-header-name": "Face used for displaying header names.", "gnus-header-newsgroups": "Face used for displaying newsgroups headers.", "gnus-header-subject": "Face used for displaying subject headers.", "gnus-header-from": "Face used for displaying from headers.", "gnus-header": "Base face used for all Gnus header faces.", "gnus-signature": "Face used for highlighting a signature in the article buffer.", "gnus-button": "Face used for highlighting a button in the article buffer.", "gnus-emphasis-highlight-words": "Face used for displaying highlighted words.", "gnus-emphasis-strikethru": "Face used for displaying strike-through text (-word-).", "gnus-emphasis-underline-bold-italic": "Face used for displaying underlined bold italic emphasized text.", "gnus-emphasis-bold-italic": "Face used for displaying bold italic emphasized text (/*word*/).", "gnus-emphasis-underline-italic": "Face used for displaying underlined italic emphasized text (_/word/_).", "gnus-emphasis-underline-bold": "Face used for displaying underlined bold emphasized text (_*word*_).", "gnus-emphasis-underline": "Face used for displaying underlined emphasized text (_word_).", "gnus-emphasis-italic": "Face used for displaying italic emphasized text (/word/).", "gnus-emphasis-bold": "Face used for displaying strong emphasized text (*word*).", "mm-uu-extract": "Face for extracted buffers.", "shr-sliced-image": "Face used for sliced images.", "shr-mark": "Face used for <mark> elements.", "shr-code": "Face used for rendering <code> blocks.", "shr-h6": "Face for <h6> elements.", "shr-h5": "Face for <h5> elements.", "shr-h4": "Face for <h4> elements.", "shr-h3": "Face for <h3> elements.", "shr-h2": "Face for <h2> elements.", "shr-h1": "Face for <h1> elements.", "shr-sup": "Face for <sup> and <sub> elements.", "shr-abbreviation": "Face for <abbr> elements.", "shr-selected-link": "Temporary face for externally visited link elements.", "shr-link": "Face for link elements.", "shr-strike-through": "Face for <s> elements.", "shr-text": "Face used for rendering text.", "message-signature-separator": "Face used for displaying the signature separator.", "message-mml": "Face used for displaying MML.", "message-cited-text-4": "Face used for displaying 4th-level cited text.", "message-cited-text-3": "Face used for displaying 3rd-level cited text.", "message-cited-text-2": "Face used for displaying 2nd-level cited text.", "message-cited-text-1": "Face used for displaying 1st-level cited text.", "message-separator": "Face used for displaying the separator.", "message-header-xheader": "Face used for displaying X-Header headers.", "message-header-name": "Face used for displaying header names.", "message-header-other": "Face used for displaying other headers.", "message-header-newsgroups": "Face used for displaying Newsgroups headers.", "message-header-subject": "Face used for displaying Subject headers.", "message-header-cc": "Face used for displaying Cc headers.", "message-header-to": "Face used for displaying To headers.", "gnus-splash": "Face for the splash screen.", "gnus-summary-low-read": "Face used for low interest read articles.", "gnus-summary-high-read": "Face used for high interest read articles.", "gnus-summary-normal-read": "Face used for normal interest read articles.", "gnus-summary-low-unread": "Face used for low interest unread articles.", "gnus-summary-high-unread": "Face used for high interest unread articles.", "gnus-summary-normal-unread": "Face used for normal interest unread articles.", "gnus-summary-low-undownloaded": "Face used for low interest uncached articles.", "gnus-summary-high-undownloaded": "Face used for high interest uncached articles.", "gnus-summary-normal-undownloaded": "Face used for normal interest uncached articles.", "gnus-summary-low-ancient": "Face used for low interest ancient articles.", "gnus-summary-high-ancient": "Face used for high interest ancient articles.", "gnus-summary-normal-ancient": "Face used for normal interest ancient articles.", "gnus-summary-low-ticked": "Face used for low interest ticked articles.", "gnus-summary-high-ticked": "Face used for high interest ticked articles.", "gnus-summary-normal-ticked": "Face used for normal interest ticked articles.", "gnus-summary-cancelled": "Face used for canceled articles.", "gnus-summary-selected": "Face used for selected articles.", "gnus-group-mail-low": "Low level mailgroup face.", "gnus-group-mail-low-empty": "Low level empty mailgroup face.", "gnus-group-mail-3": "Level 3 mailgroup face.", "gnus-group-mail-3-empty": "Level 3 empty mailgroup face.", "gnus-group-mail-2": "Level 2 mailgroup face.", "gnus-group-mail-2-empty": "Level 2 empty mailgroup face.", "gnus-group-mail-1": "Level 1 mailgroup face.", "gnus-group-mail-1-empty": "Level 1 empty mailgroup face.", "gnus-group-news-low": "Low level newsgroup face.", "gnus-group-news-low-empty": "Low level empty newsgroup face.", "gnus-group-news-6": "Level 6 newsgroup face.", "gnus-group-news-6-empty": "Level 6 empty newsgroup face.", "gnus-group-news-5": "Level 5 newsgroup face.", "gnus-group-news-5-empty": "Level 5 empty newsgroup face.", "gnus-group-news-4": "Level 4 newsgroup face.", "gnus-group-news-4-empty": "Level 4 empty newsgroup face.", "gnus-group-news-3": "Level 3 newsgroup face.", "gnus-group-news-3-empty": "Level 3 empty newsgroup face.", "gnus-group-news-2": "Level 2 newsgroup face.", "gnus-group-news-2-empty": "Level 2 empty newsgroup face.", "gnus-group-news-1": "Level 1 newsgroup face.", "gnus-group-news-1-empty": "Level 1 empty newsgroup face.", "doc-view-svg-face": "Face used for SVG images.", "sh-escaped-newline": "Face used for (non-escaped) backslash at end of a line in Shell-script mode.", "sh-quoted-exec": "Face to show quoted execs like `blabla`.", "sh-heredoc": "Face to show a here-document.", "org-mode-line-clock-overrun": "Face used for clock display for overrun tasks in mode line.", "org-mode-line-clock": "Face used for clock display in mode line.", "org-tag-group": "Face for group tags.", "org-macro": "Face for macros.", "org-latex-and-related": "Face used to highlight LaTeX data, entities and sub/superscript.", "org-agenda-calendar-sexp": "Face used to show events computed from a S-expression.", "org-agenda-calendar-event": "Face used to show events and appointments in the agenda.", "org-agenda-calendar-daterange": "Face used to show entries with a date range in the agenda.", "org-agenda-diary": "Face used for agenda entries that come from the Emacs diary.", "org-agenda-current-time": "Face used to show the current time in the time grid.", "org-time-grid": "Face used for time grids.", "org-agenda-filter-regexp": "Face for regexp(s) in the mode-line when filtering the agenda.", "org-agenda-filter-effort": "Face for effort in the mode-line when filtering the agenda.", "org-agenda-filter-category": "Face for categories in the mode-line when filtering the agenda.", "org-agenda-filter-tags": "Face for tag(s) in the mode-line when filtering the agenda.", "org-agenda-restriction-lock": "Face for showing the agenda restriction lock.", "org-upcoming-distant-deadline": "Face for items scheduled previously, not done, and have a distant deadline.", "org-upcoming-deadline": "Face for items scheduled previously, and not yet done.", "org-imminent-deadline": "Face for current deadlines in the agenda.", "org-scheduled-previously": "Face for items scheduled previously, and not yet done.", "org-agenda-dimmed-todo-face": "Face used to dim blocked tasks in the agenda.", "org-scheduled-today": "Face for items scheduled for a certain day.", "org-scheduled": "Face for items scheduled for a certain day.", "org-agenda-date-weekend": "Face used in agenda for weekend days.", "org-agenda-clocking": "Face marking the current clock item in the agenda.", "org-agenda-date-weekend-today": "Face used in agenda for today during weekends.", "org-agenda-date-today": "Face used in agenda for today.", "org-agenda-date": "Face used in agenda for normal days.", "org-agenda-structure-filter": "Face used for the current type of task filter in the agenda.", "org-agenda-structure-secondary": "Face used for secondary information in agenda block headers.", "org-agenda-structure": "Face used in agenda for captions and dates.", "org-clock-overlay": "Basic face for displaying the secondary selection.", "org-verse": "Face for #+BEGIN_VERSE ... #+END_VERSE blocks.", "org-quote": "Face for #+BEGIN_QUOTE ... #+END_QUOTE blocks.", "org-verbatim": "Face for fixed-with text like code snippets.", "org-inline-src-block": "Face used for inline source blocks as a whole.", "org-block-end-line": "Face used for the line delimiting the end of source blocks.", "org-block-begin-line": "Face used for the line delimiting the begin of source blocks.", "org-block": "Face used for text inside various blocks.", "org-document-info-keyword": "Face for document information keywords.", "org-document-info": "Face for document information such as the author and date.", "org-document-title": "Face for document title, i.e. that which follows the #+TITLE: keyword.", "org-meta-line": "Face for meta lines starting with \"#+\".", "org-code": "Face for fixed-width text like code snippets.", "org-formula": "Face for formulas.", "org-table-header": "Face for table header.", "org-table-row": "Face used to fontify whole table rows (including newlines and indentation).", "org-table": "Face used for tables.", "org-checkbox-statistics-done": "Face used for finished checkbox statistics.", "org-checkbox-statistics-todo": "Face used for unfinished checkbox statistics.", "org-checkbox": "Face for checkboxes.", "org-priority": "Face used for priority cookies.", "org-headline-done": "Face used to indicate that a headline is DONE.", "org-headline-todo": "Face used to indicate that a headline is marked as TODO.", "org-agenda-done": "Face used in agenda, to indicate lines switched to DONE.", "org-done": "Face used for todo keywords that indicate DONE items.", "org-todo": "Face for TODO keywords.", "org-list-dt": "Default face for definition terms in lists.", "org-tag": "Default face for tags.", "org-sexp-date": "Face for diary-like sexp date specifications.", "org-date-selected": "Face for highlighting the calendar day when using \u2018org-read-date\u2019.", "org-date": "Face for date/time stamps.", "org-target": "Face for link targets.", "org-ellipsis": "Face for the ellipsis in folded text.", "org-footnote": "Face for footnotes.", "org-link": "Face for links.", "org-cite-key": "Face for citation keys.", "org-cite": "Face for citations.", "org-archived": "Face for headline with the ARCHIVE tag.", "org-warning": "Face for deadlines and TODO keywords.", "org-agenda-column-dateline": "Face used in agenda column view for datelines with summaries.", "org-column-title": "Face for column display of entry properties.", "org-column": "Face for column display of entry properties.", "org-property-value": "Face used for the value of a property.", "org-drawer": "Face used for drawers.", "org-special-keyword": "Face used for special keywords.", "org-level-8": "Face used for level 8 headlines.", "org-level-7": "Face used for level 7 headlines.", "org-level-6": "Face used for level 6 headlines.", "org-level-5": "Face used for level 5 headlines.", "org-level-4": "Face used for level 4 headlines.", "org-level-3": "Face used for level 3 headlines.", "org-level-2": "Face used for level 2 headlines.", "org-level-1": "Face used for level 1 headlines.", "org-dispatcher-highlight": "Face for highlighted keys in the dispatcher.", "org-hide": "Face used to hide leading stars in headlines.", "org-default": "Face used for default text.", "calendar-month-header": "Face used for month headers in the calendar.", "calendar-weekend-header": "Face used for weekend column headers in the calendar.", "calendar-weekday-header": "Face used for weekday column headers in the calendar.", "holiday": "Face for indicating in the calendar dates that have holidays.", "diary": "Face for highlighting diary entries.", "calendar-today": "Face for indicating today\u2019s date in the calendar.", "lsp-inlay-hint-parameter-face": "Face for inlay parameter hints (e.g. function parameter names at", "lsp-inlay-hint-type-face": "Face for inlay type hints (e.g. inferred variable types).", "lsp-inlay-hint-face": "The face to use for the JavaScript inlays.", "lsp-installation-buffer-face": "Face used for installation buffers still in progress.", "lsp-installation-finished-buffer-face": "Face used for finished installation buffers.", "lsp-signature-face": "Used to display signatures in \u2018imenu\u2019, ....", "lsp-details-face": "Used to display additional information throughout \u2018lsp\u2019.", "lsp-rename-placeholder-face": "Face used to display the rename placeholder in.", "lsp-face-rename": "Face used to highlight the identifier being renamed.", "lsp-signature-highlight-function-argument": "The face to use to highlight function arguments in signatures.", "lsp-signature-posframe": "Background and foreground for \u2018lsp-signature-posframe\u2019.", "lsp-face-highlight-write": "Face used for highlighting symbols being written to.", "lsp-face-highlight-read": "Face used for highlighting symbols being read.", "lsp-face-highlight-textual": "Face used for textual occurrences of symbols.", "diff-refine-added": "Face used for added characters shown by \u2018diff-refine-hunk\u2019.", "diff-refine-removed": "Face used for removed characters shown by \u2018diff-refine-hunk\u2019.", "diff-refine-changed": "Face used for char-based changes shown by \u2018diff-refine-hunk\u2019.", "diff-error": "\u2018diff-mode\u2019 face for error messages from diff.", "diff-nonexistent": "\u2018diff-mode\u2019 face used to highlight nonexistent files in recursive diffs.", "diff-context": "\u2018diff-mode\u2019 face used to highlight context and other side-information.", "diff-function": "\u2018diff-mode\u2019 face used to highlight function names produced by \"diff -p\".", "diff-indicator-changed": "\u2018diff-mode\u2019 face used to highlight indicator of changed lines.", "diff-indicator-added": "\u2018diff-mode\u2019 face used to highlight indicator of added lines (+, >).", "diff-indicator-removed": "\u2018diff-mode\u2019 face used to highlight indicator of removed lines (-, <).", "diff-changed": "\u2018diff-mode\u2019 face used to highlight changed lines.", "diff-changed-unspecified": "\u2018diff-mode\u2019 face used to highlight changed lines.", "diff-added": "\u2018diff-mode\u2019 face used to highlight added lines.", "diff-removed": "\u2018diff-mode\u2019 face used to highlight removed lines.", "diff-hunk-header": "\u2018diff-mode\u2019 face used to highlight hunk header lines.", "diff-index": "\u2018diff-mode\u2019 face used to highlight index header lines.", "diff-file-header": "\u2018diff-mode\u2019 face used to highlight file header lines.", "diff-header": "\u2018diff-mode\u2019 face inherited by hunk and index header faces.", "vc-git-log-edit-summary-max-warning": "Face for Git commit summary lines beyond the maximum length.", "vc-git-log-edit-summary-target-warning": "Face for Git commit summary lines beyond the target length.", "xref-match": "Face used to highlight matches in the xref buffer.", "xref-line-number": "Face for displaying line numbers in the xref buffer.", "xref-file-header": "Face used to highlight file header in the xref buffer.", "edit-indirect-edited-region": "Face used to highlight an indirectly edited region.", "markdown-header-face-6": "Face for level 6 headers.", "markdown-header-face-5": "Face for level 5 headers.", "markdown-header-face-4": "Face for level 4 headers.", "markdown-header-face-3": "Face for level 3 headers.", "markdown-header-face-2": "Face for level 2 headers.", "markdown-header-face-1": "Face for level 1 headers.", "markdown-header-face": "Base face for headers.", "markdown-highlighting-face": "Face for highlighting.", "markdown-html-entity-face": "Face for HTML entities.", "markdown-html-attr-value-face": "Face for HTML attribute values.", "markdown-html-attr-name-face": "Face for HTML attribute names.", "markdown-html-tag-delimiter-face": "Face for HTML tag delimiters.", "markdown-html-tag-name-face": "Face for HTML tag names.", "markdown-hr-face": "Face for horizontal rules.", "markdown-highlight-face": "Face for mouse highlighting.", "markdown-gfm-checkbox-face": "Face for GFM checkboxes.", "markdown-metadata-value-face": "Face for metadata values.", "markdown-metadata-key-face": "Face for metadata keys.", "markdown-math-face": "Face for LaTeX expressions.", "markdown-comment-face": "Face for HTML comments.", "markdown-line-break-face": "Face for hard line breaks.", "markdown-link-title-face": "Face for reference link titles.", "markdown-plain-url-face": "Face for URLs that are also links.", "markdown-url-face": "Face for URLs that are part of markup.", "markdown-footnote-text-face": "Face for footnote text.", "markdown-footnote-marker-face": "Face for footnote markers.", "markdown-reference-face": "Face for link references.", "markdown-missing-link-face": "Face for the link text if the link points to a missing file.", "markdown-link-face": "Face for link text, ie the alias portion of a link.", "markdown-language-info-face": "Face for programming language info strings.", "markdown-language-keyword-face": "Face for programming language identifiers.", "markdown-table-face": "Face for tables.", "markdown-pre-face": "Face for preformatted text.", "markdown-inline-code-face": "Face for inline code.", "markdown-code-face": "Face for inline code, pre blocks, and fenced code blocks.", "markdown-blockquote-face": "Face for blockquote sections.", "markdown-list-face": "Face for list item markers.", "markdown-header-delimiter-face": "Base face for headers hash delimiter.", "markdown-header-rule-face": "Base face for headers rules.", "markdown-markup-face": "Face for markup elements.", "markdown-strike-through-face": "Face for strike-through text.", "markdown-bold-face": "Face for bold text.", "markdown-italic-face": "Face for italic text.", "outline-8": "Level 8.", "outline-7": "Level 7.", "outline-6": "Level 6.", "outline-5": "Level 5.", "outline-4": "Level 4.", "outline-3": "Level 3.", "outline-2": "Level 2.", "outline-1": "Level 1.", "lv-separator": "Face used to draw line between the lv window and the echo area.", "compilation-column-number": "Face for displaying column numbers in compiler messages.", "compilation-line-number": "Face for displaying line numbers in compiler messages.", "compilation-mode-line-exit": "Face for Compilation mode\u2019s \"exit\" mode line indicator.", "compilation-mode-line-run": "Face for Compilation mode\u2019s \"running\" mode line indicator.", "compilation-mode-line-fail": "Face for Compilation mode\u2019s \"error\" mode line indicator.", "compilation-info": "Face used to highlight compiler information.", "compilation-warning": "Face used to highlight compiler warnings.", "compilation-error": "Face used to highlight compiler errors.", "breakpoint-disabled": "Face for disabled breakpoint icon in fringe.", "breakpoint-enabled": "Face for enabled breakpoint icon in fringe.", "gud-highlight-current-line-face": "Face for highlighting the source code line being executed.", "ert-test-result-unexpected": "Face used for unexpected results in the ERT results buffer.", "ert-test-result-expected": "Face used for expected results in the ERT results buffer.", "yas--field-debug-face": "The face used for debugging some overlays normally hidden", "yas-field-highlight-face": "The face used to highlight the currently active field of a snippet", "treesit-explorer-field-name": "Face for field names in tree-sitter explorer.", "treesit-explorer-anonymous-node": "Face for anonymous nodes in tree-sitter explorer.", "dirvish-vc-needs-update-state": "Face used for \u2018needs-update\u2019 vc state in the Dirvish buffer.", "dirvish-vc-locked-state": "Face used for \u2018locked\u2019 vc state in the Dirvish buffer.", "dirvish-vc-conflict-state": "Face used for \u2018conflict\u2019 vc state in the Dirvish buffer.", "dirvish-vc-missing-state": "Face used for \u2018missing\u2019 vc state in the Dirvish buffer.", "dirvish-vc-removed-state": "Face used for \u2018removed\u2019 vc state in the Dirvish buffer.", "dirvish-vc-added-state": "Face used for \u2018added\u2019 vc state in the Dirvish buffer.", "dirvish-vc-edited-state": "Face used for \u2018edited\u2019 vc state in the Dirvish buffer.", "dirvish-git-commit-message-face": "Face for commit message overlays.", "dirvish-vc-unregistered-face": "Face used for \u2018unregistered\u2019 vc state in the Dirvish buffer.", "dirvish-vc-needs-merge-face": "Face used for \u2018needs-merge\u2019 vc state in the Dirvish buffer.", "shell-highlight-undef-alias-face": "Face used for shell command aliases.", "shell-highlight-undef-undefined-face": "Face used for non-existent shell commands.", "shell-highlight-undef-defined-face": "Face used for existing shell commands.", "dirvish-collapse-file-face": "Face used for files in \u2018collapse\u2019 attribute.", "dirvish-collapse-empty-dir-face": "Face used for empty directories in \u2018collapse\u2019 attribute.", "dirvish-collapse-dir-face": "Face used for directories in \u2018collapse\u2019 attribute.", "dirvish-narrow-split": "Face used to highlight punctuation character.", "dirvish-narrow-match-face-3": "Face for matches of components numbered 3 mod 4.", "dirvish-narrow-match-face-2": "Face for matches of components numbered 2 mod 4.", "dirvish-narrow-match-face-1": "Face for matches of components numbered 1 mod 4.", "dirvish-narrow-match-face-0": "Face for matches of components numbered 0 mod 4.", "dirvish-subtree-guide": "Face used for \u2018expanded-state\u2019 attribute.", "dirvish-subtree-state": "Face used for \u2018expanded-state\u2019 attribute.", "dirvish-emerge-group-title": "Face used for emerge group title.", "dirvish-proc-failed": "Face used if asynchronous process has failed.", "dirvish-proc-finished": "Face used if asynchronous process has finished.", "dirvish-proc-running": "Face used if asynchronous process is running.", "dirvish-inactive": "Face used for mode-line segments in unfocused Dirvish windows.", "dirvish-hl-line-inactive": "Face used for Dirvish line highlighting in unfocused Dirvish windows.", "dirvish-hl-line": "Face used for Dirvish line highlighting in focused Dirvish window.", "dashboard-footer-icon-face": "Face used for icon in footer.", "dashboard-footer-face": "Face used for footer text.", "dashboard-no-items-face": "Face used for no items.", "dashboard-items-face": "Face used for items.", "dashboard-heading": "Face used for widget headings.", "dashboard-navigator": "Face used for the navigator.", "dashboard-banner-logo-title": "Face used for the banner title.", "dashboard-text-banner": "Face used for text banners.", "rectangle-preview": "The face to use for the \u2018string-rectangle\u2019 preview.", "transient-mismatched-key": "Face optionally used to highlight keys without a short-argument.", "transient-nonstandard-key": "Face optionally used to highlight keys conflicting with short-argument.", "transient-unreachable-key": "Face used for keys unreachable from the current prefix sequence.", "transient-key-exit": "Face used for keys of suffixes that exit the menu.", "transient-key-stack": "Face used for keys of sub-menus that exit the parent menu.", "transient-key-recurse": "Face used for keys of sub-menus whose suffixes return to the parent menu.", "transient-key-return": "Face used for keys of suffixes that return to the parent menu.", "transient-key-noop": "Face used for keys of suffixes that currently cannot be invoked.", "transient-key-stay": "Face used for keys of suffixes that don\u2019t exit the menu.", "transient-key": "Face used for keys.", "transient-delimiter": "Face used for delimiters and separators.", "transient-higher-level": "Face optionally used to highlight suffixes on higher levels.", "transient-disabled-suffix": "Face used for disabled levels while editing suffix levels.", "transient-enabled-suffix": "Face used for enabled levels while editing suffix levels.", "transient-active-infix": "Face used for the infix for which the value is being read.", "transient-inapt-suffix": "Face used for suffixes that are inapt at this time.", "transient-unreachable": "Face used for suffixes unreachable from the current prefix sequence.", "transient-inactive-value": "Face used for inactive values.", "transient-value": "Face used for values.", "transient-inapt-argument": "Face used for inapt arguments with a (currently ignored) value.", "transient-inactive-argument": "Face used for inactive arguments.", "transient-argument": "Face used for enabled arguments.", "transient-heading": "Face used for headings.", "image-dired-thumb-flagged": "Face for images flagged for deletion in thumbnail buffer.", "image-dired-thumb-mark": "Face for marked images in thumbnail buffer.", "image-dired-thumb-header-image-count": "Face for the image count in the header line of the thumbnail buffer.", "image-dired-thumb-header-file-size": "Face for the file size in the header line of the thumbnail buffer.", "image-dired-thumb-header-directory-name": "Face for the directory name in the header line of the thumbnail buffer.", "image-dired-thumb-header-file-name": "Face for the file name in the header line of the thumbnail buffer.", "erc-keyword-face": "ERC face for your keywords.", "erc-fool-face": "ERC face for fools on the channel.", "erc-pal-face": "ERC face for your pals.", "erc-dangerous-host-face": "ERC face for people on dangerous hosts.", "erc-current-nick-face": "ERC face for occurrences of your current nickname.", "bg:erc-color-face15": "ERC face.", "bg:erc-color-face14": "ERC face.", "bg:erc-color-face13": "ERC face.", "bg:erc-color-face12": "ERC face.", "bg:erc-color-face11": "ERC face.", "bg:erc-color-face10": "ERC face.", "bg:erc-color-face9": "ERC face.", "bg:erc-color-face8": "ERC face.", "bg:erc-color-face7": "ERC face.", "bg:erc-color-face6": "ERC face.", "bg:erc-color-face5": "ERC face.", "bg:erc-color-face4": "ERC face.", "bg:erc-color-face3": "ERC face.", "bg:erc-color-face2": "ERC face.", "bg:erc-color-face1": "ERC face.", "bg:erc-color-face0": "ERC face.", "fg:erc-color-face15": "ERC face.", "fg:erc-color-face14": "ERC face.", "fg:erc-color-face13": "ERC face.", "fg:erc-color-face12": "ERC face.", "fg:erc-color-face11": "ERC face.", "fg:erc-color-face10": "ERC face.", "fg:erc-color-face9": "ERC face.", "fg:erc-color-face8": "ERC face.", "fg:erc-color-face7": "ERC face.", "fg:erc-color-face6": "ERC face.", "fg:erc-color-face5": "ERC face.", "fg:erc-color-face4": "ERC face.", "fg:erc-color-face3": "ERC face.", "fg:erc-color-face2": "ERC face.", "fg:erc-color-face1": "ERC face.", "fg:erc-color-face0": "ERC face.", "erc-underline-face": "ERC underline face.", "erc-spoiler-face": "ERC spoiler face.", "erc-inverse-face": "ERC inverse face.", "erc-italic-face": "ERC italic face.", "erc-bold-face": "ERC bold face.", "erc-command-indicator-face": "Face for echoed command lines, including the prompt.", "erc-keep-place-indicator-arrow": "Face for arrow value of option \u2018erc-keep-place-indicator-style\u2019.", "erc-keep-place-indicator-line": "Face for option \u2018erc-keep-place-indicator-style\u2019.", "comint-highlight-prompt": "Face to use to highlight prompts.", "comint-highlight-input": "Face to use to highlight user input.", "ansi-color-bright-white": "Face used to render bright white color code.", "ansi-color-bright-cyan": "Face used to render bright cyan color code.", "ansi-color-bright-magenta": "Face used to render bright magenta color code.", "ansi-color-bright-blue": "Face used to render bright blue color code.", "ansi-color-bright-yellow": "Face used to render bright yellow color code.", "ansi-color-bright-green": "Face used to render bright green color code.", "ansi-color-bright-red": "Face used to render bright red color code.", "ansi-color-bright-black": "Face used to render bright black color code.", "ansi-color-white": "Face used to render white color code.", "ansi-color-cyan": "Face used to render cyan color code.", "ansi-color-magenta": "Face used to render magenta color code.", "ansi-color-blue": "Face used to render blue color code.", "ansi-color-yellow": "Face used to render yellow color code.", "ansi-color-green": "Face used to render green color code.", "ansi-color-red": "Face used to render red color code.", "ansi-color-black": "Face used to render black color code.", "ansi-color-inverse": "Face used to render inverted video text.", "ansi-color-fast-blink": "Face used to render rapidly blinking text.", "ansi-color-slow-blink": "Face used to render slowly blinking text.", "ansi-color-underline": "Face used to render underlined text.", "ansi-color-italic": "Face used to render italic text.", "ansi-color-faint": "Face used to render faint text.", "ansi-color-bold": "Face used to render bold text.", "erc-button-nick-default-face": "Default face for a buttonized nickname.", "erc-button": "ERC button face.", "erc-fill-wrap-merge-indicator-face": "ERC \u2018fill-wrap\u2019 merge-indicator face.", "erc-timestamp-face": "ERC timestamp face.", "erc-nick-msg-face": "ERC nickname face for private messages.", "erc-nick-default-face": "ERC nickname default face.", "erc-my-nick-face": "ERC face for your current nickname in messages sent by you.", "erc-information": "Face for local administrative messages of low to moderate importance.", "erc-error-face": "ERC face for errors.", "erc-action-face": "ERC face for actions generated by /ME.", "erc-notice-face": "ERC face for notices.", "erc-prompt-face": "ERC face for the prompt.", "erc-input-face": "ERC face used for your input.", "erc-header-line": "ERC face used for the header line.", "erc-direct-msg-face": "ERC face used for messages you receive in the main erc buffer.", "erc-my-nick-prefix-face": "ERC face used for my user mode prefix.", "erc-nick-prefix-face": "ERC face used for user mode prefix.", "erc-default-face": "ERC default face.", "prescient-secondary-highlight": "Additional face used to highlight parts of candidates.", "prescient-primary-highlight": "Face used to highlight the parts of candidates that match the input.", "company-echo-common": "Face used for the common part of completions in the echo area.", "company-echo": "Face used for completions in the echo area.", "company-preview-search": "Face used for the search string in the completion preview.", "company-preview-common": "Face used for the common part of the completion preview.", "company-preview": "Face used for the completion preview.", "company-tooltip-scrollbar-track": "Face used for the tooltip scrollbar track (trough).", "company-tooltip-scrollbar-thumb": "Face used for the tooltip scrollbar thumb (bar).", "company-tooltip-quick-access-selection": "Face used for the selected quick-access hints shown in the tooltip.", "company-tooltip-quick-access": "Face used for the quick-access hints shown in the tooltip.", "company-tooltip-annotation-selection": "Face used for the selected completion annotation in the tooltip.", "company-tooltip-annotation": "Face used for the completion annotation in the tooltip.", "company-tooltip-common-selection": "Face used for the selected common completion in the tooltip.", "company-tooltip-common": "Face used for the common completion in the tooltip.", "company-tooltip-mouse": "Face used for the tooltip item under the mouse.", "company-tooltip-search-selection": "Face used for the search string inside the selection in the tooltip.", "company-tooltip-search": "Face used for the search string in the tooltip.", "company-tooltip-deprecated": "Face used for the deprecated items.", "company-tooltip-selection": "Face used for the selection in the tooltip.", "company-tooltip": "Face used for the tooltip.", "embark-selected": "Face for selected candidates.", "embark-collect-annotation": "Face for annotations in Embark Collect.", "embark-collect-group-separator": "Face for group titles in Embark Collect buffers.", "embark-collect-group-title": "Face for group titles in Embark Collect buffers.", "embark-collect-candidate": "Face for candidates in Embark Collect buffers.", "embark-verbose-indicator-shadowed": "Face used by the verbose action indicator for the shadowed targets.", "embark-verbose-indicator-title": "Face used by the verbose action indicator for the title.", "embark-verbose-indicator-documentation": "Face used by the verbose action indicator to display binding descriptions.", "embark-target": "Face used to highlight the target at point during \u2018embark-act\u2019.", "embark-keymap": "Face used to display keymaps.", "embark-keybinding": "Face used to display key bindings.", "embark-keybinding-repeat": "Face used to indicate keybindings as repeatable.", "ffap": "Face used to highlight the current buffer substring.", "orderless-match-face-3": "Face for matches of components numbered 3 mod 4.", "orderless-match-face-2": "Face for matches of components numbered 2 mod 4.", "orderless-match-face-1": "Face for matches of components numbered 1 mod 4.", "orderless-match-face-0": "Face for matches of components numbered 0 mod 4.", "consult-line-number-wrapped": "Face used to highlight line number prefixes after wrap around.", "consult-line-number-prefix": "Face used to highlight line number prefixes.", "consult-buffer": "Face used to highlight buffers in \u2018consult-buffer\u2019.", "consult-bookmark": "Face used to highlight bookmarks in \u2018consult-buffer\u2019.", "consult-grep-context": "Face used to highlight grep context in \u2018consult-grep\u2019.", "consult-file": "Face used to highlight files in \u2018consult-buffer\u2019.", "consult-line-number": "Face used to highlight location line in \u2018consult-global-mark\u2019.", "consult-key": "Face used to highlight keys, e.g., in \u2018consult-register\u2019.", "consult-help": "Face used to highlight help, e.g., in \u2018consult-register-store\u2019.", "consult-async-option": "Face used to highlight asynchronous command options.", "consult-async-split": "Face used to highlight punctuation character.", "consult-async-failed": "Face used if asynchronous process has failed.", "consult-async-finished": "Face used if asynchronous process has finished.", "consult-async-running": "Face used if asynchronous process is running.", "consult-narrow-indicator": "Face used for the narrowing indicator.", "consult-preview-insertion": "Face used for previews of text to be inserted.", "consult-preview-match": "Face used for match previews, e.g., in \u2018consult-line\u2019.", "consult-highlight-mark": "Face used for mark positions in completion candidates.", "consult-highlight-match": "Face used to highlight matches in the completion candidates.", "consult-preview-line": "Face used for line previews.", "nerd-icons-completion-dir-face": "Face for the directory icon.", "marginalia-file-priv-rare": "Face used to highlight a rare file privilege attribute.", "marginalia-file-priv-other": "Face used to highlight some other file privilege attribute.", "marginalia-file-priv-exec": "Face used to highlight the exec file privilege attribute.", "marginalia-file-priv-write": "Face used to highlight the write file privilege attribute.", "marginalia-file-priv-read": "Face used to highlight the read file privilege attribute.", "marginalia-file-priv-link": "Face used to highlight the link file privilege attribute.", "marginalia-file-priv-dir": "Face used to highlight the dir file privilege attribute.", "marginalia-file-priv-no": "Face used to highlight the no file privilege attribute.", "marginalia-file-owner": "Face used to highlight file owner and group names.", "marginalia-file-name": "Face used to highlight file names.", "marginalia-modified": "Face used to highlight buffer modification indicators.", "marginalia-string": "Face used to highlight string values.", "marginalia-number": "Face used to highlight numeric values.", "marginalia-size": "Face used to highlight sizes.", "marginalia-installed": "Face used to highlight the status of packages.", "marginalia-archive": "Face used to highlight package archives.", "marginalia-version": "Face used to highlight package versions.", "marginalia-date": "Face used to highlight dates.", "marginalia-mode": "Face used to highlight buffer major modes.", "marginalia-list": "Face used to highlight list expressions.", "marginalia-symbol": "Face used to highlight general symbols.", "marginalia-function": "Face used to highlight function symbols.", "marginalia-true": "Face used to highlight true variable values.", "marginalia-null": "Face used to highlight null or unbound variable values.", "marginalia-value": "Face used to highlight general variable values.", "marginalia-documentation": "Face used to highlight documentation strings.", "marginalia-off": "Face used to signal disabled modes.", "marginalia-on": "Face used to signal enabled modes.", "marginalia-lighter": "Face used to highlight minor mode lighters.", "marginalia-char": "Face used to highlight character annotations.", "marginalia-type": "Face used to highlight types.", "marginalia-key": "Face used to highlight keys.", "vertico-current": "Face used to highlight the currently selected candidate.", "vertico-group-separator": "Face used for the separator lines of the candidate groups.", "vertico-group-title": "Face used for the title text of the candidate group headlines.", "vertico-multiline": "Face used to highlight multiline replacement characters.", "nerd-icons-dsilver": "Face for dsilver icons.", "nerd-icons-lsilver": "Face for lsilver icons.", "nerd-icons-silver": "Face for silver icons.", "nerd-icons-dpink": "Face for dpink icons.", "nerd-icons-lpink": "Face for lpink icons.", "nerd-icons-pink": "Face for pink icons.", "nerd-icons-dcyan": "Face for dcyan icons.", "nerd-icons-lcyan": "Face for lcyan icons.", "nerd-icons-cyan-alt": "Face for cyan icons.", "nerd-icons-cyan": "Face for cyan icons.", "nerd-icons-dorange": "Face for dorange icons.", "nerd-icons-lorange": "Face for lorange icons.", "nerd-icons-orange": "Face for orange icons.", "nerd-icons-dpurple": "Face for dpurple icons.", "nerd-icons-lpurple": "Face for lpurple icons.", "nerd-icons-purple-alt": "Face for purple icons.", "nerd-icons-purple": "Face for purple icons.", "nerd-icons-dmaroon": "Face for dmaroon icons.", "nerd-icons-lmaroon": "Face for lmaroon icons.", "nerd-icons-maroon": "Face for maroon icons.", "nerd-icons-dblue": "Face for dblue icons.", "nerd-icons-lblue": "Face for lblue icons.", "nerd-icons-blue-alt": "Face for blue icons.", "nerd-icons-blue": "Face for blue icons.", "nerd-icons-dyellow": "Face for dyellow icons.", "nerd-icons-lyellow": "Face for lyellow icons.", "nerd-icons-yellow": "Face for yellow icons.", "nerd-icons-dgreen": "Face for dgreen icons.", "nerd-icons-lgreen": "Face for lgreen icons.", "nerd-icons-green": "Face for green icons.", "nerd-icons-red-alt": "Face for dred icons.", "nerd-icons-dred": "Face for dred icons.", "nerd-icons-lred": "Face for lred icons.", "nerd-icons-red": "Face for red icons.", "all-the-icons-dsilver": "Face for dsilver icons", "all-the-icons-lsilver": "Face for lsilver icons", "all-the-icons-silver": "Face for silver icons", "all-the-icons-dpink": "Face for dpink icons", "all-the-icons-lpink": "Face for lpink icons", "all-the-icons-pink": "Face for pink icons", "all-the-icons-dcyan": "Face for dcyan icons", "all-the-icons-lcyan": "Face for lcyan icons", "all-the-icons-cyan-alt": "Face for cyan icons", "all-the-icons-cyan": "Face for cyan icons", "all-the-icons-dorange": "Face for dorange icons", "all-the-icons-lorange": "Face for lorange icons", "all-the-icons-orange": "Face for orange icons", "all-the-icons-dpurple": "Face for dpurple icons", "all-the-icons-lpurple": "Face for lpurple icons", "all-the-icons-purple-alt": "Face for purple icons", "all-the-icons-purple": "Face for purple icons", "all-the-icons-dmaroon": "Face for dmaroon icons", "all-the-icons-lmaroon": "Face for lmaroon icons", "all-the-icons-maroon": "Face for maroon icons", "all-the-icons-dblue": "Face for dblue icons", "all-the-icons-lblue": "Face for lblue icons", "all-the-icons-blue-alt": "Face for blue icons", "all-the-icons-blue": "Face for blue icons", "all-the-icons-dyellow": "Face for dyellow icons", "all-the-icons-lyellow": "Face for lyellow icons", "all-the-icons-yellow": "Face for yellow icons", "all-the-icons-dgreen": "Face for dgreen icons", "all-the-icons-lgreen": "Face for lgreen icons", "all-the-icons-green": "Face for green icons", "all-the-icons-red-alt": "Face for dred icons", "all-the-icons-dred": "Face for dred icons", "all-the-icons-lred": "Face for lred icons", "all-the-icons-red": "Face for red icons", "adob--hack": "A hack to make fringe refresh work. Do not use.", "auto-dim-other-buffers-hide": "Face with a (presumably) dimmed background and matching foreground.", "auto-dim-other-buffers": "Face with a (presumably) dimmed background for non-selected window.", "epa-field-body": "Face for the body of the attribute field.", "epa-field-name": "Face for the name of the attribute field.", "epa-mark": "Face used for displaying the high validity.", "epa-string": "Face used for displaying the string.", "epa-validity-disabled": "Face used for displaying the disabled validity.", "epa-validity-low": "Face used for displaying the low validity.", "epa-validity-medium": "Face for medium validity EPA information.", "epa-validity-high": "Face for high validity EPA information.", "mm-command-output": "Face used for displaying output from commands.", "edmacro-label": "Face used for labels in \u2018edit-kbd-macro\u2019.", "kmacro-menu-marked": "Face used for keyboard macros marked for duplication.", "kmacro-menu-flagged": "Face used for keyboard macros flagged for deletion.", "kmacro-menu-mark": "Face used for the Keyboard Macro Menu marks.", "custom-group-subtitle": "Face for the \"Subgroups:\" subtitle in Custom buffers.", "custom-group-tag": "Face for low level group tags.", "custom-group-tag-1": "Face for group tags.", "custom-face-tag": "Face used for face tags.", "custom-visibility": "Face for the \u2018custom-visibility\u2019 widget.", "custom-variable-button": "Face used for pushable variable tags.", "custom-variable-tag": "Face used for unpushable variable tags.", "custom-variable-obsolete": "Face used for obsolete variables.", "custom-comment-tag": "Face used for the comment tag on variables or faces.", "custom-comment": "Face used for comments on variables or faces.", "custom-link": "Face for links in customization buffers.", "custom-state": "Face used for State descriptions in the customize buffer.", "custom-documentation": "Face used for documentation strings in customization buffers.", "custom-button-pressed-unraised": "Face for pressed custom buttons if \u2018custom-raised-buttons\u2019 is nil.", "custom-button-pressed": "Face for pressed custom buttons if \u2018custom-raised-buttons\u2019 is non-nil.", "custom-button-unraised": "Face for custom buffer buttons if \u2018custom-raised-buttons\u2019 is nil.", "custom-button-mouse": "Mouse face for custom buffer buttons if \u2018custom-raised-buttons\u2019 is non-nil.", "custom-button": "Face for custom buffer buttons if \u2018custom-raised-buttons\u2019 is non-nil.", "custom-saved": "Face used when the customize item has been saved.", "custom-themed": "Face used when the customize item has been set by a theme.", "custom-changed": "Face used when the customize item has been changed.", "custom-set": "Face used when the customize item has been set.", "custom-modified": "Face used when the customize item has been modified.", "custom-rogue": "Face used when the customize item is not defined for customization.", "custom-invalid": "Face used when the customize item is invalid.", "widget-button-pressed": "Face used for pressed buttons.", "widget-unselected": "Face used for unselected widgets.", "widget-inactive": "Face used for inactive widgets.", "widget-single-line-field": "Face used for editable fields spanning only a single line.", "widget-field": "Face used for editable fields.", "widget-button": "Face used for widget buttons.", "widget-documentation": "Face used for documentation text.", "bookmark-face": "Face used to highlight current line.", "bookmark-menu-bookmark": "Face used to highlight bookmark names in bookmark menu buffers.", "dired-ignored": "Face used for files suffixed with \u2018completion-ignored-extensions\u2019.", "dired-special": "Face used for sockets, pipes, block devices and char devices.", "dired-broken-symlink": "Face used for broken symbolic links.", "dired-symlink": "Face used for symbolic links.", "dired-directory": "Face used for subdirectories.", "dired-set-id": "Face used to highlight permissions of suid and guid files.", "dired-perm-write": "Face used to highlight permissions of group- and world-writable files.", "dired-warning": "Face used to highlight a part of a buffer that needs user attention.", "dired-flagged": "Face used for files flagged for deletion.", "dired-marked": "Face used for marked files.", "dired-mark": "Face used for Dired marks.", "dired-header": "Face used for directory headers.", "Info-quoted": "Face used for quoted elements.", "info-index-match": "Face used to highlight matches in an index entry.", "info-header-node": "Face for Info nodes in a node header.", "info-header-xref": "Face for Info cross-references in a node header.", "info-xref-visited": "Face for visited Info cross-references.", "info-xref": "Face for unvisited Info cross-references.", "info-menu-star": "Face used to emphasize \u2018*\u2019 in an Info menu.", "info-menu-header": "Face for headers in Info menus.", "info-title-4": "Face for info titles at level 4.", "info-title-3": "Face for info titles at level 3.", "info-title-2": "Face for info titles at level 2.", "info-title-1": "Face for info titles at level 1.", "info-node": "Face for Info node names.", "package-status-avail-obso": "Face used on the status and version of avail-obso packages.", "package-status-incompat": "Face used on the status and version of incompat packages.", "package-status-unsigned": "Face used on the status and version of unsigned packages.", "package-status-dependency": "Face used on the status and version of dependency packages.", "package-status-from-source": "Face used on the status and version of installed packages.", "package-status-installed": "Face used on the status and version of installed packages.", "package-status-disabled": "Face used on the status and version of disabled packages.", "package-status-held": "Face used on the status and version of held packages.", "package-status-new": "Face used on the status and version of new packages.", "package-status-available": "Face used on the status and version of available packages.", "package-status-external": "Face used on the status and version of external packages.", "package-status-built-in": "Face used on the status and version of built-in packages.", "package-description": "Face used on package description summaries in the package menu.", "package-name": "Face used on package names in the package menu.", "package-help-section-name": "Face used on section names in package description buffers.", "browse-url-button": "Face for \u2018browse-url\u2019 buttons (i.e., links).", "icon-button": "Face for buttons.", "icon": "Face for buttons.", "tooltip": "Face for tooltips.", "eldoc-highlight-function-argument": "Face used for the argument at point in a function\u2019s argument list.", "elisp-shorthand-font-lock-face": "Face for highlighting shorthands in Emacs Lisp.", "vc-ignored-state": "Face for VC modeline state when the file is registered, but ignored.", "vc-edited-state": "Face for VC modeline state when the file is edited.", "vc-missing-state": "Face for VC modeline state when the file is missing from the file system.", "vc-removed-state": "Face for VC modeline state when the file was removed from the VC system.", "vc-conflict-state": "Face for VC modeline state when the file contains merge conflicts.", "vc-locally-added-state": "Face for VC modeline state when the file is locally added.", "vc-locked-state": "Face for VC modeline state when the file locked.", "vc-needs-update-state": "Face for VC modeline state when the file needs update.", "vc-up-to-date-state": "Face for VC modeline state when the file is up to date.", "vc-state-base": "Base face for VC state indicator.", "buffer-menu-buffer": "Face for buffer names in the Buffer Menu.", "tabulated-list-fake-header": "Face used on fake header lines.", "match": "Face used to highlight matches permanently.", "query-replace": "Face for highlighting query replacement matches.", "tab-bar-tab-ungrouped": "Tab bar face for ungrouped tab when tab groups are used.", "tab-bar-tab-group-inactive": "Tab bar face for inactive group tab.", "tab-bar-tab-group-current": "Tab bar face for current group tab.", "tab-bar-tab-inactive": "Tab bar face for non-selected tab.", "tab-bar-tab": "Tab bar face for selected tab.", "file-name-shadow": "Face used by \u2018file-name-shadow-mode\u2019 for the shadow.", "isearch-group-2": "Face for highlighting Isearch the even group matches.", "isearch-group-1": "Face for highlighting Isearch the odd group matches.", "lazy-highlight": "Face for lazy highlighting of matches other than the current one.", "isearch-fail": "Face for highlighting failed part in Isearch echo-area message.", "isearch": "Face for highlighting Isearch matches.", "mouse-drag-and-drop-region": "Face to highlight original text during dragging.", "font-lock-misc-punctuation-face": "Font Lock mode face used to highlight miscellaneous punctuation.", "font-lock-delimiter-face": "Font Lock mode face used to highlight delimiters.", "font-lock-bracket-face": "Font Lock mode face used to highlight brackets, braces, and parens.", "font-lock-punctuation-face": "Font Lock mode face used to highlight punctuation characters.", "font-lock-property-use-face": "Font Lock mode face used to highlight property references.", "font-lock-property-name-face": "Font Lock mode face used to highlight properties of an object.", "font-lock-operator-face": "Font Lock mode face used to highlight operators.", "font-lock-number-face": "Font Lock mode face used to highlight numbers.", "font-lock-escape-face": "Font Lock mode face used to highlight escape sequences in strings.", "font-lock-regexp-grouping-construct": "Font Lock mode face used to highlight grouping constructs in Lisp regexps.", "font-lock-regexp-grouping-backslash": "Font Lock mode face for backslashes in Lisp regexp grouping constructs.", "font-lock-regexp-face": "Font Lock mode face used to highlight regexp literals.", "font-lock-preprocessor-face": "Font Lock mode face used to highlight preprocessor directives.", "font-lock-negation-char-face": "Font Lock mode face used to highlight easy to overlook negation.", "font-lock-warning-face": "Font Lock mode face used to highlight warnings.", "font-lock-constant-face": "Font Lock mode face used to highlight constants and labels.", "font-lock-type-face": "Font Lock mode face used to highlight type and class names.", "font-lock-variable-use-face": "Font Lock mode face used to highlight variable references.", "font-lock-variable-name-face": "Font Lock mode face used to highlight variable names.", "font-lock-function-call-face": "Font Lock mode face used to highlight function calls.", "font-lock-function-name-face": "Font Lock mode face used to highlight function names.", "font-lock-builtin-face": "Font Lock mode face used to highlight builtins.", "font-lock-keyword-face": "Font Lock mode face used to highlight keywords.", "font-lock-doc-markup-face": "Font Lock mode face used to highlight embedded documentation mark-up.", "font-lock-doc-face": "Font Lock mode face used to highlight documentation embedded in program code.", "font-lock-string-face": "Font Lock mode face used to highlight strings.", "font-lock-comment-delimiter-face": "Font Lock mode face used to highlight comment delimiters.", "font-lock-comment-face": "Font Lock mode face used to highlight comments.", "completions-common-part": "Face for the parts of completions which matched the pattern.", "completions-first-difference": "Face for the first character after point in completions.", "completions-highlight": "Default face for highlighting the current completion candidate.", "completions-annotations": "Face to use for annotations in the *Completions* buffer.", "completions-group-separator": "Face used for the separator lines between the candidate groups.", "completions-group-title": "Face used for the title text of the candidate group headlines.", "blink-matching-paren-offscreen": "Face for showing in the echo area matched open paren that is off-screen.", "separator-line": "Face for separator lines.", "next-error-message": "Face used to highlight the current error message in the \u2018next-error\u2019 buffer.", "next-error": "Face used to highlight next error locus.", "confusingly-reordered": "Face for highlighting text that was bidi-reordered in confusing ways.", "help-for-help-header": "Face used for headers in the \u2018help-for-help\u2019 buffer.", "abbrev-table-name": "Face used for displaying the abbrev table name in \u2018edit-abbrevs-mode\u2019.", "button": "Default face used for buttons.", "show-paren-mismatch": "Face used for a mismatching paren.", "show-paren-match-expression": "Face used for a matching paren when highlighting the whole expression.", "show-paren-match": "Face used for a matching paren.", "tty-menu-selected-face": "Face for displaying the currently selected item in TTY menus.", "tty-menu-disabled-face": "Face for displaying disabled items in TTY menus.", "tty-menu-enabled-face": "Face for displaying enabled items in TTY menus.", "read-multiple-choice-face": "Face for the symbol name in \u2018read-multiple-choice\u2019 output.", "success": "Basic face used to indicate successful operation.", "warning": "Basic face used to highlight warnings.", "error": "Basic face used to highlight errors and to denote failure.", "glyphless-char": "Face for displaying non-graphic characters (e.g. U+202A (LRE)).", "help-key-binding": "Face for keybindings in *Help* buffers.", "help-argument-name": "Face to highlight argument names in *Help* buffers.", "menu": "Basic face for the font and colors of the menu bar and popup menus.", "tab-line": "Tab line face.", "tab-bar": "Tab bar face.", "tool-bar": "Basic tool-bar face.", "mouse": "Basic face for the mouse color under X.", "cursor": "Basic face for the cursor color under X.", "border": "Basic face for the frame border under X.", "scroll-bar": "Basic face for the scroll bar colors under X.", "fringe": "Basic face for the fringes to the left and right of windows under X.", "minibuffer-prompt": "Face for minibuffer prompts.", "child-frame-border": "Basic face for the internal border of child frames.", "internal-border": "Basic face for the internal border.", "window-divider-last-pixel": "Basic face for last pixel line/column of window dividers.", "window-divider-first-pixel": "Basic face for first pixel line/column of window dividers.", "window-divider": "Basic face for window dividers.", "vertical-border": "Face used for vertical window dividers on ttys.", "header-line-highlight": "Basic header line face for highlighting.", "header-line": "Basic header-line face.", "mode-line-buffer-id": "Face used for buffer identification parts of the mode line.", "mode-line-emphasis": "Face used to emphasize certain mode line features.", "mode-line-highlight": "Basic mode line face for highlighting.", "mode-line-inactive": "Basic mode line face for non-selected windows.", "mode-line-active": "Face for the selected mode line.", "mode-line": "Face for the mode lines as well as header lines.", "nobreak-hyphen": "Face for displaying nobreak hyphens.", "nobreak-space": "Face for displaying nobreak space.", "homoglyph": "Face for lookalike characters.", "escape-glyph": "Face for characters displayed as sequences using \u2018^\u2019 or \u2018\\\u2019.", "fill-column-indicator": "Face for displaying fill column indicator.", "line-number-minor-tick": "Face for highlighting \"minor ticks\" (as in a ruler).", "line-number-major-tick": "Face for highlighting \"major ticks\" (as in a ruler).", "line-number-current-line": "Face for displaying the current line number.", "line-number": "Face for displaying line numbers.", "trailing-whitespace": "Basic face for highlighting trailing whitespace.", "secondary-selection": "Basic face for displaying the secondary selection.", "region": "Basic face for highlighting the region.", "highlight": "Basic face for highlighting.", "link-visited": "Basic face for visited links.", "link": "Basic face for unvisited links.", "shadow": "Basic face for shadowed text.", "variable-pitch-text": "The proportional face used for longer texts.", "variable-pitch": "The basic variable-pitch face.", "fixed-pitch-serif": "The basic fixed-pitch face with serifs.", "fixed-pitch": "The basic fixed-pitch face.", "underline": "Basic underlined face.", "bold-italic": "Basic bold-italic face.", "italic": "Basic italic face.", "bold": "Basic bold face.", "default": "Basic default face.", "eat-term-color-black": "Face used to render black color text.", "eat-term-color-red": "Face used to render red color text.", "eat-term-color-green": "Face used to render green color text.", "eat-term-color-yellow": "Face used to render yellow color text.", "eat-term-color-blue": "Face used to render blue color text.", "eat-term-color-magenta": "Face used to render magenta color text.", "eat-term-color-cyan": "Face used to render cyan color text.", "eat-term-color-white": "Face used to render white color text.", "eat-term-color-bright-black": "Face used to render bright black color text.", "eat-term-color-bright-red": "Face used to render bright red color text.", "eat-term-color-bright-green": "Face used to render bright green color text.", "eat-term-color-bright-yellow": "Face used to render bright yellow color text.", "eat-term-color-bright-blue": "Face used to render bright blue color text.", "eat-term-color-bright-magenta": "Face used to render bright magenta color text.", "eat-term-color-bright-cyan": "Face used to render bright cyan color text.", "eat-term-color-bright-white": "Face used to render bright white color text.", "eat-term-bold": "Face used to render bold text.", "eat-term-faint": "Face used to render faint text.", "eat-term-italic": "Face used to render italic text.", "eat-term-slow-blink": "Face used to render slowly blinking text.", "eat-term-fast-blink": "Face used to render rapidly blinking text.", "eat-shell-prompt-annotation-success": "Face used in annotation to indicate the command has succeeded.", "eat-shell-prompt-annotation-running": "Face used in annotation to indicate the command is running.", "eat-shell-prompt-annotation-failure": "Face used in annotation to indicate the command has failed."}, SYNTAX_DOCS={"bg": "Basic default face.", "p": "Basic default face.", "kw": "Font Lock mode face used to highlight keywords.", "bi": "Font Lock mode face used to highlight builtins.", "pp": "Font Lock mode face used to highlight preprocessor directives.", "fnd": "Font Lock mode face used to highlight function names.", "fnc": "Font Lock mode face used to highlight function calls.", "ty": "Font Lock mode face used to highlight type and class names.", "prop": "Font Lock mode face used to highlight properties of an object.", "con": "Font Lock mode face used to highlight constants and labels.", "num": "Font Lock mode face used to highlight numbers.", "str": "Font Lock mode face used to highlight strings.", "esc": "Font Lock mode face used to highlight escape sequences in strings.", "re": "Font Lock mode face used to highlight regexp literals.", "doc": "Font Lock mode face used to highlight documentation embedded in program code.", "cm": "Font Lock mode face used to highlight comments.", "cmd": "Font Lock mode face used to highlight comment delimiters.", "var": "Font Lock mode face used to highlight variable names.", "op": "Font Lock mode face used to highlight operators.", "punc": "Font Lock mode face used to highlight punctuation characters."}; // face/category -> docstring first line, for element hovers -let MAP={"kw": "#d3d3d3", "bi": "#d3d3d3", "pp": "#d3d3d3", "fnd": "#0000ff", "fnc": "#0000ff", "dec": "", "ty": "#e5e5e5", "prop": "#e5e5e5", "con": "#d3d3d3", "num": "#000000", "esc": "#000000", "str": "#696969", "re": "#696969", "doc": "#696969", "cm": "#696969", "cmd": "#696969", "var": "#e5e5e5", "op": "#000000", "punc": "#000000", "p": "#000000", "bg": "#ffffff"}, PALETTE=[["#ffffff", "bg", "ground"], ["#000000", "fg", "ground"], ["#d3d3d3", "lightgray", "lightgray"], ["#0000ff", "blue1", "blue"], ["#e5e5e5", "gray90", "gray"], ["#696969", "dimgray", "dimgray"], ["#eedc82", "lightgoldenrod2", "lightgoldenrod"], ["#b4eeb4", "darkseagreen2", "darkseagreen"], ["#bfbfbf", "grey75", "grey"], ["#333333", "grey20", "grey"], ["#f2f2f2", "grey95", "grey"], ["#ff00ff", "magenta", "magenta"], ["#b0e2ff", "lightskyblue1", "lightskyblue"], ["#cd00cd", "magenta3", "magenta"], ["#afeeee", "paleturquoise", "paleturquoise"], ["#ffc1c1", "rosybrown1", "rosybrown"], ["#40e0d0", "turquoise", "turquoise"], ["#a020f0", "purple", "purple"], ["#3a5fcd", "royalblue3", "royalblue"], ["#ff0000", "red", "red"], ["#ff8c00", "dark-orange", "dark-orange"], ["#228b22", "forestgreen", "forestgreen"], ["#8b6508", "darkgoldenrod4", "darkgoldenrod"], ["#8b4c39", "salmon4", "salmon"], ["#22aa22", "color-24", "color-24"], ["#ddffdd", "color-25", "color-25"], ["#cceecc", "color-26", "color-26"], ["#aa2222", "color-27", "color-27"], ["#ffdddd", "color-28", "color-28"], ["#eecccc", "color-29", "color-29"], ["#7f7f7f", "grey50", "grey"], ["#cccccc", "grey80", "grey"], ["#cd8162", "lightsalmon3", "lightsalmon"], ["#aaaa11", "color-33", "color-33"], ["#ffffcc", "color-34", "color-34"], ["#eeeebb", "color-35", "color-35"], ["#4a708b", "skyblue4", "skyblue"], ["#6e8b3d", "darkolivegreen4", "darkolivegreen"], ["#8b6914", "goldenrod4", "goldenrod"], ["#999999", "grey60", "grey"], ["#4d4d4d", "grey30", "grey"], ["#b22222", "firebrick", "firebrick"], ["#00ff00", "green", "green"], ["#556b2f", "darkolivegreen", "darkolivegreen"], ["#8b3a3a", "indianred4", "indianred"], ["#b8860b", "darkgoldenrod", "darkgoldenrod"], ["#00ffff", "cyan", "cyan"], ["#66cdaa", "medium-aquamarine", "medium-aquamarine"], ["#ffa500", "orange", "orange"], ["#d02090", "violet-red", "violet-red"], ["#add8e6", "light-blue", "light-blue"], ["#cd5c5c", "indian-red", "indian-red"], ["#aaa", "color-52", "color-52"], ["#000", "color-53", "color-53"], ["#aa0", "color-54", "color-54"], ["#070", "color-55", "color-55"], ["#daa520", "goldenrod", "goldenrod"], ["#00bfff", "deep-sky-blue", "deep-sky-blue"], ["#ee00ee", "magenta2", "magenta"], ["#ffff00", "yellow", "yellow"], ["#6b6b6b", "color-60", "color-60"], ["#979797", "color-61", "color-61"], ["unspecified", "color-62", "color-62"], ["#223fbf", "color-63", "color-63"], ["#8f0075", "color-64", "color-64"], ["#145a00", "color-65", "color-65"], ["#804000", "color-66", "color-66"], ["#efcbcf", "color-67", "color-67"], ["#6a9fb5", "color-68", "color-68"], ["#2188b6", "color-69", "color-69"], ["#75b5aa", "color-70", "color-70"], ["#0595bd", "color-71", "color-71"], ["#446674", "color-72", "color-72"], ["#48746d", "color-73", "color-73"], ["#6d8143", "color-74", "color-74"], ["#72584b", "color-75", "color-75"], ["#915b2d", "color-76", "color-76"], ["#7e5d5f", "color-77", "color-77"], ["#694863", "color-78", "color-78"], ["#843031", "color-79", "color-79"], ["#838484", "color-80", "color-80"], ["#b48d56", "color-81", "color-81"], ["#90a959", "color-82", "color-82"], ["#677174", "color-83", "color-83"], ["#2c7d6e", "color-84", "color-84"], ["#3d6837", "color-85", "color-85"], ["#ce7a4e", "color-86", "color-86"], ["#ff505b", "color-87", "color-87"], ["#e69dd6", "color-88", "color-88"], ["#eb595a", "color-89", "color-89"], ["#7f7869", "color-90", "color-90"], ["#ff9300", "color-91", "color-91"], ["#8f5536", "color-92", "color-92"], ["#d4843e", "color-93", "color-93"], ["#fc505b", "color-94", "color-94"], ["#68295b", "color-95", "color-95"], ["#5d54e1", "color-96", "color-96"], ["#ac4142", "color-97", "color-97"], ["#716e68", "color-98", "color-98"], ["#ffcc0e", "color-99", "color-99"], ["#ffd700", "gold", "gold"], ["#8b0000", "darkred", "darkred"], ["#f0e68c", "khaki", "khaki"], ["#8b008b", "dark-magenta", "dark-magenta"], ["#ff4500", "orange-red", "orange-red"], ["#deb887", "burlywood", "burlywood"], ["#cd8500", "orange3", "orange"], ["#00008b", "dark-blue", "dark-blue"], ["#9400d3", "dark-violet", "dark-violet"], ["#8b1a1a", "firebrick4", "firebrick"], ["#fff8dc", "cornsilk", "cornsilk"], ["#f5deb3", "wheat", "wheat"], ["#cd0000", "red3", "red"], ["#0000cd", "blue3", "blue"], ["#cc9393", "color-114", "color-114"], ["#bebebe", "gray", "gray"], ["#88090b", "color-116", "color-116"], ["#707183", "color-117", "color-117"], ["#7388d6", "color-118", "color-118"], ["#909183", "color-119", "color-119"], ["#709870", "color-120", "color-120"], ["#907373", "color-121", "color-121"], ["#6276ba", "color-122", "color-122"], ["#858580", "color-123", "color-123"], ["#80a880", "color-124", "color-124"], ["#887070", "color-125", "color-125"], ["#1e90ff", "dodger-blue", "dodger-blue"], ["#ff69b4", "hot-pink", "hot-pink"], ["#da70d6", "orchid", "orchid"], ["#fa8072", "salmon", "salmon"], ["#00ff7f", "spring-green", "spring-green"], ["#800040", "color-131", "color-131"], ["#603f00", "color-132", "color-132"], ["#004476", "color-133", "color-133"], ["#2266ff", "color-134", "color-134"], ["#dd4488", "color-135", "color-135"], ["#8fbc8f", "color-136", "color-136"], ["#5f9ea0", "color-137", "color-137"], ["#ffffe0", "lightyellow1", "lightyellow"], ["#3e3c36", "color-139", "color-139"], ["#8b8989", "snow4", "snow"], ["#242424", "grey14", "grey"], ["#cd69c9", "orchid3", "orchid"], ["#dda0dd", "plum", "plum"], ["#000053", "color-144", "color-144"], ["#001970", "color-145", "color-145"], ["#002984", "color-146", "color-146"], ["#49599a", "color-147", "color-147"], ["#9499b7", "color-148", "color-148"], ["#cdc9c9", "snow3", "snow"], ["#eeb422", "goldenrod2", "goldenrod"], ["#68228b", "darkorchid4", "darkorchid"]], SYNTAX={"kw": {"fg": "#d3d3d3", "bg": null, "distant-fg": null, "family": null, "weight": "bold", "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "bi": {"fg": "#d3d3d3", "bg": null, "distant-fg": null, "family": null, "weight": "bold", "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "pp": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": "font-lock-builtin-face", "height": null}, "fnd": {"fg": "#0000ff", "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "fnc": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": "font-lock-function-name-face", "height": null}, "dec": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "ty": {"fg": "#e5e5e5", "bg": null, "distant-fg": null, "family": null, "weight": "bold", "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "prop": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": "font-lock-variable-name-face", "height": null}, "con": {"fg": "#d3d3d3", "bg": null, "distant-fg": null, "family": null, "weight": "bold", "slant": null, "underline": {"style": "line", "color": null}, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "num": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "esc": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": "font-lock-regexp-grouping-backslash", "height": null}, "str": {"fg": "#696969", "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": "italic", "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "re": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": "font-lock-string-face", "height": null}, "doc": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": "font-lock-string-face", "height": null}, "cm": {"fg": "#696969", "bg": null, "distant-fg": null, "family": null, "weight": "bold", "slant": "italic", "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "cmd": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": "font-lock-comment-face", "height": null}, "var": {"fg": "#e5e5e5", "bg": null, "distant-fg": null, "family": null, "weight": "bold", "slant": "italic", "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "op": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "punc": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "p": {"fg": "#000000", "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "bg": {"fg": "#ffffff", "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}}, UIMAP={"cursor": {"fg": null, "bg": "#000000", "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "region": {"fg": null, "bg": "#eedc82", "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": true, "inherit": null, "height": null}, "hl-line": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": true, "inherit": "highlight", "height": null}, "highlight": {"fg": null, "bg": "#b4eeb4", "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "mode-line": {"fg": "#000000", "bg": "#bfbfbf", "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": {"style": "released", "width": 1, "color": null}, "inverse": false, "extend": false, "inherit": null, "height": null}, "mode-line-highlight": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": {"style": "released", "width": 1, "color": null}, "inverse": false, "extend": false, "inherit": null, "height": null}, "mode-line-inactive": {"fg": "#333333", "bg": "#e5e5e5", "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": {"style": "line", "width": 1, "color": "#bfbfbf"}, "inverse": false, "extend": false, "inherit": "mode-line", "height": null}, "fringe": {"fg": null, "bg": "#f2f2f2", "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "line-number": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": ["shadow", "default"], "height": null}, "line-number-current-line": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": "line-number", "height": null}, "minibuffer-prompt": {"fg": "#ff00ff", "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "isearch": {"fg": "#b0e2ff", "bg": "#cd00cd", "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "lazy-highlight": {"fg": null, "bg": "#afeeee", "distant-fg": "#000000", "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "isearch-fail": {"fg": null, "bg": "#ffc1c1", "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "show-paren-match": {"fg": null, "bg": "#40e0d0", "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "show-paren-mismatch": {"fg": "#ffffff", "bg": "#a020f0", "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "link": {"fg": "#3a5fcd", "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": {"style": "line", "color": null}, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "error": {"fg": "#ff0000", "bg": null, "distant-fg": null, "family": null, "weight": "bold", "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "warning": {"fg": "#ff8c00", "bg": null, "distant-fg": null, "family": null, "weight": "bold", "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "success": {"fg": "#228b22", "bg": null, "distant-fg": null, "family": null, "weight": "bold", "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "vertical-border": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}}; +let MAP={"kw": "#d3d3d3", "bi": "#d3d3d3", "pp": "#d3d3d3", "fnd": "#0000ff", "fnc": "#0000ff", "dec": "", "ty": "#e5e5e5", "prop": "#e5e5e5", "con": "#d3d3d3", "num": "#000000", "esc": "#000000", "str": "#696969", "re": "#696969", "doc": "#696969", "cm": "#696969", "cmd": "#696969", "var": "#e5e5e5", "op": "#000000", "punc": "#000000", "p": "#000000", "bg": "#ffffff", "dmark": "#d3d3d3", "neg": "#000000", "rxgb": "#000000", "rxgc": "#000000", "warn": "#ff0000"}, PALETTE=[["#ffffff", "bg", "ground"], ["#000000", "fg", "ground"], ["#d3d3d3", "lightgray", "lightgray"], ["#0000ff", "blue1", "blue"], ["#e5e5e5", "gray90", "gray"], ["#696969", "dimgray", "dimgray"], ["#ff0000", "red", "red"], ["#eedc82", "lightgoldenrod2", "lightgoldenrod"], ["#b4eeb4", "darkseagreen2", "darkseagreen"], ["#bfbfbf", "grey75", "grey"], ["#333333", "grey20", "grey"], ["#f2f2f2", "grey95", "grey"], ["#ff00ff", "magenta", "magenta"], ["#b0e2ff", "lightskyblue1", "lightskyblue"], ["#cd00cd", "magenta3", "magenta"], ["#afeeee", "paleturquoise", "paleturquoise"], ["#ffc1c1", "rosybrown1", "rosybrown"], ["#40e0d0", "turquoise", "turquoise"], ["#a020f0", "purple", "purple"], ["#3a5fcd", "royalblue3", "royalblue"], ["#ff8c00", "dark-orange", "dark-orange"], ["#228b22", "forestgreen", "forestgreen"], ["#8b6508", "darkgoldenrod4", "darkgoldenrod"], ["#8b4c39", "salmon4", "salmon"], ["#22aa22", "color-24", "color-24"], ["#ddffdd", "color-25", "color-25"], ["#cceecc", "color-26", "color-26"], ["#aa2222", "color-27", "color-27"], ["#ffdddd", "color-28", "color-28"], ["#eecccc", "color-29", "color-29"], ["#7f7f7f", "grey50", "grey"], ["#cccccc", "grey80", "grey"], ["#cd8162", "lightsalmon3", "lightsalmon"], ["#aaaa11", "color-33", "color-33"], ["#ffffcc", "color-34", "color-34"], ["#eeeebb", "color-35", "color-35"], ["#4a708b", "skyblue4", "skyblue"], ["#6e8b3d", "darkolivegreen4", "darkolivegreen"], ["#8b6914", "goldenrod4", "goldenrod"], ["#999999", "grey60", "grey"], ["#4d4d4d", "grey30", "grey"], ["#b22222", "firebrick", "firebrick"], ["#00ff00", "green", "green"], ["#556b2f", "darkolivegreen", "darkolivegreen"], ["#8b3a3a", "indianred4", "indianred"], ["#b8860b", "darkgoldenrod", "darkgoldenrod"], ["#00ffff", "cyan", "cyan"], ["#66cdaa", "medium-aquamarine", "medium-aquamarine"], ["#ffa500", "orange", "orange"], ["#d02090", "violet-red", "violet-red"], ["#add8e6", "light-blue", "light-blue"], ["#cd5c5c", "indian-red", "indian-red"], ["#aaa", "color-52", "color-52"], ["#000", "color-53", "color-53"], ["#aa0", "color-54", "color-54"], ["#070", "color-55", "color-55"], ["#daa520", "goldenrod", "goldenrod"], ["#00bfff", "deep-sky-blue", "deep-sky-blue"], ["#ee00ee", "magenta2", "magenta"], ["#ffff00", "yellow", "yellow"], ["#6b6b6b", "color-60", "color-60"], ["#979797", "color-61", "color-61"], ["unspecified", "color-62", "color-62"], ["#223fbf", "color-63", "color-63"], ["#8f0075", "color-64", "color-64"], ["#145a00", "color-65", "color-65"], ["#804000", "color-66", "color-66"], ["#efcbcf", "color-67", "color-67"], ["#6a9fb5", "color-68", "color-68"], ["#2188b6", "color-69", "color-69"], ["#75b5aa", "color-70", "color-70"], ["#0595bd", "color-71", "color-71"], ["#446674", "color-72", "color-72"], ["#48746d", "color-73", "color-73"], ["#6d8143", "color-74", "color-74"], ["#72584b", "color-75", "color-75"], ["#915b2d", "color-76", "color-76"], ["#7e5d5f", "color-77", "color-77"], ["#694863", "color-78", "color-78"], ["#843031", "color-79", "color-79"], ["#838484", "color-80", "color-80"], ["#b48d56", "color-81", "color-81"], ["#90a959", "color-82", "color-82"], ["#677174", "color-83", "color-83"], ["#2c7d6e", "color-84", "color-84"], ["#3d6837", "color-85", "color-85"], ["#ce7a4e", "color-86", "color-86"], ["#ff505b", "color-87", "color-87"], ["#e69dd6", "color-88", "color-88"], ["#eb595a", "color-89", "color-89"], ["#7f7869", "color-90", "color-90"], ["#ff9300", "color-91", "color-91"], ["#8f5536", "color-92", "color-92"], ["#d4843e", "color-93", "color-93"], ["#fc505b", "color-94", "color-94"], ["#68295b", "color-95", "color-95"], ["#5d54e1", "color-96", "color-96"], ["#ac4142", "color-97", "color-97"], ["#716e68", "color-98", "color-98"], ["#ffcc0e", "color-99", "color-99"], ["#ffd700", "gold", "gold"], ["#8b0000", "darkred", "darkred"], ["#f0e68c", "khaki", "khaki"], ["#8b008b", "dark-magenta", "dark-magenta"], ["#ff4500", "orange-red", "orange-red"], ["#deb887", "burlywood", "burlywood"], ["#cd8500", "orange3", "orange"], ["#00008b", "dark-blue", "dark-blue"], ["#9400d3", "dark-violet", "dark-violet"], ["#8b1a1a", "firebrick4", "firebrick"], ["#fff8dc", "cornsilk", "cornsilk"], ["#f5deb3", "wheat", "wheat"], ["#cd0000", "red3", "red"], ["#0000cd", "blue3", "blue"], ["#cc9393", "color-114", "color-114"], ["#bebebe", "gray", "gray"], ["#88090b", "color-116", "color-116"], ["#707183", "color-117", "color-117"], ["#7388d6", "color-118", "color-118"], ["#909183", "color-119", "color-119"], ["#709870", "color-120", "color-120"], ["#907373", "color-121", "color-121"], ["#6276ba", "color-122", "color-122"], ["#858580", "color-123", "color-123"], ["#80a880", "color-124", "color-124"], ["#887070", "color-125", "color-125"], ["#1e90ff", "dodger-blue", "dodger-blue"], ["#ff69b4", "hot-pink", "hot-pink"], ["#da70d6", "orchid", "orchid"], ["#fa8072", "salmon", "salmon"], ["#00ff7f", "spring-green", "spring-green"], ["#800040", "color-131", "color-131"], ["#603f00", "color-132", "color-132"], ["#004476", "color-133", "color-133"], ["#2266ff", "color-134", "color-134"], ["#dd4488", "color-135", "color-135"], ["#8fbc8f", "color-136", "color-136"], ["#5f9ea0", "color-137", "color-137"], ["#ffffe0", "lightyellow1", "lightyellow"], ["#3e3c36", "color-139", "color-139"], ["#8b8989", "snow4", "snow"], ["#242424", "grey14", "grey"], ["#cd69c9", "orchid3", "orchid"], ["#dda0dd", "plum", "plum"], ["#000053", "color-144", "color-144"], ["#001970", "color-145", "color-145"], ["#002984", "color-146", "color-146"], ["#49599a", "color-147", "color-147"], ["#9499b7", "color-148", "color-148"], ["#cdc9c9", "snow3", "snow"], ["#eeb422", "goldenrod2", "goldenrod"], ["#68228b", "darkorchid4", "darkorchid"]], SYNTAX={"kw": {"fg": "#d3d3d3", "bg": null, "distant-fg": null, "family": null, "weight": "bold", "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "bi": {"fg": "#d3d3d3", "bg": null, "distant-fg": null, "family": null, "weight": "bold", "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "pp": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": "font-lock-builtin-face", "height": null}, "fnd": {"fg": "#0000ff", "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "fnc": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": "font-lock-function-name-face", "height": null}, "dec": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "ty": {"fg": "#e5e5e5", "bg": null, "distant-fg": null, "family": null, "weight": "bold", "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "prop": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": "font-lock-variable-name-face", "height": null}, "con": {"fg": "#d3d3d3", "bg": null, "distant-fg": null, "family": null, "weight": "bold", "slant": null, "underline": {"style": "line", "color": null}, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "num": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "esc": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": "font-lock-regexp-grouping-backslash", "height": null}, "str": {"fg": "#696969", "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": "italic", "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "re": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": "font-lock-string-face", "height": null}, "doc": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": "font-lock-string-face", "height": null}, "cm": {"fg": "#696969", "bg": null, "distant-fg": null, "family": null, "weight": "bold", "slant": "italic", "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "cmd": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": "font-lock-comment-face", "height": null}, "var": {"fg": "#e5e5e5", "bg": null, "distant-fg": null, "family": null, "weight": "bold", "slant": "italic", "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "op": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "punc": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "p": {"fg": "#000000", "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "bg": {"fg": "#ffffff", "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}}, UIMAP={"cursor": {"fg": null, "bg": "#000000", "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "region": {"fg": null, "bg": "#eedc82", "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": true, "inherit": null, "height": null}, "hl-line": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": true, "inherit": "highlight", "height": null}, "highlight": {"fg": null, "bg": "#b4eeb4", "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "mode-line": {"fg": "#000000", "bg": "#bfbfbf", "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": {"style": "released", "width": 1, "color": null}, "inverse": false, "extend": false, "inherit": null, "height": null}, "mode-line-highlight": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": {"style": "released", "width": 1, "color": null}, "inverse": false, "extend": false, "inherit": null, "height": null}, "mode-line-inactive": {"fg": "#333333", "bg": "#e5e5e5", "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": {"style": "line", "width": 1, "color": "#bfbfbf"}, "inverse": false, "extend": false, "inherit": "mode-line", "height": null}, "fringe": {"fg": null, "bg": "#f2f2f2", "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "line-number": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": ["shadow", "default"], "height": null}, "line-number-current-line": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": "line-number", "height": null}, "minibuffer-prompt": {"fg": "#ff00ff", "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "isearch": {"fg": "#b0e2ff", "bg": "#cd00cd", "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "lazy-highlight": {"fg": null, "bg": "#afeeee", "distant-fg": "#000000", "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "isearch-fail": {"fg": null, "bg": "#ffc1c1", "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "show-paren-match": {"fg": null, "bg": "#40e0d0", "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "show-paren-mismatch": {"fg": "#ffffff", "bg": "#a020f0", "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "link": {"fg": "#3a5fcd", "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": {"style": "line", "color": null}, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "error": {"fg": "#ff0000", "bg": null, "distant-fg": null, "family": null, "weight": "bold", "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "warning": {"fg": "#ff8c00", "bg": null, "distant-fg": null, "family": null, "weight": "bold", "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "success": {"fg": "#228b22", "bg": null, "distant-fg": null, "family": null, "weight": "bold", "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}, "vertical-border": {"fg": null, "bg": null, "distant-fg": null, "family": null, "weight": null, "slant": null, "underline": null, "strike": null, "overline": null, "box": null, "inverse": false, "extend": false, "inherit": null, "height": null}}; let LOCKED=new Set([]); // rows whose choice is decided (controls disabled, skipped by erase/reset batch actions) const DELTAE_MIN=0.02; // OKLab ΔE below this = colors too close to tell apart (perceptual-metrics spec) const DEFAULT_UIMAP=JSON.parse(JSON.stringify(UIMAP)); @@ -2819,14 +2819,6 @@ function renderElfeedPreview(){const a='elfeed',L=[]; L.push(os(a,'elfeed-log-date-face','02:24:03')+' '+os(a,'elfeed-log-error-level-face','ERROR')+' failed: bad.example'); L.push(os(a,'elfeed-log-date-face','02:24:04')+' '+os(a,'elfeed-log-debug-level-face','DEBUG')+' parsed 340 entries'); return previewLines(L);} -function renderGhostelPreview(){const a='ghostel',L=[]; - L.push(os(a,'ghostel-default','craig@host')+' '+os(a,'ghostel-color-green','~/code')+' $ ls'+os(a,'ghostel-fake-cursor',' ')+os(a,'ghostel-fake-cursor-box','[ ]')); - L.push(''); - L.push(os(a,'ghostel-default','normal:')+' '+os(a,'ghostel-color-black','black')+' '+os(a,'ghostel-color-red','red')+' '+os(a,'ghostel-color-green','green')+' '+os(a,'ghostel-color-yellow','yellow')+' '+os(a,'ghostel-color-blue','blue')+' '+os(a,'ghostel-color-magenta','magenta')+' '+os(a,'ghostel-color-cyan','cyan')+' '+os(a,'ghostel-color-white','white')); - L.push(os(a,'ghostel-default','bright:')+' '+os(a,'ghostel-color-bright-black','black')+' '+os(a,'ghostel-color-bright-red','red')+' '+os(a,'ghostel-color-bright-green','green')+' '+os(a,'ghostel-color-bright-yellow','yellow')+' '+os(a,'ghostel-color-bright-blue','blue')+' '+os(a,'ghostel-color-bright-magenta','magenta')+' '+os(a,'ghostel-color-bright-cyan','cyan')+' '+os(a,'ghostel-color-bright-white','white')); - L.push(''); - L.push(os(a,'ghostel-default','default terminal output, 256-color text and a blinking ')+os(a,'ghostel-fake-cursor','cursor')+'.'); - return previewLines(L);} function renderDashboardPreview(){const a='dashboard',L=[]; L.push(os(a,'dashboard-text-banner',' [ dashboard banner image ]')); L.push(os(a,'dashboard-banner-logo-title','Emacs: The Editor That Saves Your Soul')); @@ -2961,17 +2953,60 @@ function renderGitGutterPreview(){const a='git-gutter',L=[]; L.push(os(a,'git-gutter:deleted','_')+os(a,'git-gutter:separator','|')+' (deleted lines marker)'); L.push(os(a,'git-gutter:unchanged',' ')+os(a,'git-gutter:separator','|')+' '+os(a,'git-gutter:unchanged','unchanged line of code')); return previewLines(L);} -function renderEatPreview(){const a='eat',L=[]; - L.push(os(a,'eat-shell-prompt-annotation-success','✔')+' ~/projects $ ls --color'); - L.push(os(a,'eat-term-color-blue','build/')+' '+os(a,'eat-term-color-blue','src/')+' '+os(a,'eat-term-color-green','run.sh')+' README.md'); +function renderEatPreview(){const a='eat',L=[],c=(f,t)=>os(a,'eat-term-color-'+f,t),x=(f,t)=>os(a,'eat-term-'+f,t),an=(g,t)=>os(a,'eat-shell-prompt-annotation-'+g,t); + const p=g=>an(g,g==='success'?'✔':g==='failure'?'✘':'…')+' ~/projects/app $ '; + // 1. directory listing -- the widest palette block (dircolors) + L.push(p('success')+'eza -la --color'); + L.push('drwxr-xr-x - 14:02 '+c('blue','.git/')); + L.push('.rw-r--r-- 120 09:11 .gitignore'); + L.push('drwxr-xr-x - 14:02 '+c('blue','src/')); + L.push('drwxr-xr-x - 13:48 '+c('blue','tests/')); + L.push('.rwxr-xr-x 2.1k 14:00 '+c('bright-green','run.sh')); + L.push('lrwxr-xr-x - 14:01 '+c('cyan','latest')+' -> '+c('blue','v2.1/')); + L.push('.rw-r--r-- 4.5M 22:30 '+c('red','backup.tar.gz')); + L.push('.rw-r--r-- 88k 18:05 '+c('magenta','logo.png')); + L.push('.rw-r--r-- 3.2k 14:02 README.md'); L.push(''); - L.push('palette '+os(a,'eat-term-color-black','■')+os(a,'eat-term-color-red','■')+os(a,'eat-term-color-green','■')+os(a,'eat-term-color-yellow','■')+os(a,'eat-term-color-blue','■')+os(a,'eat-term-color-magenta','■')+os(a,'eat-term-color-cyan','■')+os(a,'eat-term-color-white','■')+' normal'); - L.push(' '+os(a,'eat-term-color-bright-black','■')+os(a,'eat-term-color-bright-red','■')+os(a,'eat-term-color-bright-green','■')+os(a,'eat-term-color-bright-yellow','■')+os(a,'eat-term-color-bright-blue','■')+os(a,'eat-term-color-bright-magenta','■')+os(a,'eat-term-color-bright-cyan','■')+os(a,'eat-term-color-bright-white','■')+' bright'); + // 2. git status -- staged green, unstaged/untracked red + L.push(p('success')+'git status -sb'); + L.push(c('bright-cyan','## main...origin/main [ahead 2]')); + L.push(c('green','A src/eat-preview.js')); + L.push(c('green','A src/cache.el')); + L.push(c('green','M README.md')); + L.push(c('red',' M init.el')); + L.push(c('red',' M modules/term-config.el')); + L.push(c('red',' D modules/old-vterm.el')); + L.push(c('red','?? docs/design/eat.org')); + L.push(c('red','?? scratch.txt')); L.push(''); - L.push(os(a,'eat-term-bold','bold')+' '+os(a,'eat-term-faint','faint')+' '+os(a,'eat-term-italic','italic')+' '+os(a,'eat-term-slow-blink','slow-blink')+' '+os(a,'eat-term-fast-blink','fast-blink')); + // 3. git log --decorate -- yellow hashes, colored refs, a merge + L.push(p('success')+'git log --oneline --graph --decorate'); + L.push(c('bright-black','* ')+c('yellow','a1b2c3d')+' '+c('bright-cyan','(HEAD -> ')+c('bright-green','main')+c('bright-cyan',')')+' richer eat preview blocks'); + L.push(c('bright-black','* ')+c('yellow','9f8e7d6')+' '+c('bright-yellow','(tag: v2.1, ')+c('bright-red','origin/main')+c('bright-yellow',')')+' lowercase the labels'); + L.push(c('bright-black','* ')+c('yellow','3c4d5e6')+' Merge branch '+c('green',"'eat-faces'")); + L.push(c('bright-black','|\\ ')); + L.push(c('bright-black','| * ')+c('yellow','7a8b9c0')+' expose eat faces to studio'); + L.push(c('bright-black','| * ')+c('yellow','1d2e3f4')+' add eat-term-color docstrings'); + L.push(c('bright-black','|/ ')); + L.push(c('bright-black','* ')+c('yellow','5f6a7b8')+' default video player to mpv'); + L.push(c('bright-black','* ')+c('yellow','2c3d4e5')+' calendar-sync robustness fixes'); L.push(''); - L.push(os(a,'eat-shell-prompt-annotation-running','…')+' running tests'); - L.push(os(a,'eat-shell-prompt-annotation-failure','✘')+' build failed'); + // 4. test run -- pass green, skip yellow, fail red, bold summary, faint detail + L.push(p('failure')+'make test'); + L.push(c('green','✔ PASS')+' term-toggle '+x('faint','(19 tests)')); + L.push(c('green','✔ PASS')+' ai-term '+x('faint','(158 tests)')); + L.push(c('green','✔ PASS')+' calendar-sync '+x('faint','(575 tests)')); + L.push(c('green','✔ PASS')+' dashboard '+x('faint','(18 tests)')); + L.push(c('yellow','⚠ SKIP')+' network-sync '+x('faint','(2 tests, offline)')); + L.push(c('green','✔ PASS')+' transcription '+x('faint','(44 tests)')); + L.push(c('red','✘ FAIL')+' org-roam-refile '+x('faint','(1 test)')); + L.push(' '+x('italic','expected 3 refile targets, got 0')); + L.push(x('bold','Ran 817 tests, 815 passed, ')+c('yellow','1 skipped, ')+c('red','1 failed')+' '+x('faint','0.84s')); + L.push(''); + // swatch reference key, below the realistic blocks + L.push(x('faint','palette')+' '+c('black','■')+c('red','■')+c('green','■')+c('yellow','■')+c('blue','■')+c('magenta','■')+c('cyan','■')+c('white','■')+' '+c('bright-black','■')+c('bright-red','■')+c('bright-green','■')+c('bright-yellow','■')+c('bright-blue','■')+c('bright-magenta','■')+c('bright-cyan','■')+c('bright-white','■')); + L.push(x('faint','attrs')+' '+x('bold','bold')+' '+x('faint','faint')+' '+x('italic','italic')+' '+x('slow-blink','slow-blink')+' '+x('fast-blink','fast-blink')); + L.push(x('faint','prompt')+' '+an('success','✔ ok')+' '+an('running','… running')+' '+an('failure','✘ failed')); return previewLines(L);} function renderFlycheckPreview(){const a='flycheck',L=[]; L.push(os(a,'flycheck-fringe-error','E')+os(a,'flycheck-fringe-warning','W')+os(a,'flycheck-fringe-info','I')+' x = '+os(a,'flycheck-error','undefined_name')+'('+os(a,'flycheck-warning','unused_arg')+') '+os(a,'flycheck-info','# note')); @@ -2995,18 +3030,59 @@ function renderDiredPreview(){const a='dired',L=[]; L.push(' '+os(a,'dired-special','prw-r--r--')+' craig 0 fifo.pipe'); L.push(os(a,'dired-warning','! disk space low on /home')); return previewLines(L);} -function renderDirvishPreview(){const a='dirvish',L=[]; - L.push(os(a,'dirvish-inactive','~/code')+' '+os(a,'dirvish-free-space','[free 24G]')); - L.push(os(a,'dirvish-hl-line',' '+os(a,'dirvish-file-modes','-rw-r--r--')+' '+os(a,'dirvish-file-link-number','1')+' '+os(a,'dirvish-file-user-id','craig')+' '+os(a,'dirvish-file-group-id','staff')+' '+os(a,'dirvish-file-size','4.0K')+' '+os(a,'dirvish-file-time','Jun 8 02:24')+' init.el ')); - L.push(' '+os(a,'dirvish-file-modes','drwxr-xr-x')+' '+os(a,'dirvish-file-link-number','5')+' '+os(a,'dirvish-file-user-id','craig')+' '+os(a,'dirvish-file-group-id','staff')+' '+os(a,'dirvish-file-size',' - ')+' '+os(a,'dirvish-file-time','Jun 7 18:00')+' '+os(a,'dirvish-collapse-dir-face','src')+os(a,'dirvish-subtree-state','+')+os(a,'dirvish-subtree-guide',' |')); - L.push(os(a,'dirvish-hl-line-inactive',' inactive-window current line ')); - L.push(' inode '+os(a,'dirvish-file-inode-number','1048576')+' dev '+os(a,'dirvish-file-device-number','8,1')+' '+os(a,'dirvish-collapse-empty-dir-face','empty/')+' '+os(a,'dirvish-collapse-file-face','file.txt')); - L.push(' VC '+os(a,'dirvish-vc-added-state','A')+os(a,'dirvish-vc-edited-state','M')+os(a,'dirvish-vc-removed-state','D')+os(a,'dirvish-vc-conflict-state','C')+os(a,'dirvish-vc-locked-state','L')+os(a,'dirvish-vc-missing-state','!')+os(a,'dirvish-vc-needs-merge-face','m')+os(a,'dirvish-vc-needs-update-state','u')+os(a,'dirvish-vc-unregistered-face','?')); - L.push(' git '+os(a,'dirvish-git-commit-message-face','feat: enlarge the picker')); - L.push(' '+os(a,'dirvish-media-info-heading','Media')+' '+os(a,'dirvish-media-info-property-key','Dimensions:')+' 1920x1080'); - L.push(' proc '+os(a,'dirvish-proc-running','running')+' / '+os(a,'dirvish-proc-finished','finished')+' / '+os(a,'dirvish-proc-failed','failed')); - L.push(' narrow '+os(a,'dirvish-narrow-match-face-0','m0')+' '+os(a,'dirvish-narrow-match-face-1','m1')+' '+os(a,'dirvish-narrow-match-face-2','m2')+' '+os(a,'dirvish-narrow-match-face-3','m3')+os(a,'dirvish-narrow-split',' | ')+os(a,'dirvish-emerge-group-title','Group: images')); - return previewLines(L);} +// A believable two-pane dirvish: an active directory listing on the left +// (nerd-icon per file type, dir-entry counts / file sizes, the hl-line on the +// selected row, a dimmed backup) and the selected dir's ls-l preview on the +// right. Faces that don't fit a calm listing (vc, git, subtree, media, proc, +// narrow, emerge) live in a labeled extras strip below so theme coverage stays +// complete. Glyphs/colors mirror what nerd-icons actually emits per type. +function renderDirvishPreview(){ + const D='dirvish', N='nerd-icons', DR='dired'; + // foreground-only span, so a row background (the hl-line) shows through it + const fg=(app,face,t)=>`<span style="color:${effFg(pkgEffFg(app,face))}">${t}</span>`; + const ic=(face,g)=>os(N,face,g); + const pad=(name,w)=>esc(name)+' '.repeat(Math.max(1,w-name.length)); + const HL=pkgEffBg(D,'dirvish-hl-line')||MAP['bg']; + + // ---- left pane: the active directory ---- + const left=[os(DR,'dired-header','~/code/emacs-wttrin:')]; + for(const [name,cnt,sel] of [['assets','4',true],['examples','1'],['githooks','1'], + ['inbox','3'],['scripts','1'],['tests','71']]){ + if(sel) left.push(`<span style="background:${HL}">`+fg(N,'nerd-icons-yellow','')+' ' + +fg(DR,'dired-directory',pad(name,21))+fg(D,'dirvish-file-size',cnt)+`</span>`); + else left.push(ic('nerd-icons-yellow','')+' '+os(DR,'dired-directory',pad(name,21)) + +os(D,'dirvish-file-size',cnt)); + } + for(const [face,g,name,size] of [['nerd-icons-lblue','','CLAUDE.md','4.9k'], + ['nerd-icons-blue','','Eask','518'],['nerd-icons-blue','','LICENSE','34k'], + ['nerd-icons-dorange','','Makefile','12k'],['nerd-icons-lcyan','','README.org','24k'], + ['nerd-icons-lgreen','','todo.org','23k'],['nerd-icons-purple','','wttrin.el','69k'], + ['nerd-icons-dsilver','','wttrin.elc','4.3k']]) + left.push(ic(face,g)+' '+pad(name,21)+os(D,'dirvish-file-size',size)); + left.push(ic('nerd-icons-lgreen','')+' '+os(DR,'dired-ignored',pad('todo.org~',21)) + +os(D,'dirvish-file-size','8.8k')); + + // ---- right pane: ls -l preview of the selected dir ---- + const ll=(size,time,name)=>os(D,'dirvish-file-modes','-rw-r--r--')+' ' + +os(D,'dirvish-file-link-number','1')+' '+os(D,'dirvish-file-user-id','cjennings')+' ' + +os(D,'dirvish-file-group-id','cjennings')+' '+os(D,'dirvish-file-size',size)+' ' + +os(D,'dirvish-file-time',time)+' '+ic('nerd-icons-orange','\u{F0E2D}')+' '+esc(name); + const right=[os(DR,'dired-header','assets:'), + ll('54K','Jun 26 10:53','geolocation.png'),ll('52K','Jun 26 10:53','location-menu.png'), + ll('3.1K','Apr 10 12:03','made-for-emacs.svg'),ll('346K','Jun 26 10:53','wttrin.png')]; + + // ---- extras: remaining dirvish faces, kept for theme coverage ---- + const ex=[ + os(D,'dirvish-inactive','inactive pane')+' '+os(D,'dirvish-hl-line-inactive',' inactive current line ')+' '+os(D,'dirvish-free-space','[free 24G]'), + 'vc '+os(D,'dirvish-vc-added-state','A')+os(D,'dirvish-vc-edited-state','M')+os(D,'dirvish-vc-removed-state','D')+os(D,'dirvish-vc-conflict-state','C')+os(D,'dirvish-vc-locked-state','L')+os(D,'dirvish-vc-missing-state','!')+os(D,'dirvish-vc-needs-merge-face','m')+os(D,'dirvish-vc-needs-update-state','u')+os(D,'dirvish-vc-unregistered-face','?')+' git '+os(D,'dirvish-git-commit-message-face','feat: enlarge the picker'), + 'subtree '+os(D,'dirvish-collapse-dir-face','src')+os(D,'dirvish-subtree-state','+')+os(D,'dirvish-subtree-guide',' | ')+os(D,'dirvish-collapse-empty-dir-face','empty/')+' '+os(D,'dirvish-collapse-file-face','file.txt')+' inode '+os(D,'dirvish-file-inode-number','1048576')+' dev '+os(D,'dirvish-file-device-number','8,1'), + 'media '+os(D,'dirvish-media-info-heading','Media')+' '+os(D,'dirvish-media-info-property-key','Dimensions:')+' 1920x1080 proc '+os(D,'dirvish-proc-running','running')+'/'+os(D,'dirvish-proc-finished','finished')+'/'+os(D,'dirvish-proc-failed','failed'), + 'narrow '+os(D,'dirvish-narrow-match-face-0','m0')+' '+os(D,'dirvish-narrow-match-face-1','m1')+' '+os(D,'dirvish-narrow-match-face-2','m2')+' '+os(D,'dirvish-narrow-match-face-3','m3')+os(D,'dirvish-narrow-split',' | ')+os(D,'dirvish-emerge-group-title','Group: images')]; + + const col=(lines)=>`<div style="white-space:pre">${lines.join('\n')}</div>`; + return `<div style="padding:12px 16px;font:12pt/1.7 ${PREVIEW_FONT}">` + +`<div style="display:flex;gap:2.5em">${col(left)}${col(right)}</div>` + +`<div style="margin-top:1.2em;opacity:0.9">${col(ex)}</div></div>`;} function renderCalibredbPreview(){const a='calibredb',L=[]; L.push(os(a,'calibredb-search-header-library-name-face','Calibre')+' '+os(a,'calibredb-search-header-library-path-face','~/books')+' '+os(a,'calibredb-search-header-total-face','412 books')+' '+os(a,'calibredb-search-header-filter-face','tag:scifi')+' '+os(a,'calibredb-search-header-sort-face','sort:date')+' '+os(a,'calibredb-search-header-highlight-face','[*]')); L.push(''); @@ -3060,6 +3136,38 @@ function renderShrPreview(){const a='shr',L=[]; L.push(os(a,'shr-text','some ')+os(a,'shr-code','inline_code()')+os(a,'shr-text',', a ')+os(a,'shr-mark','highlighted mark')+os(a,'shr-text',', ')+os(a,'shr-strike-through','struck out')+os(a,'shr-text',', a footnote')+os(a,'shr-sup','[1]')+os(a,'shr-text',',')); L.push(os(a,'shr-text','an ')+os(a,'shr-abbreviation','HTML')+os(a,'shr-text',' abbreviation, and an ')+os(a,'shr-sliced-image','[image]')+os(a,'shr-text',' slice.')); return previewLines(L);} +// nov-reading: a realistic book page per palette, not the line-based format. +// Each palette face supplies the page bg+fg (via ofs); the serif typography and +// hierarchy are CSS so the preview reads like an actual novel page. Tuning a +// palette face repaints its page. data-owner-app/-face keep face-locate working. +function novReadingPage(a,face,label){ + const cls=isLocateOnPane(a,curApp())?' class="locate-onpane"':''; + const title=attresc(formatLocateTitle(locateFaceMeta(a,face,LOCATE_REG))); + const page=ofs(a,face)+";width:34em;max-width:100%;border-radius:6px;box-shadow:0 1px 8px #0007;padding:24px 30px 18px;font:13pt/1.62 Georgia,'Times New Roman',serif"; + // Structural faces recolor the title (heading) and an inline link, derived by + // suffix from the palette face so tuning them in the studio repaints the page. + const hface=face+'-heading',lface=face+'-link'; + const htitle=attresc(formatLocateTitle(locateFaceMeta(a,hface,LOCATE_REG))); + const hfg=effFg(pkgEffFg(a,hface)); + return `<div data-owner-app="${a}" data-face="${face}"${cls} title="${title}" style="${page}">` + +`<div style="text-align:center;font-variant:small-caps;letter-spacing:.08em;font-size:10pt;opacity:.72;margin-bottom:3px">Nathaniel Hawthorne · Twice-Told Tales</div>` + +`<div data-owner-app="${a}" data-face="${hface}"${cls} title="${htitle}" style="text-align:center;font:italic 600 16pt/1.3 Georgia,serif;margin:.15em 0 1em;color:${hfg}">Dr. Heidegger’s Experiment</div>` + +`<p style="margin:0 0 .75em">` + +`<span style="float:left;font:600 320%/.74 Georgia,serif;padding:6px 8px 0 0">T</span>` + +`hat very singular man, old Dr. Heidegger, once invited four venerable friends to meet him in his study. There were three white-bearded gentlemen, Mr. Medbourne, Colonel Killigrew, and Mr. Gascoigne, and a withered gentlewoman whose name was the Widow Wycherly.</p>` + +`<p style="margin:0 0 .75em;text-indent:1.4em">They were all melancholy old creatures, who had been unfortunate in life. <em>If the powder be genuine,</em> said the doctor, `+os(a,lface,'the rose of half a century')+` should bloom again.</p>` + +`<div style="text-align:center;font-size:9.5pt;opacity:.6;margin-top:.7em">${esc(label)} · 12</div>` + +`</div>`;} +function renderNovReadingPreview(){ + const a='nov-reading',faces=(APPS[a]&&APPS[a].faces)||[]; + if(!faces.length)return genericPreview(a); + // One book page per base palette (the bg/fg faces); the per-palette heading + // and link faces color the title and inline link within each page rather than + // getting a page of their own. + const base=faces.filter(r=>!/-heading$|-link$/.test(r[0])); + let h='<div style="padding:14px 16px;display:flex;flex-direction:column;gap:18px;align-items:center">'; + for(const row of base)h+=novReadingPage(a,row[0],row[1]); + return h+'</div>';} function renderSlackPreview(){const a='slack',L=[]; L.push(os(a,'slack-room-info-title-room-name-face','#general')+' '+os(a,'slack-room-info-title-face','Acme Workspace')); L.push(os(a,'slack-room-info-section-title-face','Topic')+' '+os(a,'slack-room-info-section-label-face','daily standup')+' '+os(a,'slack-room-unread-face','3 unread')); @@ -3209,9 +3317,10 @@ function renderNerdIconsPreview(sizePt){ const PACKAGE_PREVIEWS={ autodim:renderAutodimPreview,markdown:renderMarkdownPreview, - org:renderOrgPreview,magit:renderMagitPreview,elfeed:renderElfeedPreview,ghostel:renderGhostelPreview,eat:renderEatPreview, + org:renderOrgPreview,magit:renderMagitPreview,elfeed:renderElfeedPreview,eat:renderEatPreview, dashboard:renderDashboardPreview,mu4e:renderMu4ePreview,gnus:renderGnusPreview,orgfaces:renderOrgFacesPreview,lsp:renderLspPreview,gitgutter:renderGitGutterPreview, flycheck:renderFlycheckPreview,dired:renderDiredPreview,dirvish:renderDirvishPreview,calibredb:renderCalibredbPreview, + novreading:renderNovReadingPreview, erc:renderErcPreview,orgdrill:renderOrgdrillPreview,orgnoter:renderOrgnoterPreview,signel:renderSignelPreview, pearl:renderPearlPreview,slack:renderSlackPreview,telega:renderTelegaPreview,shr:renderShrPreview, nerdicons:renderNerdIconsPreview diff --git a/tests/test-ai-term--agent-buffers.el b/tests/test-ai-term--agent-buffers.el index 20c661c45..e0d8faa79 100644 --- a/tests/test-ai-term--agent-buffers.el +++ b/tests/test-ai-term--agent-buffers.el @@ -14,7 +14,7 @@ (add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) (add-to-list 'load-path (expand-file-name "tests" user-emacs-directory)) (require 'ai-term) -(require 'testutil-ghostel-buffers) +(require 'testutil-terminal-buffers) (ert-deftest test-ai-term--agent-buffers-empty-when-none-exist () "Boundary: no agent-prefixed buffers anywhere -> empty list." diff --git a/tests/test-ai-term--close.el b/tests/test-ai-term--close.el index 4098c091e..242bfd749 100644 --- a/tests/test-ai-term--close.el +++ b/tests/test-ai-term--close.el @@ -2,7 +2,7 @@ ;;; Commentary: ;; `cj/ai-term-close' tears an agent down gracefully: kill its tmux -;; session (stopping the agent process), kill the ghostel buffer, and +;; session (stopping the agent process), kill the agent buffer, and ;; remove its window. These tests cover the pure pieces -- the ;; tmux-kill helper, the per-buffer teardown, and the target selection -- ;; with `process-file' and the prompt mocked at the boundary. @@ -15,7 +15,7 @@ (add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) (add-to-list 'load-path (expand-file-name "tests" user-emacs-directory)) (require 'ai-term) -(require 'testutil-ghostel-buffers) +(require 'testutil-terminal-buffers) (ert-deftest test-ai-term--kill-tmux-session-runs-kill-session () "Normal: invokes `tmux kill-session -t <session>'." diff --git a/tests/test-ai-term--collapse-split.el b/tests/test-ai-term--collapse-split.el index a09af5598..bae913624 100644 --- a/tests/test-ai-term--collapse-split.el +++ b/tests/test-ai-term--collapse-split.el @@ -23,7 +23,7 @@ (add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) (add-to-list 'load-path (expand-file-name "tests" user-emacs-directory)) (require 'ai-term) -(require 'testutil-ghostel-buffers) +(require 'testutil-terminal-buffers) ;;; cj/--ai-term-most-recent-non-agent-buffer diff --git a/tests/test-ai-term--dispatch.el b/tests/test-ai-term--dispatch.el index 91b5e1bc6..129c53cda 100644 --- a/tests/test-ai-term--dispatch.el +++ b/tests/test-ai-term--dispatch.el @@ -16,7 +16,7 @@ (add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) (add-to-list 'load-path (expand-file-name "tests" user-emacs-directory)) (require 'ai-term) -(require 'testutil-ghostel-buffers) +(require 'testutil-terminal-buffers) (ert-deftest test-ai-term--dispatch-window-displayed-returns-toggle-off () "Normal: displayed agent window -> (toggle-off . WIN)." diff --git a/tests/test-ai-term--display-saved.el b/tests/test-ai-term--display-saved.el index 51c22fde9..5707bea5b 100644 --- a/tests/test-ai-term--display-saved.el +++ b/tests/test-ai-term--display-saved.el @@ -26,7 +26,7 @@ (add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) (add-to-list 'load-path (expand-file-name "tests" user-emacs-directory)) (require 'ai-term) -(require 'testutil-ghostel-buffers) +(require 'testutil-terminal-buffers) (ert-deftest test-ai-term--display-saved-uses-desktop-defaults-when-state-nil () "Normal: nil state on a desktop -> rightmost, size=cj/ai-term-desktop-width. diff --git a/tests/test-ai-term--displayed-agent-window.el b/tests/test-ai-term--displayed-agent-window.el index eeb40ed31..ced3ff414 100644 --- a/tests/test-ai-term--displayed-agent-window.el +++ b/tests/test-ai-term--displayed-agent-window.el @@ -12,7 +12,7 @@ (add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) (add-to-list 'load-path (expand-file-name "tests" user-emacs-directory)) (require 'ai-term) -(require 'testutil-ghostel-buffers) +(require 'testutil-terminal-buffers) (ert-deftest test-ai-term--displayed-agent-window-no-buffers-returns-nil () "Boundary: no agent buffers anywhere -> nil." diff --git a/tests/test-ai-term--keybindings.el b/tests/test-ai-term--keybindings.el index a8b92ffa8..6f7f53a5e 100644 --- a/tests/test-ai-term--keybindings.el +++ b/tests/test-ai-term--keybindings.el @@ -4,12 +4,11 @@ ;; ai-term lives under the C-; a prefix (vacated when gptel was archived), with ;; the frequent "swap to the next agent" also on M-SPC for a fast chord. M-SPC ;; must reach Emacs from inside an agent buffer, so it is bound in -;; `ghostel-mode-map' and added to `ghostel-keymap-exceptions' (the semi-char -;; map otherwise forwards it to the pty). C-; is already an exception via -;; term-config, so the C-; a family resolves through the global prefix. These -;; tests require ghostel (so ai-term's `with-eval-after-load' fires) before -;; ai-term, then confirm the bindings landed and the old F9 family is gone. -;; `(require 'ghostel)' does not load the native module, so this stays light. +;; `eat-semi-char-mode-map' (EAT forwards unbound keys to the pty otherwise). +;; C-; is already bound there via eat-config, so the C-; a family resolves +;; through the global prefix. These tests require eat (so ai-term's +;; `with-eval-after-load' fires) before ai-term, then confirm the bindings +;; landed and the old F9 family is gone. ;;; Code: @@ -19,7 +18,7 @@ (setq package-user-dir (expand-file-name "elpa" user-emacs-directory)) (package-initialize) (add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) -(require 'ghostel) +(require 'eat) (require 'ai-term) (ert-deftest test-ai-term-keymap-leaf-bindings () @@ -37,16 +36,11 @@ "Normal: M-SPC runs `cj/ai-term-next' (the fast swap chord)." (should (eq (lookup-key (current-global-map) (kbd "M-SPC")) #'cj/ai-term-next))) -(ert-deftest test-ai-term-meta-space-bound-in-ghostel-mode-map () - "Normal: M-SPC is bound in `ghostel-mode-map' so swap works inside an agent." - (should (eq (keymap-lookup ghostel-mode-map "M-SPC") #'cj/ai-term-next))) - -(ert-deftest test-ai-term-meta-space-in-keymap-exceptions () - "Regression: M-SPC is in `ghostel-keymap-exceptions' so semi-char mode lets it -reach Emacs instead of forwarding it to the pty." - (should (member "M-SPC" ghostel-keymap-exceptions)) - (should-not (eq (keymap-lookup ghostel-semi-char-mode-map "M-SPC") - 'ghostel--send-event))) +(ert-deftest test-ai-term-meta-space-bound-in-eat-semi-char-mode-map () + "Normal: M-SPC is bound in `eat-semi-char-mode-map' so swap works inside an +agent. EAT forwards unbound keys to the pty, so the bind is what lets it reach +Emacs -- no ghostel-style exception list or rebuild is needed." + (should (eq (keymap-lookup eat-semi-char-mode-map "M-SPC") #'cj/ai-term-next))) (ert-deftest test-ai-term-f9-family-removed-globally () "Regression: the old F9 family no longer binds the ai-term commands globally." diff --git a/tests/test-ai-term--launch-command.el b/tests/test-ai-term--launch-command.el index 246e70a3f..e61c0e579 100644 --- a/tests/test-ai-term--launch-command.el +++ b/tests/test-ai-term--launch-command.el @@ -1,7 +1,7 @@ ;;; test-ai-term--launch-command.el --- Tests for cj/--ai-term-launch-command -*- lexical-binding: t; -*- ;;; Commentary: -;; The launch command is what gets typed into a fresh ghostel shell to bring +;; The launch command is what gets typed into a fresh shell to bring ;; up the agent inside a per-project tmux session. The session is named ;; `cj/ai-term-tmux-session-prefix' + the project basename, so a second ;; F9 on the same project reattaches to the running agent rather than diff --git a/tests/test-ai-term--reuse-edge-window.el b/tests/test-ai-term--reuse-edge-window.el index a9a0529e8..8ba2f759f 100644 --- a/tests/test-ai-term--reuse-edge-window.el +++ b/tests/test-ai-term--reuse-edge-window.el @@ -25,7 +25,7 @@ (add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) (add-to-list 'load-path (expand-file-name "tests" user-emacs-directory)) (require 'ai-term) -(require 'testutil-ghostel-buffers) +(require 'testutil-terminal-buffers) (defun cj/test--displayed-buffer-names () "Return the buffer names shown in the selected frame, left/top to right/bottom." diff --git a/tests/test-ai-term--reuse-existing-agent.el b/tests/test-ai-term--reuse-existing-agent.el index 3f0c64493..361e94be9 100644 --- a/tests/test-ai-term--reuse-existing-agent.el +++ b/tests/test-ai-term--reuse-existing-agent.el @@ -17,7 +17,7 @@ (add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) (add-to-list 'load-path (expand-file-name "tests" user-emacs-directory)) (require 'ai-term) -(require 'testutil-ghostel-buffers) +(require 'testutil-terminal-buffers) (ert-deftest test-ai-term--reuse-existing-agent-swaps-buffer-when-window-exists () "Normal: an agent window exists -> swap its buffer, return the window." diff --git a/tests/test-ai-term--server-display.el b/tests/test-ai-term--server-display.el index b3d32dc83..6db9cf2d3 100644 --- a/tests/test-ai-term--server-display.el +++ b/tests/test-ai-term--server-display.el @@ -16,7 +16,7 @@ (add-to-list 'load-path (expand-file-name "tests" user-emacs-directory)) (require 'ai-term) (require 'server) -(require 'testutil-ghostel-buffers) +(require 'testutil-terminal-buffers) (ert-deftest test-ai-term--non-agent-window-finds-code-window () "Normal: agent on the right, code on the left -> returns the code window." diff --git a/tests/test-ai-term--show-or-create.el b/tests/test-ai-term--show-or-create.el index c6653dcdd..4f5f1f67f 100644 --- a/tests/test-ai-term--show-or-create.el +++ b/tests/test-ai-term--show-or-create.el @@ -3,13 +3,13 @@ ;;; Commentary: ;; Tests the show-or-create branching: ;; -;; - buffer absent -> ghostel called, agent command + newline sent -;; - buffer present, live -> ghostel not called, buffer displayed -;; - buffer present, dead -> old buffer killed, ghostel recreates +;; - buffer absent -> eat called, agent command + newline sent +;; - buffer present, live -> eat not called, buffer displayed +;; - buffer present, dead -> old buffer killed, eat recreates ;; -;; ghostel functions are stubbed so the test does no process spawning and -;; never loads the native module. Production calls (ghostel) with no name and -;; relies on the dynamically bound `ghostel-buffer-name'; the mock honors that. +;; eat + the send helper are stubbed so the test does no process spawning. +;; Production calls (eat) and relies on the dynamically bound `eat-buffer-name'; +;; the mock honors that. ;;; Code: @@ -19,19 +19,17 @@ (add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) (require 'ai-term) -;; ghostel isn't loaded in batch -- provide stubs so cl-letf has overrides. -(unless (fboundp 'ghostel) - (defun ghostel (&optional _arg) nil)) -(unless (fboundp 'ghostel-send-string) - (defun ghostel-send-string (_s) nil)) +;; eat isn't loaded in batch -- provide a stub so cl-letf has an override. +(unless (fboundp 'eat) + (defun eat (&optional _program _arg) nil)) -(defmacro test-ai-term--with-mock-ghostel (vars &rest body) - "Run BODY with ghostel + ghostel-send-string mocked. +(defmacro test-ai-term--with-mock-eat (vars &rest body) + "Run BODY with eat + `cj/--ai-term-send-string' mocked. -VARS is a plist of capture variable names: :calls (buffer names ghostel -was asked to create), :strings (sent strings), :default-dir. The mocked -`ghostel' creates and returns a buffer named after the dynamically bound -`ghostel-buffer-name', mirroring the real entry point." +VARS is a plist of capture variable names: :calls (buffer names eat was asked +to create), :strings (sent strings), :default-dir. The mocked `eat' creates +and returns a buffer named after the dynamically bound `eat-buffer-name', +mirroring the real entry point." (declare (indent 1) (debug t)) (let ((calls (plist-get vars :calls)) (strings (plist-get vars :strings)) @@ -39,14 +37,14 @@ was asked to create), :strings (sent strings), :default-dir. The mocked `(let ((,calls '()) (,strings '()) (,ddir nil)) - (cl-letf (((symbol-function 'ghostel) - (lambda (&optional _arg) + (cl-letf (((symbol-function 'eat) + (lambda (&optional _program _arg) (setq ,ddir default-directory) - (let ((b (get-buffer-create ghostel-buffer-name))) + (let ((b (get-buffer-create eat-buffer-name))) (push (buffer-name b) ,calls) b))) - ((symbol-function 'ghostel-send-string) - (lambda (s) (push s ,strings)))) + ((symbol-function 'cj/--ai-term-send-string) + (lambda (_buf s) (push s ,strings)))) ,@body)))) (defun test-ai-term--cleanup (name) @@ -55,33 +53,33 @@ was asked to create), :strings (sent strings), :default-dir. The mocked (kill-buffer name))) (ert-deftest test-ai-term--show-or-create-creates-when-buffer-missing () - "Normal: no existing buffer -> ghostel called once, launch cmd + newline -sent, the project recorded at the front of the MRU list." + "Normal: no existing buffer -> eat called once, launch cmd + newline sent, +the project recorded at the front of the MRU list." (let ((name "agent [normal-create-test]") (cj/--ai-term-mru nil)) (test-ai-term--cleanup name) (unwind-protect - (test-ai-term--with-mock-ghostel (:calls calls :strings strings - :default-dir ddir) + (test-ai-term--with-mock-eat (:calls calls :strings strings + :default-dir ddir) (cj/--ai-term-show-or-create "/tmp/some-project" name) (should (equal calls (list name))) - (should (equal (reverse strings) - (list (cj/--ai-term-launch-command "/tmp/some-project") - "\n"))) + (should (equal strings + (list (concat (cj/--ai-term-launch-command "/tmp/some-project") + "\n")))) (should (equal ddir "/tmp/some-project")) (should (equal (car cj/--ai-term-mru) "/tmp/some-project"))) (test-ai-term--cleanup name)))) (ert-deftest test-ai-term--show-or-create-displays-existing-when-process-live () - "Normal: buffer exists with live process -> ghostel not called." + "Normal: buffer exists with live process -> eat not called." (let ((name "agent [reuse-test]")) (test-ai-term--cleanup name) (unwind-protect (let ((buf (get-buffer-create name))) (cl-letf (((symbol-function 'cj/--ai-term-process-live-p) (lambda (b) (and (eq b buf) t)))) - (test-ai-term--with-mock-ghostel (:calls calls :strings strings - :default-dir _ddir) + (test-ai-term--with-mock-eat (:calls calls :strings strings + :default-dir _ddir) (cj/--ai-term-show-or-create "/tmp/reuse" name) (should (null calls)) (should (null strings))))) @@ -95,27 +93,27 @@ sent, the project recorded at the front of the MRU list." (let ((stale (get-buffer-create name))) (cl-letf (((symbol-function 'cj/--ai-term-process-live-p) (lambda (_b) nil))) - (test-ai-term--with-mock-ghostel (:calls calls :strings strings - :default-dir _ddir) + (test-ai-term--with-mock-eat (:calls calls :strings strings + :default-dir _ddir) (cj/--ai-term-show-or-create "/tmp/dead" name) (should (equal calls (list name))) - (should (equal (reverse strings) - (list (cj/--ai-term-launch-command "/tmp/dead") - "\n"))) + (should (equal strings + (list (concat (cj/--ai-term-launch-command "/tmp/dead") + "\n")))) (should-not (buffer-live-p stale))))) (test-ai-term--cleanup name)))) (ert-deftest test-ai-term--show-or-create-preserves-selected-window () - "Regression: ghostel's same-window switch must not bury the dashboard. + "Regression: eat's same-window switch must not bury the dashboard. -Real `ghostel' switches the selected window to its buffer as a side-effect of +Real `eat' switches the selected window to its buffer as a side-effect of construction. On a fresh-boot frame (one window showing the dashboard), that side-effect would otherwise leave the original window pointing at the new -agent buffer. The wrapper runs `(ghostel)' inside `save-window-excursion' so -the original window state is restored before `display-buffer' fires, leaving -the dashboard put and letting the alist place agent into a fresh split. +agent buffer. The wrapper runs `(eat)' inside `save-window-excursion' so the +original window state is restored before `display-buffer' fires, leaving the +dashboard put and letting the alist place agent into a fresh split. -This test stubs `ghostel' to mimic the same-window side-effect and asserts the +This test stubs `eat' to mimic the same-window side-effect and asserts the originally-selected window still shows its original buffer afterward." (let ((agent-name "agent [preserve-window-test]") (orig-name "*test-original-buffer*")) @@ -128,24 +126,24 @@ originally-selected window still shows its original buffer afterward." (orig-win (selected-window))) (set-window-buffer orig-win orig-buf) (cl-letf - (((symbol-function 'ghostel) - (lambda (&optional _arg) - (let ((buf (get-buffer-create ghostel-buffer-name))) + (((symbol-function 'eat) + (lambda (&optional _program _arg) + (let ((buf (get-buffer-create eat-buffer-name))) (set-window-buffer (selected-window) buf) buf))) - ((symbol-function 'ghostel-send-string) - (lambda (_s) nil))) + ((symbol-function 'cj/--ai-term-send-string) + (lambda (_buf _s) nil))) (cj/--ai-term-show-or-create "/tmp/preserve" agent-name) (should (eq (window-buffer orig-win) orig-buf))))) (test-ai-term--cleanup agent-name) (when (get-buffer orig-name) (kill-buffer orig-name))))) (ert-deftest test-ai-term--show-or-create-returns-buffer () - "Normal: return value is the ghostel buffer named after the project." + "Normal: return value is the eat buffer named after the project." (let ((name "agent [return-test]")) (test-ai-term--cleanup name) (unwind-protect - (test-ai-term--with-mock-ghostel (:calls _c :strings _s :default-dir _d) + (test-ai-term--with-mock-eat (:calls _c :strings _s :default-dir _d) (let ((result (cj/--ai-term-show-or-create "/tmp/return" name))) (should (bufferp result)) (should (equal (buffer-name result) name)))) diff --git a/tests/test-ai-term--single-window-toggle.el b/tests/test-ai-term--single-window-toggle.el index aa507f032..dd5adbcc3 100644 --- a/tests/test-ai-term--single-window-toggle.el +++ b/tests/test-ai-term--single-window-toggle.el @@ -19,7 +19,7 @@ (add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) (add-to-list 'load-path (expand-file-name "tests" user-emacs-directory)) (require 'ai-term) -(require 'testutil-ghostel-buffers) +(require 'testutil-terminal-buffers) ;;; Normal Cases @@ -182,5 +182,119 @@ the flag nil (no spurious set)." (kill-buffer "*test-sw-untouched-left*")) (cj/test--kill-agent-buffers)))) +;;; Geometry tracking (Approach B: remember the agent's fullscreen state) + +(ert-deftest test-ai-term--track-geometry-sole-sets-fullscreen () + "Normal: an agent window that is the sole window in its frame sets +`cj/--ai-term-last-fullscreen'." + (cj/test--kill-agent-buffers) + (let ((agent-name "agent [track-sole]") + (cj/--ai-term-last-fullscreen nil)) + (unwind-protect + (save-window-excursion + (delete-other-windows) + (let ((agent-buf (get-buffer-create agent-name))) + (set-window-buffer (selected-window) agent-buf) + (should (one-window-p)) + (cj/--ai-term-track-geometry) + (should (eq cj/--ai-term-last-fullscreen t)))) + (cj/test--kill-agent-buffers)))) + +(ert-deftest test-ai-term--track-geometry-split-clears-fullscreen () + "Normal: an agent window shown as a split clears `cj/--ai-term-last-fullscreen'. +The tracker must NOT re-capture dock direction/size here -- doing so on every +window change drifts the dock height per cycle; toggle-off owns that capture." + (cj/test--kill-agent-buffers) + (let ((agent-name "agent [track-split]") + (left-name "*test-track-left*") + (cj/--ai-term-last-fullscreen t) ; pretend it was fullscreen + (cj/--ai-term-last-direction nil) + (cj/--ai-term-last-size nil)) + (unwind-protect + (save-window-excursion + (delete-other-windows) + (let ((agent-buf (get-buffer-create agent-name)) + (left-buf (get-buffer-create left-name))) + (set-window-buffer (selected-window) left-buf) + (let ((agent-win (split-window (selected-window) nil 'right))) + (set-window-buffer agent-win agent-buf) + (should-not (one-window-p)) + (cj/--ai-term-track-geometry) + (should-not cj/--ai-term-last-fullscreen) ; flag cleared + (should-not cj/--ai-term-last-size)))) ; dock size NOT re-captured here + (when (get-buffer left-name) (kill-buffer left-name)) + (cj/test--kill-agent-buffers)))) + +(ert-deftest test-ai-term--track-geometry-no-agent-retains-state () + "Boundary: with no agent window displayed, the tracker leaves the last-seen +fullscreen flag untouched -- that is the just-left state to replay." + (cj/test--kill-agent-buffers) + (let ((cj/--ai-term-last-fullscreen t)) + (unwind-protect + (save-window-excursion + (delete-other-windows) + (set-window-buffer (selected-window) + (get-buffer-create "*test-track-none*")) + (should-not (cj/--ai-term-displayed-agent-window)) + (cj/--ai-term-track-geometry) + (should (eq cj/--ai-term-last-fullscreen t))) ; unchanged + (when (get-buffer "*test-track-none*") (kill-buffer "*test-track-none*")) + (cj/test--kill-agent-buffers)))) + +(ert-deftest test-ai-term--display-saved-restores-fullscreen-when-last-fullscreen () + "Normal: when the agent was last fullscreen and the target frame is a single +window, display-saved restores it in place rather than docking -- Craig's case +of leaving a fullscreen agent, switching to another fullscreen buffer, then +M-SPC. A stale dock size is on record; the split path must NOT run." + (cj/test--kill-agent-buffers) + (let ((agent-name "agent [restore-fullscreen]") + (cj/--ai-term-last-fullscreen t) + (cj/--ai-term-last-was-bury nil) + (cj/--ai-term-last-direction 'right) + (cj/--ai-term-last-size 40)) + (unwind-protect + (save-window-excursion + (delete-other-windows) + (let* ((other-buf (get-buffer-create "*test-rfs-other*")) + (agent-buf (get-buffer-create agent-name)) + (win (selected-window)) + (split-called nil)) + (set-window-buffer win other-buf) + (should (one-window-p)) + (cl-letf (((symbol-function 'display-buffer-in-direction) + (lambda (&rest _) (setq split-called t) (selected-window)))) + (cj/--ai-term-display-saved agent-buf nil)) + (should (one-window-p)) ; no split -- stayed full-frame + (should (eq (window-buffer win) agent-buf)) ; agent took the lone window + (should-not split-called))) ; dock path never ran + (when (get-buffer "*test-rfs-other*") (kill-buffer "*test-rfs-other*")) + (cj/test--kill-agent-buffers)))) + +(ert-deftest test-ai-term--display-saved-docks-when-not-fullscreen () + "Boundary: without the fullscreen flag (or a bury), a single-window summon +docks via the saved-direction split. The discriminator is the remembered +state, not merely `one-window-p', so first-open and ordinary summons still +dock rather than seizing the whole frame." + (cj/test--kill-agent-buffers) + (let ((agent-name "agent [dock-not-fullscreen]") + (cj/--ai-term-last-fullscreen nil) + (cj/--ai-term-last-was-bury nil) + (cj/--ai-term-last-direction 'right) + (cj/--ai-term-last-size 40)) + (unwind-protect + (save-window-excursion + (delete-other-windows) + (let ((agent-buf (get-buffer-create agent-name)) + (split-called nil)) + (set-window-buffer (selected-window) + (get-buffer-create "*test-dock-other*")) + (should (one-window-p)) + (cl-letf (((symbol-function 'display-buffer-in-direction) + (lambda (&rest _) (setq split-called t) (selected-window)))) + (cj/--ai-term-display-saved agent-buf nil)) + (should split-called))) ; dock path ran despite one-window-p + (when (get-buffer "*test-dock-other*") (kill-buffer "*test-dock-other*")) + (cj/test--kill-agent-buffers)))) + (provide 'test-ai-term--single-window-toggle) ;;; test-ai-term--single-window-toggle.el ends here diff --git a/tests/test-auto-dim-config.el b/tests/test-auto-dim-config.el index 532e7dfae..2686b88f3 100644 --- a/tests/test-auto-dim-config.el +++ b/tests/test-auto-dim-config.el @@ -8,8 +8,9 @@ ;; in ~/code and may be absent on a clean checkout. ;; ;; The vterm dim-integration tests were removed when the terminal engine moved -;; to ghostel: ghostel bakes its palette per-terminal (no per-window color -;; hook), so terminal buffers no longer participate in window dimming. +;; off vterm. EAT (the current engine) renders in real Emacs faces and uses the +;; `default' face for its background, so terminal buffers dim like any other +;; buffer with no dedicated integration. ;;; Code: diff --git a/tests/test-calendar-sync--deferred-start.el b/tests/test-calendar-sync--deferred-start.el new file mode 100644 index 000000000..a3a9c0198 --- /dev/null +++ b/tests/test-calendar-sync--deferred-start.el @@ -0,0 +1,43 @@ +;;; test-calendar-sync--deferred-start.el --- Deferred auto-start tests -*- lexical-binding: t; -*- + +;;; Commentary: +;; calendar-sync arms its auto-sync on the first org-agenda use instead of at +;; load, so a cold gpg-agent is not prompted for the authinfo passphrase at +;; startup (the :secret-host feed URLs decrypt authinfo.gpg). These tests cover +;; the one-shot helper: it starts sync once and removes itself, even when the +;; start call errors. + +;;; Code: + +(require 'ert) +(require 'cl-lib) + +(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) +(require 'calendar-sync) + +;; org-agenda need not be loaded under `make test'; declare the hook special so +;; the dynamic `let' bindings below shadow it cleanly. +(defvar org-agenda-mode-hook) + +(ert-deftest test-calendar-sync-deferred-start-fires-once-and-unhooks () + "Normal: the one-shot starts sync once and removes itself from the hook." + (let ((started 0) + (org-agenda-mode-hook (list #'calendar-sync--auto-start-on-first-agenda))) + (cl-letf (((symbol-function 'calendar-sync-start) + (lambda (&rest _) (setq started (1+ started))))) + (calendar-sync--auto-start-on-first-agenda)) + (should (= started 1)) + (should-not (member #'calendar-sync--auto-start-on-first-agenda + org-agenda-mode-hook)))) + +(ert-deftest test-calendar-sync-deferred-start-unhooks-even-when-start-errors () + "Error: a start failure still leaves the hook removed, so it cannot re-fire." + (let ((org-agenda-mode-hook (list #'calendar-sync--auto-start-on-first-agenda))) + (cl-letf (((symbol-function 'calendar-sync-start) + (lambda (&rest _) (error "boom")))) + (should-error (calendar-sync--auto-start-on-first-agenda))) + (should-not (member #'calendar-sync--auto-start-on-first-agenda + org-agenda-mode-hook)))) + +(provide 'test-calendar-sync--deferred-start) +;;; test-calendar-sync--deferred-start.el ends here diff --git a/tests/test-calibredb-epub-config--bookmark-name.el b/tests/test-calibredb-epub-config--bookmark-name.el index 2e1d253e9..7e9ffa345 100644 --- a/tests/test-calibredb-epub-config--bookmark-name.el +++ b/tests/test-calibredb-epub-config--bookmark-name.el @@ -1,10 +1,13 @@ -;;; test-calibredb-epub-config--bookmark-name.el --- Nov bookmark naming tests -*- lexical-binding: t; -*- +;;; test-calibredb-epub-config--bookmark-name.el --- Reading bookmark naming tests -*- lexical-binding: t; -*- ;;; Commentary: -;; Tests for the clean "Author, Title" bookmark naming that replaces nov.el's -;; filename-based default. The name is parsed from the EPUB filename (Calibre's -;; "<Title> - <Author>.epub" convention), restoring colons that Calibre -;; sanitized to underscores and reordering to "Author, Title". +;; Tests for the clean "Author, Title" bookmark naming that replaces the +;; filename-based default for both EPUB (nov) and PDF (pdf-view) bookmarks. +;; The name is parsed from the file's name (Calibre's "<Title> - <Author>.<ext>" +;; convention), restoring colons that Calibre sanitized to underscores and +;; reordering to "Author, Title". The parser is extension-agnostic, so the +;; same advice serves both nov-bookmark-make-record and +;; pdf-view-bookmark-make-record. ;;; Code: @@ -12,76 +15,93 @@ (add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) (require 'calibredb-epub-config) -;;; cj/--nov-clean-title +;;; cj/--reading-clean-title -(ert-deftest test-nov-clean-title-passthrough () +(ert-deftest test-reading-clean-title-passthrough () "Normal: a clean string is returned unchanged." - (should (equal (cj/--nov-clean-title "Agatha Christie") "Agatha Christie")) - (should (equal (cj/--nov-clean-title "The A.B.C. Murders") "The A.B.C. Murders"))) + (should (equal (cj/--reading-clean-title "Agatha Christie") "Agatha Christie")) + (should (equal (cj/--reading-clean-title "The A.B.C. Murders") "The A.B.C. Murders"))) -(ert-deftest test-nov-clean-title-restores-colon () +(ert-deftest test-reading-clean-title-restores-colon () "Boundary: Calibre's \"_ \" colon substitution is restored to \": \"." - (should (equal (cj/--nov-clean-title "Frege_ A Guide for the Perplexed") + (should (equal (cj/--reading-clean-title "Frege_ A Guide for the Perplexed") "Frege: A Guide for the Perplexed")) - (should (equal (cj/--nov-clean-title "The Fool's Progress_ An Honest Novel") + (should (equal (cj/--reading-clean-title "The Fool's Progress_ An Honest Novel") "The Fool's Progress: An Honest Novel"))) -(ert-deftest test-nov-clean-title-stray-underscore-and-whitespace () +(ert-deftest test-reading-clean-title-stray-underscore-and-whitespace () "Boundary: a non-colon underscore becomes a space; whitespace collapses." - (should (equal (cj/--nov-clean-title "a_b") "a b")) - (should (equal (cj/--nov-clean-title " x y ") "x y"))) + (should (equal (cj/--reading-clean-title "a_b") "a b")) + (should (equal (cj/--reading-clean-title " x y ") "x y"))) -(ert-deftest test-nov-clean-title-rejects-blank-and-nonstring () +(ert-deftest test-reading-clean-title-rejects-blank-and-nonstring () "Error: nil, empty, all-whitespace, or non-string yields nil." - (should-not (cj/--nov-clean-title nil)) - (should-not (cj/--nov-clean-title "")) - (should-not (cj/--nov-clean-title " ")) - (should-not (cj/--nov-clean-title 42))) + (should-not (cj/--reading-clean-title nil)) + (should-not (cj/--reading-clean-title "")) + (should-not (cj/--reading-clean-title " ")) + (should-not (cj/--reading-clean-title 42))) -;;; cj/--nov-bookmark-name-from-file +;;; cj/--reading-bookmark-name-from-file -(ert-deftest test-nov-bookmark-name-real-examples () +(ert-deftest test-reading-bookmark-name-real-examples () "Normal: real Calibre filenames become \"Author, Title\" with colons restored." - (should (equal (cj/--nov-bookmark-name-from-file + (should (equal (cj/--reading-bookmark-name-from-file "/books/Frege_ A Guide for the Perplexed - Edward Kanterian.epub") "Edward Kanterian, Frege: A Guide for the Perplexed")) - (should (equal (cj/--nov-bookmark-name-from-file + (should (equal (cj/--reading-bookmark-name-from-file "/books/The A.B.C. Murders - Agatha Christie.epub") "Agatha Christie, The A.B.C. Murders")) - (should (equal (cj/--nov-bookmark-name-from-file + (should (equal (cj/--reading-bookmark-name-from-file "/books/The Fool's Progress_ An Honest Novel - Edward Abbey.epub") "Edward Abbey, The Fool's Progress: An Honest Novel"))) -(ert-deftest test-nov-bookmark-name-splits-on-last-separator () +(ert-deftest test-reading-bookmark-name-pdf-extension () + "Normal: a PDF filename is parsed the same way -- the parser is extension- +agnostic, so PDF bookmarks reformat like EPUB ones." + (should (equal (cj/--reading-bookmark-name-from-file + "/books/Engines of Logic_ Mathematicians and the O - Martin Davis.pdf") + "Martin Davis, Engines of Logic: Mathematicians and the O"))) + +(ert-deftest test-reading-bookmark-name-splits-on-last-separator () "Boundary: a title containing \" - \" splits on the LAST separator." - (should (equal (cj/--nov-bookmark-name-from-file "/b/Title - Part Two - Some Author.epub") + (should (equal (cj/--reading-bookmark-name-from-file "/b/Title - Part Two - Some Author.epub") "Some Author, Title - Part Two"))) -(ert-deftest test-nov-bookmark-name-no-separator () +(ert-deftest test-reading-bookmark-name-no-separator () "Boundary: a filename with no \" - \" falls back to the cleaned whole name." - (should (equal (cj/--nov-bookmark-name-from-file "/b/Untitled_ Draft.epub") + (should (equal (cj/--reading-bookmark-name-from-file "/b/Untitled_ Draft.epub") "Untitled: Draft"))) -(ert-deftest test-nov-bookmark-name-nil-and-empty () +(ert-deftest test-reading-bookmark-name-nil-and-empty () "Error: nil or empty path yields nil." - (should-not (cj/--nov-bookmark-name-from-file nil)) - (should-not (cj/--nov-bookmark-name-from-file ""))) + (should-not (cj/--reading-bookmark-name-from-file nil)) + (should-not (cj/--reading-bookmark-name-from-file ""))) -;;; cj/--nov-bookmark-rename-record +;;; cj/--reading-bookmark-rename-record -(ert-deftest test-nov-bookmark-rename-record-replaces-name () +(ert-deftest test-reading-bookmark-rename-record-replaces-name () "Normal: the record's name is rebuilt from its filename; the alist is kept." (let* ((record (cons "The A.B.C. Murders - Agatha Christie.epub" '((filename . "/b/The A.B.C. Murders - Agatha Christie.epub") (index . 0)))) - (out (cj/--nov-bookmark-rename-record record))) + (out (cj/--reading-bookmark-rename-record record))) (should (equal (car out) "Agatha Christie, The A.B.C. Murders")) (should (equal (cdr out) (cdr record))))) -(ert-deftest test-nov-bookmark-rename-record-keeps-original-without-filename () +(ert-deftest test-reading-bookmark-rename-record-pdf () + "Normal: a PDF-shaped record (filename from `bookmark-make-record-default') +gets the same \"Author, Title\" rename." + (let* ((record (cons "Engines of Logic_ Mathematicians and the O - Martin Davis.pdf" + '((filename . "/b/Engines of Logic_ Mathematicians and the O - Martin Davis.pdf") + (page . 12)))) + (out (cj/--reading-bookmark-rename-record record))) + (should (equal (car out) "Martin Davis, Engines of Logic: Mathematicians and the O")) + (should (equal (cdr out) (cdr record))))) + +(ert-deftest test-reading-bookmark-rename-record-keeps-original-without-filename () "Boundary: a record with no usable filename is returned unchanged." (let ((record (cons "whatever" '((index . 0))))) - (should (equal (cj/--nov-bookmark-rename-record record) record)))) + (should (equal (cj/--reading-bookmark-rename-record record) record)))) (provide 'test-calibredb-epub-config--bookmark-name) ;;; test-calibredb-epub-config--bookmark-name.el ends here diff --git a/tests/test-calibredb-epub-config--open-to-favorites.el b/tests/test-calibredb-epub-config--open-to-favorites.el new file mode 100644 index 000000000..d11618081 --- /dev/null +++ b/tests/test-calibredb-epub-config--open-to-favorites.el @@ -0,0 +1,57 @@ +;;; test-calibredb-epub-config--open-to-favorites.el --- in-progress open filter -*- lexical-binding: t; -*- + +;;; Commentary: +;; `cj/--calibredb-open-to-favorites' advises `calibredb' :after so every launch +;; lands filtered to `calibredb-favorite-keyword' (Craig's "in-progress" books). +;; It scopes the filter to the TAG field (sets `calibredb-tag-filter-p', clears +;; the other filter-p flags) before delegating to `calibredb-search-keyword-filter', +;; so the keyword can't over-match in a book's title or description. It no-ops +;; when no usable keyword is set. + +;;; Code: + +(require 'ert) +(require 'cl-lib) +(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) +(require 'calibredb-epub-config) + +;; calibredb defcustom + internal flags; declared special so `let' binds them +;; dynamically (all unbound under `make test', which never runs the use-package +;; :config or loads calibredb). +(defvar calibredb-favorite-keyword) +(defvar calibredb-tag-filter-p) +(defvar calibredb-favorite-filter-p) +(defvar calibredb-author-filter-p) +(defvar calibredb-date-filter-p) +(defvar calibredb-format-filter-p) + +(ert-deftest test-calibredb-open-to-favorites-applies-keyword-scoped-to-tags () + "Normal: with a favorite keyword set, the filter runs with that keyword and is +scoped to the tag field (so it can't over-match a description); a stale +non-tag filter flag is cleared." + (let ((applied :unset) + (calibredb-favorite-keyword "in-progress") + (calibredb-tag-filter-p nil) + (calibredb-favorite-filter-p t) ; stale, must be cleared + (calibredb-author-filter-p nil) + (calibredb-date-filter-p nil) + (calibredb-format-filter-p nil)) + (cl-letf (((symbol-function 'calibredb-search-keyword-filter) + (lambda (kw) (setq applied kw)))) + (cj/--calibredb-open-to-favorites)) + (should (equal applied "in-progress")) ; keyword applied + (should (eq calibredb-tag-filter-p t)) ; scoped to the tag field + (should-not calibredb-favorite-filter-p))) ; stale flag cleared + +(ert-deftest test-calibredb-open-to-favorites-noop-without-usable-keyword () + "Boundary/Error: nil, empty, or non-string keyword applies no filter." + (dolist (kw (list nil "" 42)) + (let ((applied :unset) + (calibredb-favorite-keyword kw)) + (cl-letf (((symbol-function 'calibredb-search-keyword-filter) + (lambda (k) (setq applied k)))) + (cj/--calibredb-open-to-favorites)) + (should (eq applied :unset))))) + +(provide 'test-calibredb-epub-config--open-to-favorites) +;;; test-calibredb-epub-config--open-to-favorites.el ends here diff --git a/tests/test-calibredb-epub-config.el b/tests/test-calibredb-epub-config.el index cb3a9ba74..71581d4c9 100644 --- a/tests/test-calibredb-epub-config.el +++ b/tests/test-calibredb-epub-config.el @@ -173,12 +173,13 @@ re-render of the document." (should (commandp #'cj/nov-narrow-text))) (ert-deftest test-calibredb-epub-nov-width-commands-bound-in-nov-mode-map () - "Normal: +/= widen and -/_ narrow the text column in `nov-mode-map'." + "Normal: { } adjust the text column in `nov-mode-map' (+/-/= are font size)." (skip-unless (and (require 'nov nil t) (boundp 'nov-mode-map))) - (should (eq (keymap-lookup nov-mode-map "+") #'cj/nov-widen-text)) - (should (eq (keymap-lookup nov-mode-map "=") #'cj/nov-widen-text)) - (should (eq (keymap-lookup nov-mode-map "-") #'cj/nov-narrow-text)) - (should (eq (keymap-lookup nov-mode-map "_") #'cj/nov-narrow-text))) + (should (eq (keymap-lookup nov-mode-map "}") #'cj/nov-widen-text)) + (should (eq (keymap-lookup nov-mode-map "{") #'cj/nov-narrow-text)) + (should (eq (keymap-lookup nov-mode-map "+") #'cj/nov-reading-text-bigger)) + (should (eq (keymap-lookup nov-mode-map "-") #'cj/nov-reading-text-smaller)) + (should (eq (keymap-lookup nov-mode-map "=") #'cj/nov-reading-text-reset))) ;;; -------------------------- cj/nov-apply-preferences ------------------------ diff --git a/tests/test-custom-buffer-file--buffer-differs-prompt.el b/tests/test-custom-buffer-file--buffer-differs-prompt.el new file mode 100644 index 000000000..109ca121f --- /dev/null +++ b/tests/test-custom-buffer-file--buffer-differs-prompt.el @@ -0,0 +1,197 @@ +;;; test-custom-buffer-file--buffer-differs-prompt.el --- disk-changed save prompt pieces -*- lexical-binding: t; -*- + +;;; Commentary: +;; Pure-logic tests for the disk-changed save prompt (the C-x C-s case where the +;; buffer is modified AND the file changed on disk): the question string (with a +;; terse whitespace-only parenthetical), the labeled-but-terse choice list, and +;; the key->action mapping. The interactive read loop, the diff display, and the +;; save/revert dispatch are exercised live, not here. + +;;; Code: + +(require 'ert) +(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) +(require 'custom-buffer-file) + +(declare-function cj/--buffer-differs-prompt-string "custom-buffer-file" (name ws-only-p)) +(declare-function cj/--buffer-differs-choices "custom-buffer-file" ()) +(declare-function cj/--buffer-differs-action "custom-buffer-file" (key)) + +;;; ------------------- cj/--buffer-differs-prompt-string ---------------------- + +(ert-deftest test-cbf-buffer-differs-prompt-plain () + "Normal: without whitespace-only, the prompt names the buffer, no parenthetical." + (let ((s (cj/--buffer-differs-prompt-string "todo.org" nil))) + (should (string-match-p "todo\\.org" s)) + (should-not (string-match-p "whitespace" s)))) + +(ert-deftest test-cbf-buffer-differs-prompt-whitespace-only () + "Normal: whitespace-only folds in a terse \"(whitespace only)\" parenthetical." + (let ((s (cj/--buffer-differs-prompt-string "todo.org" t))) + (should (string-match-p "todo\\.org" s)) + (should (string-match-p "(whitespace only)" s)))) + +;;; ---------------------- cj/--buffer-differs-choices ------------------------- + +(ert-deftest test-cbf-buffer-differs-choices-keys () + "Normal: the menu offers save, diff, clean, revert, and cancel." + (let ((c (cj/--buffer-differs-choices))) + (dolist (key '(?s ?d ?w ?r ?c)) + (should (assq key c))))) + +(ert-deftest test-cbf-buffer-differs-choices-terse-names () + "Boundary: inline names stay terse (one word) so the menu fits at a glance." + (dolist (entry (cj/--buffer-differs-choices)) + (let ((name (nth 1 entry))) + (should (stringp name)) + (should-not (string-match-p " " name))))) + +(ert-deftest test-cbf-buffer-differs-choices-clean-help-mentions-whitespace () + "Normal: the clean option's description (the ? help) names whitespace." + (let ((entry (assq ?w (cj/--buffer-differs-choices)))) + (should (string-match-p "whitespace" (or (nth 2 entry) ""))))) + +(ert-deftest test-cbf-buffer-differs-choices-revert-help-mentions-disk () + "Normal: the revert option's description makes clear it rereads from disk." + (let ((entry (assq ?r (cj/--buffer-differs-choices)))) + (should (string-match-p "disk" (or (nth 2 entry) ""))))) + +;;; ---------------------- cj/--buffer-differs-action -------------------------- + +(ert-deftest test-cbf-buffer-differs-action-save () + "Normal: s overwrites the file with the buffer." + (should (eq (cj/--buffer-differs-action ?s) 'save))) + +(ert-deftest test-cbf-buffer-differs-action-clean () + "Normal: w cleans whitespace, then saves." + (should (eq (cj/--buffer-differs-action ?w) 'clean-save))) + +(ert-deftest test-cbf-buffer-differs-action-revert () + "Normal: r discards edits and rereads from disk." + (should (eq (cj/--buffer-differs-action ?r) 'revert))) + +(ert-deftest test-cbf-buffer-differs-action-diff () + "Normal: d peeks at the diff (re-prompt is the caller's concern)." + (should (eq (cj/--buffer-differs-action ?d) 'diff))) + +(ert-deftest test-cbf-buffer-differs-action-cancel () + "Boundary: c cancels, leaving the buffer untouched." + (should (eq (cj/--buffer-differs-action ?c) 'cancel))) + +(ert-deftest test-cbf-buffer-differs-action-unknown () + "Error: an unmapped key returns nil." + (should-not (cj/--buffer-differs-action ?z))) + +;;; ------------------- cj/--buffer-changed-on-disk-p -------------------------- +;; Real visited-file buffers; modtime state is driven (set-visited-file-modtime), +;; not mocked. The trigger is the disk-changed conflict: modified AND the file +;; changed on disk since visited. + +(declare-function cj/--buffer-changed-on-disk-p "custom-buffer-file" (buffer)) + +(defun test-cbf-cod--with-visited (edit-fn body-fn) + "Visit a temp file, run EDIT-FN in its buffer, call BODY-FN with the buffer." + (let ((f (make-temp-file "cbf-cod-" nil ".txt"))) + (unwind-protect + (progn + (with-temp-file f (insert "original\n")) + (let ((buf (find-file-noselect f))) + (unwind-protect + (with-current-buffer buf (funcall edit-fn) (funcall body-fn buf)) + (with-current-buffer buf (set-buffer-modified-p nil)) + (kill-buffer buf)))) + (when (file-exists-p f) (delete-file f))))) + +(ert-deftest test-cbf-changed-on-disk-detects () + "Normal: modified buffer whose recorded modtime no longer matches is changed-on-disk." + (test-cbf-cod--with-visited + (lambda () (goto-char (point-max)) (insert "edit\n") (set-visited-file-modtime '(0 0))) + (lambda (buf) (should (cj/--buffer-changed-on-disk-p buf))))) + +(ert-deftest test-cbf-changed-on-disk-clean-modtime () + "Boundary: modified buffer whose modtime still matches is not changed-on-disk." + (test-cbf-cod--with-visited + (lambda () (goto-char (point-max)) (insert "edit\n")) + (lambda (buf) (should-not (cj/--buffer-changed-on-disk-p buf))))) + +(ert-deftest test-cbf-changed-on-disk-unmodified () + "Boundary: an unmodified buffer is never changed-on-disk (nothing of mine to lose)." + (test-cbf-cod--with-visited + (lambda () (set-visited-file-modtime '(0 0))) + (lambda (buf) (should-not (cj/--buffer-changed-on-disk-p buf))))) + +;;; -------------- cj/--buffer-differs-dispatch (data direction) --------------- +;; The destructive directions, driven against real files: `save' overwrites the +;; disk with the buffer (buffer wins); `revert' discards the buffer's edits and +;; rereads the disk (disk wins); `clean-save' strips trailing whitespace first. + +(declare-function cj/--buffer-differs-dispatch "custom-buffer-file" (buffer action)) +(declare-function cj/save-buffer "custom-buffer-file" ()) + +(defun test-cbf-disp--with-conflict (buffer-insert disk-content body-fn) + "Visit a temp file, BUFFER-INSERT into the buffer, overwrite the file with +DISK-CONTENT underneath, then call BODY-FN with the buffer and file path." + (let ((f (make-temp-file "cbf-disp-" nil ".txt"))) + (unwind-protect + (progn + (with-temp-file f (insert "original\n")) + (let ((buf (find-file-noselect f))) + (unwind-protect + (with-current-buffer buf + (goto-char (point-max)) (insert buffer-insert) + (with-temp-file f (insert disk-content)) + (funcall body-fn buf f)) + (with-current-buffer buf (set-buffer-modified-p nil)) + (kill-buffer buf)))) + (when (file-exists-p f) (delete-file f))))) + +(defun test-cbf-disp--disk (f) + "Return the on-disk contents of F." + (with-temp-buffer (insert-file-contents f) (buffer-string))) + +(ert-deftest test-cbf-buffer-differs-dispatch-save-overwrites-disk () + "Normal: save writes the buffer over the disk version (buffer wins)." + (test-cbf-disp--with-conflict + "my edit\n" "disk changed underneath\n" + (lambda (buf f) + (cj/--buffer-differs-dispatch buf 'save) + (should-not (buffer-modified-p buf)) + (should (string= (test-cbf-disp--disk f) "original\nmy edit\n"))))) + +(ert-deftest test-cbf-buffer-differs-dispatch-revert-discards-edits () + "Normal: revert discards the buffer's edits and rereads the disk (disk wins)." + (test-cbf-disp--with-conflict + "my edit\n" "disk version\n" + (lambda (buf f) + (cj/--buffer-differs-dispatch buf 'revert) + (should-not (buffer-modified-p buf)) + (should (string= (with-current-buffer buf (buffer-string)) "disk version\n"))))) + +(ert-deftest test-cbf-buffer-differs-dispatch-clean-save-strips-whitespace () + "Normal: clean-save strips trailing whitespace, then overwrites the disk." + (test-cbf-disp--with-conflict + "edit \n" "disk changed\n" + (lambda (buf f) + (cj/--buffer-differs-dispatch buf 'clean-save) + (should-not (buffer-modified-p buf)) + (should (string= (test-cbf-disp--disk f) "original\nedit\n"))))) + +(ert-deftest test-cbf-save-buffer-fast-path-no-conflict () + "Boundary: with no disk conflict, cj/save-buffer just saves (no prompt path)." + (let ((f (make-temp-file "cbf-fast-" nil ".txt"))) + (unwind-protect + (progn + (with-temp-file f (insert "base\n")) + (let ((buf (find-file-noselect f))) + (unwind-protect + (with-current-buffer buf + (goto-char (point-max)) (insert "added\n") + (cj/save-buffer) ; modtime matches -> fast path + (should-not (buffer-modified-p)) + (should (string= (test-cbf-disp--disk f) "base\nadded\n"))) + (with-current-buffer buf (set-buffer-modified-p nil)) + (kill-buffer buf)))) + (when (file-exists-p f) (delete-file f))))) + +(provide 'test-custom-buffer-file--buffer-differs-prompt) +;;; test-custom-buffer-file--buffer-differs-prompt.el ends here diff --git a/tests/test-custom-buffer-file--diff-whitespace-only.el b/tests/test-custom-buffer-file--diff-whitespace-only.el new file mode 100644 index 000000000..e792637b5 --- /dev/null +++ b/tests/test-custom-buffer-file--diff-whitespace-only.el @@ -0,0 +1,146 @@ +;;; test-custom-buffer-file--diff-whitespace-only.el --- whitespace-only diff detection -*- lexical-binding: t; -*- + +;;; Commentary: +;; Tests for cj/--diff-whitespace-only-p, the route-1 detector behind the +;; buffer-differs save prompt: two files differ ONLY in whitespace when a plain +;; diff finds changes but `diff -w' (ignore all whitespace) finds none. Uses +;; real temp files and the real diff(1) binary (a system boundary we keep), so +;; nothing is mocked. + +;;; Code: + +(require 'ert) +(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) +(require 'custom-buffer-file) + +(declare-function cj/--diff-whitespace-only-p "custom-buffer-file" (file-a file-b)) + +(defun test-cbf-ws--two-files (content-a content-b fn) + "Write CONTENT-A and CONTENT-B to temp files, call FN with their paths, clean up." + (let ((a (make-temp-file "cbf-ws-a-")) + (b (make-temp-file "cbf-ws-b-"))) + (unwind-protect + (progn + (with-temp-file a (insert content-a)) + (with-temp-file b (insert content-b)) + (funcall fn a b)) + (delete-file a) + (delete-file b)))) + +(ert-deftest test-cbf-diff-whitespace-only-trailing () + "Normal: files differing only by trailing whitespace are whitespace-only." + (test-cbf-ws--two-files + "alpha\nbeta\n" "alpha \nbeta\n" + (lambda (a b) (should (cj/--diff-whitespace-only-p a b))))) + +(ert-deftest test-cbf-diff-whitespace-only-indentation () + "Normal: files differing only by leading indentation are whitespace-only." + (test-cbf-ws--two-files + "(foo)\n(bar)\n" "(foo)\n (bar)\n" + (lambda (a b) (should (cj/--diff-whitespace-only-p a b))))) + +(ert-deftest test-cbf-diff-whitespace-only-real-content () + "Normal: files differing in actual content are NOT whitespace-only." + (test-cbf-ws--two-files + "alpha\nbeta\n" "alpha\nGAMMA\n" + (lambda (a b) (should-not (cj/--diff-whitespace-only-p a b))))) + +(ert-deftest test-cbf-diff-whitespace-only-identical () + "Boundary: identical files do not differ at all, so not whitespace-only." + (test-cbf-ws--two-files + "alpha\nbeta\n" "alpha\nbeta\n" + (lambda (a b) (should-not (cj/--diff-whitespace-only-p a b))))) + +(ert-deftest test-cbf-diff-whitespace-only-mixed () + "Boundary: whitespace change plus a real content change is NOT whitespace-only." + (test-cbf-ws--two-files + "alpha\nbeta\n" "alpha \nGAMMA\n" + (lambda (a b) (should-not (cj/--diff-whitespace-only-p a b))))) + +;;; -------------------- cj/--diff-buffer-renderer ----------------------------- +;; Which renderer the diff command uses: whitespace-only diffs go to a plain +;; unified diff (trailing whitespace highlighted, so it is actually visible) +;; because difftastic treats trailing-whitespace as no change and renders it +;; blank. Real content diffs use difftastic when available, else plain diff. + +(declare-function cj/--diff-buffer-renderer "custom-buffer-file" (ws-only difft-available)) + +(ert-deftest test-cbf-diff-renderer-whitespace-over-difftastic () + "Normal: a whitespace-only diff uses the whitespace renderer even when difft is present." + (should (eq (cj/--diff-buffer-renderer t t) 'whitespace))) + +(ert-deftest test-cbf-diff-renderer-whitespace-no-difft () + "Boundary: whitespace-only still uses the whitespace renderer without difft." + (should (eq (cj/--diff-buffer-renderer t nil) 'whitespace))) + +(ert-deftest test-cbf-diff-renderer-content-uses-difftastic () + "Normal: a content diff uses difftastic when it is available." + (should (eq (cj/--diff-buffer-renderer nil t) 'difftastic))) + +(ert-deftest test-cbf-diff-renderer-content-no-difft-regular () + "Boundary: a content diff falls back to the regular renderer without difft." + (should (eq (cj/--diff-buffer-renderer nil nil) 'regular))) + +;;; --------------- cj/--buffer-file-whitespace-only-p (buffer) ---------------- +;; Buffer-vs-its-file variant: writes the buffer to a temp file and reuses the +;; detector against the buffer's visited file. Uses a real visited-file buffer. + +(declare-function cj/--buffer-file-whitespace-only-p "custom-buffer-file" (buffer)) + +(defun test-cbf-ws--with-visited (disk-content edit-fn body-fn) + "Visit a temp file holding DISK-CONTENT, apply EDIT-FN in it, call BODY-FN with the buffer." + (let ((f (make-temp-file "cbf-bws-" nil ".txt"))) + (unwind-protect + (progn + (with-temp-file f (insert disk-content)) + (let ((buf (find-file-noselect f))) + (unwind-protect + (with-current-buffer buf + (funcall edit-fn) + (funcall body-fn buf)) + (with-current-buffer buf (set-buffer-modified-p nil)) + (kill-buffer buf)))) + (when (file-exists-p f) (delete-file f))))) + +(ert-deftest test-cbf-buffer-file-ws-only-trailing () + "Normal: an unsaved trailing-whitespace edit is whitespace-only vs the file." + (test-cbf-ws--with-visited + "alpha\nbeta\n" + (lambda () (goto-char (point-min)) (end-of-line) (insert " ")) + (lambda (buf) (should (cj/--buffer-file-whitespace-only-p buf))))) + +(ert-deftest test-cbf-buffer-file-ws-only-content () + "Normal: an unsaved content edit is NOT whitespace-only vs the file." + (test-cbf-ws--with-visited + "alpha\nbeta\n" + (lambda () (goto-char (point-max)) (insert "gamma\n")) + (lambda (buf) (should-not (cj/--buffer-file-whitespace-only-p buf))))) + +;;; --------- cj/diff-buffer-with-file return value (for the toggle) ----------- + +(ert-deftest test-cbf-diff-returns-buffer-when-differs () + "Normal: cj/diff-buffer-with-file returns the live diff buffer when the buffer differs." + (test-cbf-ws--with-visited + "x\ny\n" + (lambda () (goto-char (point-max)) (insert "ADDED\n")) + (lambda (buf) + (let ((db (with-current-buffer buf (cj/diff-buffer-with-file)))) + (should (bufferp db)) + (should (buffer-live-p db)))))) + +(ert-deftest test-cbf-diff-returns-nil-when-identical () + "Boundary: with no differences, cj/diff-buffer-with-file returns nil." + (test-cbf-ws--with-visited + "x\ny\n" + (lambda () nil) + (lambda (buf) + (should-not (with-current-buffer buf (cj/diff-buffer-with-file)))))) + +(ert-deftest test-cbf-buffer-file-ws-only-non-file () + "Boundary: a buffer not visiting a file is not whitespace-only." + (with-temp-buffer + (insert "scratch") + (should-not (cj/--buffer-file-whitespace-only-p (current-buffer))))) + +(provide 'test-custom-buffer-file--diff-whitespace-only) +;;; test-custom-buffer-file--diff-whitespace-only.el ends here diff --git a/tests/test-custom-buffer-file--save-some-buffers.el b/tests/test-custom-buffer-file--save-some-buffers.el new file mode 100644 index 000000000..d4ecd318d --- /dev/null +++ b/tests/test-custom-buffer-file--save-some-buffers.el @@ -0,0 +1,123 @@ +;;; test-custom-buffer-file--save-some-buffers.el --- save-loop prompt pieces -*- lexical-binding: t; -*- + +;;; Commentary: +;; Pure-logic tests for the read-multiple-choice save loop that replaces +;; save-some-buffers' terse map-y-or-n-p prompt: the key->action mapping (what +;; to do with this buffer, and how the choice steers the rest of the loop) and +;; the labeled choice list. The interactive loop, the file saves, and the +;; override wiring are exercised live, not here. + +;;; Code: + +(require 'ert) +(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) +(require 'custom-buffer-file) + +(declare-function cj/--save-some-buffers-action "custom-buffer-file" (key)) +(declare-function cj/--save-some-buffers-choices "custom-buffer-file" ()) + +;;; --------------------- cj/--save-some-buffers-action ------------------------ +;; Each result is (THIS-ACTION . LOOP-EFFECT): +;; THIS-ACTION ∈ save | clean-save | skip | diff +;; LOOP-EFFECT ∈ continue | save-rest | stop | reprompt + +(ert-deftest test-cbf-ssb-action-save () + "Normal: y saves this buffer and continues prompting." + (should (equal (cj/--save-some-buffers-action ?y) '(save . continue)))) + +(ert-deftest test-cbf-ssb-action-skip () + "Normal: n skips this buffer and continues." + (should (equal (cj/--save-some-buffers-action ?n) '(skip . continue)))) + +(ert-deftest test-cbf-ssb-action-clean-save () + "Normal: w cleans whitespace, saves this buffer, and continues." + (should (equal (cj/--save-some-buffers-action ?w) '(clean-save . continue)))) + +(ert-deftest test-cbf-ssb-action-save-rest () + "Boundary: ! saves this buffer and all remaining without asking." + (should (equal (cj/--save-some-buffers-action ?!) '(save . save-rest)))) + +(ert-deftest test-cbf-ssb-action-save-this-stop () + "Boundary: . saves this buffer and skips the rest." + (should (equal (cj/--save-some-buffers-action ?.) '(save . stop)))) + +(ert-deftest test-cbf-ssb-action-quit () + "Boundary: q saves no more buffers (skips this and the rest)." + (should (equal (cj/--save-some-buffers-action ?q) '(skip . stop)))) + +(ert-deftest test-cbf-ssb-action-diff () + "Normal: d views the diff and re-prompts rather than resolving." + (should (equal (cj/--save-some-buffers-action ?d) '(diff . reprompt)))) + +(ert-deftest test-cbf-ssb-action-unknown () + "Error: an unmapped key returns nil." + (should-not (cj/--save-some-buffers-action ?z))) + +;;; --------------------- cj/--save-some-buffers-choices ----------------------- + +(ert-deftest test-cbf-ssb-choices-cover-all-keys () + "Normal: the choice list offers every save-loop key, each labeled." + (let ((choices (cj/--save-some-buffers-choices))) + (dolist (key '(?y ?n ?w ?d ?! ?. ?q)) + (let ((entry (assq key choices))) + (should entry) + ;; entry is (KEY NAME &optional DESC); NAME must be a non-empty label. + (should (stringp (nth 1 entry))) + (should (> (length (nth 1 entry)) 0)))))) + +(ert-deftest test-cbf-ssb-choices-terse-names () + "Boundary: inline names are single words so the menu takes minimum space." + (dolist (entry (cj/--save-some-buffers-choices)) + (let ((name (nth 1 entry))) + (should (stringp name)) + (should-not (string-match-p " " name))))) + +(ert-deftest test-cbf-ssb-choices-clean-mentions-whitespace () + "Normal: the clean-and-save choice is labeled with whitespace." + (let ((entry (assq ?w (cj/--save-some-buffers-choices)))) + (should (string-match-p "whitespace" + (mapconcat #'identity (cdr entry) " "))))) + +;;; ---------------------- cj/--save-some-buffers-plan ------------------------- +;; The pure planner: given the candidate BUFFERS and a KEY-FN that yields a +;; (non-diff) key per buffer, resolve each to `save' / `clean-save' / `skip', +;; honoring ! (save the rest) and . / q (stop after this). Buffers are opaque +;; here (symbols stand in), so the planner is testable without real buffers. + +(declare-function cj/--save-some-buffers-plan "custom-buffer-file" (buffers key-fn)) + +(ert-deftest test-cbf-ssb-plan-mixed () + "Normal: y / n / w resolve per-buffer to save / skip / clean-save." + (let* ((keys '((a . ?y) (b . ?n) (c . ?w))) + (plan (cj/--save-some-buffers-plan + '(a b c) (lambda (buf) (cdr (assq buf keys)))))) + (should (equal plan '((a . save) (b . skip) (c . clean-save)))))) + +(ert-deftest test-cbf-ssb-plan-save-rest () + "Boundary: ! saves this and all remaining without consulting KEY-FN again." + (let* ((asked nil) + (plan (cj/--save-some-buffers-plan + '(a b c) + (lambda (buf) (push buf asked) (if (eq buf 'a) ?! ?n))))) + (should (equal plan '((a . save) (b . save) (c . save)))) + ;; key-fn consulted only for the first buffer; the rest ride save-all. + (should (equal asked '(a))))) + +(ert-deftest test-cbf-ssb-plan-save-this-stop () + "Boundary: . saves this buffer and skips the rest." + (let ((plan (cj/--save-some-buffers-plan + '(a b c) (lambda (buf) (if (eq buf 'a) ?. ?y))))) + (should (equal plan '((a . save) (b . skip) (c . skip)))))) + +(ert-deftest test-cbf-ssb-plan-quit-skips-all () + "Boundary: q skips this buffer and all remaining." + (let ((plan (cj/--save-some-buffers-plan + '(a b c) (lambda (_) ?q)))) + (should (equal plan '((a . skip) (b . skip) (c . skip)))))) + +(ert-deftest test-cbf-ssb-plan-empty () + "Boundary: no candidate buffers yields an empty plan." + (should-not (cj/--save-some-buffers-plan '() (lambda (_) ?y)))) + +(provide 'test-custom-buffer-file--save-some-buffers) +;;; test-custom-buffer-file--save-some-buffers.el ends here diff --git a/tests/test-custom-misc-cj--count-characters.el b/tests/test-custom-counts--count-characters.el index 1834b5c4f..8abd759f9 100644 --- a/tests/test-custom-misc-cj--count-characters.el +++ b/tests/test-custom-counts--count-characters.el @@ -1,7 +1,7 @@ -;;; test-custom-misc-cj--count-characters.el --- Tests for cj/--count-characters -*- lexical-binding: t; -*- +;;; test-custom-counts--count-characters.el --- Tests for cj/--count-characters -*- lexical-binding: t; -*- ;;; Commentary: -;; Tests for the cj/--count-characters internal implementation function from custom-misc.el +;; Tests for the cj/--count-characters internal implementation function from custom-counts.el ;; ;; This internal function counts characters between START and END positions. ;; It validates that START is not greater than END and returns the character count. @@ -18,7 +18,7 @@ "Stub keymap for testing.") ;; Now load the actual production module -(require 'custom-misc) +(require 'custom-counts) ;;; Setup and Teardown @@ -34,7 +34,7 @@ ;;; Normal Cases -(ert-deftest test-custom-misc-cj--count-characters-normal-simple-text-returns-count () +(ert-deftest test-custom-counts--count-characters-normal-simple-text-returns-count () "Should count characters in simple text region." (test-count-characters-setup) (unwind-protect @@ -44,7 +44,7 @@ (should (= result 13)))) (test-count-characters-teardown))) -(ert-deftest test-custom-misc-cj--count-characters-normal-partial-region-returns-count () +(ert-deftest test-custom-counts--count-characters-normal-partial-region-returns-count () "Should count characters in partial region." (test-count-characters-setup) (unwind-protect @@ -54,7 +54,7 @@ (should (= result 5)))) (test-count-characters-teardown))) -(ert-deftest test-custom-misc-cj--count-characters-normal-multiline-returns-count () +(ert-deftest test-custom-counts--count-characters-normal-multiline-returns-count () "Should count characters including newlines." (test-count-characters-setup) (unwind-protect @@ -67,7 +67,7 @@ ;;; Boundary Cases -(ert-deftest test-custom-misc-cj--count-characters-boundary-empty-region-returns-zero () +(ert-deftest test-custom-counts--count-characters-boundary-empty-region-returns-zero () "Should return 0 for empty region (start equals end)." (test-count-characters-setup) (unwind-protect @@ -77,7 +77,7 @@ (should (= result 0)))) (test-count-characters-teardown))) -(ert-deftest test-custom-misc-cj--count-characters-boundary-single-character-returns-one () +(ert-deftest test-custom-counts--count-characters-boundary-single-character-returns-one () "Should return 1 for single character region." (test-count-characters-setup) (unwind-protect @@ -87,7 +87,7 @@ (should (= result 1)))) (test-count-characters-teardown))) -(ert-deftest test-custom-misc-cj--count-characters-boundary-large-region-returns-count () +(ert-deftest test-custom-counts--count-characters-boundary-large-region-returns-count () "Should handle very large region." (test-count-characters-setup) (unwind-protect @@ -98,7 +98,7 @@ (should (= result 100000))))) (test-count-characters-teardown))) -(ert-deftest test-custom-misc-cj--count-characters-boundary-unicode-returns-count () +(ert-deftest test-custom-counts--count-characters-boundary-unicode-returns-count () "Should count unicode characters (emoji, RTL text, combining characters)." (test-count-characters-setup) (unwind-protect @@ -110,7 +110,7 @@ (should (= result (- (point-max) (point-min)))))) (test-count-characters-teardown))) -(ert-deftest test-custom-misc-cj--count-characters-boundary-whitespace-only-returns-count () +(ert-deftest test-custom-counts--count-characters-boundary-whitespace-only-returns-count () "Should count whitespace characters." (test-count-characters-setup) (unwind-protect @@ -121,7 +121,7 @@ (should (= result 7)))) (test-count-characters-teardown))) -(ert-deftest test-custom-misc-cj--count-characters-boundary-newlines-at-boundaries-returns-count () +(ert-deftest test-custom-counts--count-characters-boundary-newlines-at-boundaries-returns-count () "Should count newlines at start and end." (test-count-characters-setup) (unwind-protect @@ -132,7 +132,7 @@ (should (= result 9)))) (test-count-characters-teardown))) -(ert-deftest test-custom-misc-cj--count-characters-boundary-binary-content-returns-count () +(ert-deftest test-custom-counts--count-characters-boundary-binary-content-returns-count () "Should handle binary content." (test-count-characters-setup) (unwind-protect @@ -144,7 +144,7 @@ ;;; Error Cases -(ert-deftest test-custom-misc-cj--count-characters-error-start-greater-than-end-signals-error () +(ert-deftest test-custom-counts--count-characters-error-start-greater-than-end-signals-error () "Should signal error when start is greater than end." (test-count-characters-setup) (unwind-protect @@ -154,7 +154,7 @@ :type 'error)) (test-count-characters-teardown))) -(ert-deftest test-custom-misc-cj--count-characters-error-positions-out-of-bounds-handled () +(ert-deftest test-custom-counts--count-characters-error-positions-out-of-bounds-handled () "Should handle positions beyond buffer bounds (Emacs handles this)." (test-count-characters-setup) (unwind-protect @@ -167,5 +167,5 @@ (should (= result 5)))) (test-count-characters-teardown))) -(provide 'test-custom-misc-cj--count-characters) -;;; test-custom-misc-cj--count-characters.el ends here +(provide 'test-custom-counts--count-characters) +;;; test-custom-counts--count-characters.el ends here diff --git a/tests/test-custom-misc-cj-count-characters-buffer-or-region.el b/tests/test-custom-counts-count-characters-buffer-or-region.el index dbbda00d8..adeb812a8 100644 --- a/tests/test-custom-misc-cj-count-characters-buffer-or-region.el +++ b/tests/test-custom-counts-count-characters-buffer-or-region.el @@ -1,7 +1,7 @@ -;;; test-custom-misc-cj-count-characters-buffer-or-region.el --- Tests for cj/count-characters-buffer-or-region -*- lexical-binding: t; -*- +;;; test-custom-counts-count-characters-buffer-or-region.el --- Tests for cj/count-characters-buffer-or-region -*- lexical-binding: t; -*- ;;; Commentary: -;; Tests for the cj/count-characters-buffer-or-region function from custom-misc.el +;; Tests for the cj/count-characters-buffer-or-region function from custom-counts.el ;; ;; This function counts characters in the active region or the entire buffer ;; if no region is active. It displays the count in the minibuffer. @@ -18,7 +18,7 @@ "Stub keymap for testing.") ;; Now load the actual production module -(require 'custom-misc) +(require 'custom-counts) ;;; Setup and Teardown @@ -35,7 +35,7 @@ ;;; Normal Cases -(ert-deftest test-custom-misc-cj-count-characters-buffer-or-region-normal-whole-buffer-counts-all () +(ert-deftest test-custom-counts-count-characters-buffer-or-region-normal-whole-buffer-counts-all () "Should count all characters in buffer when no region is active." (test-count-characters-buffer-or-region-setup) (unwind-protect @@ -51,7 +51,7 @@ (should (string-match-p "13 characters.*buffer" message-output))))) (test-count-characters-buffer-or-region-teardown))) -(ert-deftest test-custom-misc-cj-count-characters-buffer-or-region-normal-active-region-counts-region () +(ert-deftest test-custom-counts-count-characters-buffer-or-region-normal-active-region-counts-region () "Should count characters in active region." (test-count-characters-buffer-or-region-setup) (unwind-protect @@ -70,7 +70,7 @@ (should (string-match-p "5 characters.*region" message-output))))) (test-count-characters-buffer-or-region-teardown))) -(ert-deftest test-custom-misc-cj-count-characters-buffer-or-region-normal-multiline-buffer-counts-all () +(ert-deftest test-custom-counts-count-characters-buffer-or-region-normal-multiline-buffer-counts-all () "Should count characters including newlines in buffer." (test-count-characters-buffer-or-region-setup) (unwind-protect @@ -86,7 +86,7 @@ (should (string-match-p "20 characters.*buffer" message-output))))) (test-count-characters-buffer-or-region-teardown))) -(ert-deftest test-custom-misc-cj-count-characters-buffer-or-region-normal-multiline-region-counts-region () +(ert-deftest test-custom-counts-count-characters-buffer-or-region-normal-multiline-region-counts-region () "Should count characters including newlines in region." (test-count-characters-buffer-or-region-setup) (unwind-protect @@ -108,7 +108,7 @@ ;;; Boundary Cases -(ert-deftest test-custom-misc-cj-count-characters-buffer-or-region-boundary-empty-buffer-returns-zero () +(ert-deftest test-custom-counts-count-characters-buffer-or-region-boundary-empty-buffer-returns-zero () "Should return 0 for empty buffer." (test-count-characters-buffer-or-region-setup) (unwind-protect @@ -122,7 +122,7 @@ (should (string-match-p "0 characters.*buffer" message-output))))) (test-count-characters-buffer-or-region-teardown))) -(ert-deftest test-custom-misc-cj-count-characters-buffer-or-region-boundary-empty-region-counts-buffer () +(ert-deftest test-custom-counts-count-characters-buffer-or-region-boundary-empty-region-counts-buffer () "Should count whole buffer when region is empty (point equals mark). When mark and point are at the same position, use-region-p returns nil, so the function correctly falls back to counting the entire buffer." @@ -144,7 +144,7 @@ so the function correctly falls back to counting the entire buffer." (should (string-match-p "13 characters.*buffer" message-output))))) (test-count-characters-buffer-or-region-teardown))) -(ert-deftest test-custom-misc-cj-count-characters-buffer-or-region-boundary-large-buffer-counts-all () +(ert-deftest test-custom-counts-count-characters-buffer-or-region-boundary-large-buffer-counts-all () "Should handle very large buffer." (test-count-characters-buffer-or-region-setup) (unwind-protect @@ -160,7 +160,7 @@ so the function correctly falls back to counting the entire buffer." (should (string-match-p "100000 characters.*buffer" message-output)))))) (test-count-characters-buffer-or-region-teardown))) -(ert-deftest test-custom-misc-cj-count-characters-buffer-or-region-boundary-unicode-counts-correctly () +(ert-deftest test-custom-counts-count-characters-buffer-or-region-boundary-unicode-counts-correctly () "Should count unicode characters (emoji, RTL text) correctly." (test-count-characters-buffer-or-region-setup) (unwind-protect @@ -177,7 +177,7 @@ so the function correctly falls back to counting the entire buffer." message-output))))) (test-count-characters-buffer-or-region-teardown))) -(ert-deftest test-custom-misc-cj-count-characters-buffer-or-region-boundary-whitespace-only-counts-whitespace () +(ert-deftest test-custom-counts-count-characters-buffer-or-region-boundary-whitespace-only-counts-whitespace () "Should count whitespace characters." (test-count-characters-buffer-or-region-setup) (unwind-protect @@ -193,7 +193,7 @@ so the function correctly falls back to counting the entire buffer." (should (string-match-p "7 characters.*buffer" message-output))))) (test-count-characters-buffer-or-region-teardown))) -(ert-deftest test-custom-misc-cj-count-characters-buffer-or-region-boundary-single-character-returns-one () +(ert-deftest test-custom-counts-count-characters-buffer-or-region-boundary-single-character-returns-one () "Should return 1 for single character buffer." (test-count-characters-buffer-or-region-setup) (unwind-protect @@ -208,7 +208,7 @@ so the function correctly falls back to counting the entire buffer." (should (string-match-p "1 character.*buffer" message-output))))) (test-count-characters-buffer-or-region-teardown))) -(ert-deftest test-custom-misc-cj-count-characters-buffer-or-region-boundary-narrowed-buffer-counts-visible () +(ert-deftest test-custom-counts-count-characters-buffer-or-region-boundary-narrowed-buffer-counts-visible () "Should count only visible characters in narrowed buffer." (test-count-characters-buffer-or-region-setup) (unwind-protect @@ -227,5 +227,5 @@ so the function correctly falls back to counting the entire buffer." (should (string-match-p "7 characters.*buffer" message-output))))) (test-count-characters-buffer-or-region-teardown))) -(provide 'test-custom-misc-cj-count-characters-buffer-or-region) -;;; test-custom-misc-cj-count-characters-buffer-or-region.el ends here +(provide 'test-custom-counts-count-characters-buffer-or-region) +;;; test-custom-counts-count-characters-buffer-or-region.el ends here diff --git a/tests/test-custom-misc-count-words.el b/tests/test-custom-counts-count-words.el index f2bf793f4..642a5a411 100644 --- a/tests/test-custom-misc-count-words.el +++ b/tests/test-custom-counts-count-words.el @@ -1,7 +1,7 @@ -;;; test-custom-misc-count-words.el --- Tests for cj/--count-words -*- lexical-binding: t; -*- +;;; test-custom-counts-count-words.el --- Tests for cj/--count-words -*- lexical-binding: t; -*- ;;; Commentary: -;; Tests for the cj/--count-words function from custom-misc.el +;; Tests for the cj/--count-words function from custom-counts.el ;; ;; This function counts words in a region using Emacs's built-in count-words. ;; A word is defined by Emacs's word boundaries, which generally means @@ -24,7 +24,7 @@ "Stub keymap for testing.") ;; Now load the actual production module -(require 'custom-misc) +(require 'custom-counts) ;;; Test Helpers @@ -144,5 +144,5 @@ words in it.")) (let ((end (match-end 0))) (should (= 3 (cj/--count-words start end))))))) -(provide 'test-custom-misc-count-words) -;;; test-custom-misc-count-words.el ends here +(provide 'test-custom-counts-count-words) +;;; test-custom-counts-count-words.el ends here diff --git a/tests/test-custom-misc-format-region.el b/tests/test-custom-format-format-region.el index c40a8898e..27f1c6b99 100644 --- a/tests/test-custom-misc-format-region.el +++ b/tests/test-custom-format-format-region.el @@ -1,7 +1,7 @@ -;;; test-custom-misc-format-region.el --- Tests for cj/--format-region -*- lexical-binding: t; -*- +;;; test-custom-format-format-region.el --- Tests for cj/--format-region -*- lexical-binding: t; -*- ;;; Commentary: -;; Tests for the cj/--format-region function from custom-misc.el +;; Tests for the cj/--format-region function from custom-format.el ;; ;; This function reformats text by applying three operations: ;; 1. untabify - converts tabs to spaces @@ -28,7 +28,7 @@ "Stub keymap for testing.") ;; Now load the actual production module -(require 'custom-misc) +(require 'custom-format) ;;; Test Helpers @@ -157,5 +157,5 @@ Returns the buffer string after operation." ;; Should complete without error (should (string= (buffer-string) "hello world"))))) -(provide 'test-custom-misc-format-region) -;;; test-custom-misc-format-region.el ends here +(provide 'test-custom-format-format-region) +;;; test-custom-format-format-region.el ends here diff --git a/tests/test-custom-misc-jump-to-matching-paren.el b/tests/test-custom-line-paragraph-jump-to-matching-paren.el index 973b6dfa9..31853da67 100644 --- a/tests/test-custom-misc-jump-to-matching-paren.el +++ b/tests/test-custom-line-paragraph-jump-to-matching-paren.el @@ -1,7 +1,7 @@ -;;; test-custom-misc-jump-to-matching-paren.el --- Tests for cj/jump-to-matching-paren -*- lexical-binding: t; -*- +;;; test-custom-line-paragraph-jump-to-matching-paren.el --- Tests for cj/jump-to-matching-paren -*- lexical-binding: t; -*- ;;; Commentary: -;; Tests for the cj/jump-to-matching-paren function from custom-misc.el +;; Tests for the cj/jump-to-matching-paren function from custom-line-paragraph.el ;; ;; This function jumps to matching delimiters using Emacs's sexp navigation. ;; It works with any delimiter that has matching syntax according to the @@ -32,7 +32,7 @@ "Stub keymap for testing.") ;; Now load the actual production module -(require 'custom-misc) +(require 'custom-line-paragraph) ;;; Test Helpers @@ -193,5 +193,5 @@ POINT-POSITION is 1-indexed (1 = first character)." ;; The parens in the string should be ignored (should (= 18 (test-jump-to-matching-paren "(\"hello (world)\")" 1)))) -(provide 'test-custom-misc-jump-to-matching-paren) -;;; test-custom-misc-jump-to-matching-paren.el ends here +(provide 'test-custom-line-paragraph-jump-to-matching-paren) +;;; test-custom-line-paragraph-jump-to-matching-paren.el ends here diff --git a/tests/test-custom-misc-replace-fraction-glyphs.el b/tests/test-custom-text-transform-replace-fraction-glyphs.el index 81d1546e1..ed961c63e 100644 --- a/tests/test-custom-misc-replace-fraction-glyphs.el +++ b/tests/test-custom-text-transform-replace-fraction-glyphs.el @@ -1,7 +1,7 @@ -;;; test-custom-misc-replace-fraction-glyphs.el --- Tests for cj/--replace-fraction-glyphs -*- lexical-binding: t; -*- +;;; test-custom-text-transform-replace-fraction-glyphs.el --- Tests for cj/--replace-fraction-glyphs -*- lexical-binding: t; -*- ;;; Commentary: -;; Tests for the cj/--replace-fraction-glyphs function from custom-misc.el +;; Tests for the cj/--replace-fraction-glyphs function from custom-text-transform.el ;; ;; This function bidirectionally converts between text fractions (1/4) and ;; Unicode fraction glyphs (¼). It supports 5 common fractions: @@ -28,7 +28,7 @@ "Stub keymap for testing.") ;; Now load the actual production module -(require 'custom-misc) +(require 'custom-text-transform) ;;; Test Helpers @@ -181,5 +181,5 @@ Returns the buffer string after operation." ;; Should complete without error (should (string= (buffer-string) "1/4"))))) -(provide 'test-custom-misc-replace-fraction-glyphs) -;;; test-custom-misc-replace-fraction-glyphs.el ends here +(provide 'test-custom-text-transform-replace-fraction-glyphs) +;;; test-custom-text-transform-replace-fraction-glyphs.el ends here diff --git a/tests/test-dashboard-config-launchers.el b/tests/test-dashboard-config-launchers.el index a9a871979..53c46caa9 100644 --- a/tests/test-dashboard-config-launchers.el +++ b/tests/test-dashboard-config-launchers.el @@ -27,19 +27,20 @@ ;; Telegram moved from "g" to "G" so "g" is free for dashboard refresh. ;; Signal ("S") added as the 14th launcher. -(defconst test-dash--keys '("c" "d" "t" "a" "r" "b" "f" "m" "e" "i" "G" "s" "l" "S")) +;; Weather ("w") added after Agenda as the 15th launcher (top-row daily glance). +(defconst test-dash--keys '("c" "d" "t" "a" "w" "r" "b" "f" "m" "e" "i" "G" "s" "l" "S")) ;; ----------------------------- launcher table -------------------------------- (ert-deftest test-dashboard-launchers-keys-in-order () - "Normal: 14 launchers with the expected keys in display order." - (should (= 14 (length cj/dashboard--launchers))) + "Normal: 15 launchers with the expected keys in display order." + (should (= 15 (length cj/dashboard--launchers))) (should (equal test-dash--keys (mapcar (lambda (l) (nth 0 l)) cj/dashboard--launchers)))) (ert-deftest test-dashboard-launchers-labels-in-order () "Normal: labels in display order (Telegram and Slack reordered so Slack sits next to Linear on the last navigator row)." - (should (equal '("Code" "Files" "Terminal" "Agenda" "Feeds" "Books" + (should (equal '("Code" "Files" "Terminal" "Agenda" "Weather" "Feeds" "Books" "Flashcards" "Music" "Email" "IRC" "Telegram" "Slack" "Linear" "Signal") (mapcar (lambda (l) (nth 3 l)) cj/dashboard--launchers)))) @@ -50,18 +51,19 @@ next to Linear on the last navigator row)." ;; --------------------------- navigator rows ---------------------------------- -(ert-deftest test-dashboard-navigator-rows-grouped-4-4-3-3 () - "Normal: navigator derives rows per `cj/dashboard--row-sizes' (4 4 3 3), with -Slack, Linear, and Signal sharing the last row." +(ert-deftest test-dashboard-navigator-rows-grouped-5-4-3-3 () + "Normal: navigator derives rows per `cj/dashboard--row-sizes' (5 4 3 3), with +Weather joining the top row and Slack, Linear, and Signal sharing the last row." (cl-letf (((symbol-function 'nerd-icons-faicon) (lambda (n &rest _) (concat "I:" n))) ((symbol-function 'nerd-icons-devicon) (lambda (n &rest _) (concat "I:" n))) ((symbol-function 'nerd-icons-mdicon) (lambda (n &rest _) (concat "I:" n))) ((symbol-function 'nerd-icons-octicon) (lambda (n &rest _) (concat "I:" n))) - ((symbol-function 'nerd-icons-codicon) (lambda (n &rest _) (concat "I:" n)))) + ((symbol-function 'nerd-icons-codicon) (lambda (n &rest _) (concat "I:" n))) + ((symbol-function 'nerd-icons-wicon) (lambda (n &rest _) (concat "I:" n)))) (let ((rows (cj/dashboard--navigator-rows))) (should (= 4 (length rows))) - (should (equal '(4 4 3 3) (mapcar #'length rows))) - (should (equal '("Code" "Files" "Terminal" "Agenda") + (should (equal '(5 4 3 3) (mapcar #'length rows))) + (should (equal '("Code" "Files" "Terminal" "Agenda" "Weather") (mapcar (lambda (b) (nth 1 b)) (nth 0 rows)))) (should (equal '("Slack" "Linear" "Signal") (mapcar (lambda (b) (nth 1 b)) (nth 3 rows)))) @@ -86,7 +88,7 @@ Slack, Linear, and Signal sharing the last row." (let ((map (make-sparse-keymap)) (calls nil)) (cl-letf (((symbol-function 'projectile-switch-project) (lambda (&rest _) (push 'code calls))) ((symbol-function 'dirvish) (lambda (&rest _) (push 'files calls))) - ((symbol-function 'ghostel) (lambda (&rest _) (push 'term calls))) + ((symbol-function 'cj/term-toggle) (lambda (&rest _) (push 'term calls))) ((symbol-function 'cj/main-agenda-display) (lambda (&rest _) (push 'agenda calls))) ((symbol-function 'cj/elfeed-open) (lambda (&rest _) (push 'feeds calls))) ((symbol-function 'calibredb) (lambda (&rest _) (push 'books calls))) @@ -98,7 +100,10 @@ Slack, Linear, and Signal sharing the last row." ((symbol-function 'cj/slack-start) (lambda (&rest _) (push 'slack calls))) ((symbol-function 'cj/telega) (lambda (&rest _) (push 'tg calls))) ((symbol-function 'pearl-list-issues) (lambda (&rest _) (push 'linear calls))) - ((symbol-function 'cj/signel-message) (lambda (&rest _) (push 'signal calls)))) + ((symbol-function 'cj/signel-message) (lambda (&rest _) (push 'signal calls))) + ;; wttrin is invoked via `call-interactively', so the stub must be + ;; a command -- a plain variadic lambda masked the real arity bug. + ((symbol-function 'wttrin) (lambda (&rest _) (interactive) (push 'weather calls)))) (cj/dashboard--bind-launchers map) (dolist (key test-dash--keys) (call-interactively (keymap-lookup map key))) @@ -108,7 +113,8 @@ Slack, Linear, and Signal sharing the last row." (should (memq 'm-toggle calls)) (should (memq 'm-load calls)) (should (memq 'signal calls)) - (should (= 15 (length calls)))))) ; 14 keys, Music fires two + (should (memq 'weather calls)) + (should (= 16 (length calls)))))) ; 15 keys, Music fires two (provide 'test-dashboard-config-launchers) ;;; test-dashboard-config-launchers.el ends here diff --git a/tests/test-dirvish-config--dired-keys.el b/tests/test-dirvish-config--dired-keys.el new file mode 100644 index 000000000..2df0e8db6 --- /dev/null +++ b/tests/test-dirvish-config--dired-keys.el @@ -0,0 +1,23 @@ +;;; test-dirvish-config--dired-keys.el --- dired d=diff / D=delete bindings -*- lexical-binding: t; -*- + +;;; Commentary: +;; Regression: d and D in dired (and dirvish, which uses dired-mode-map) are the +;; diff and delete pair, matching the convention under C-; b and in ibuffer. A +;; mismatch -- or a swapped which-key label -- once led to deleting a file while +;; trying to diff it. + +;;; Code: + +(require 'ert) +(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) +(require 'dired) +(require 'dirvish-config) + +(ert-deftest test-dirvish-dired-d-diffs-D-deletes () + "Normal: dired d runs the ediff diff and D deletes, matching the d=diff / +D=delete convention used under C-; b and in ibuffer." + (should (eq (keymap-lookup dired-mode-map "d") #'cj/dired-ediff-files)) + (should (eq (keymap-lookup dired-mode-map "D") #'dired-do-delete))) + +(provide 'test-dirvish-config--dired-keys) +;;; test-dirvish-config--dired-keys.el ends here diff --git a/tests/test-eshell-config--prompt.el b/tests/test-eshell-config--prompt.el new file mode 100644 index 000000000..7073c7e0b --- /dev/null +++ b/tests/test-eshell-config--prompt.el @@ -0,0 +1,75 @@ +;;; test-eshell-config--prompt.el --- Tests for eshell prompt helpers -*- lexical-binding: t; -*- + +;;; Commentary: +;; Tests for the pure prompt-segment helpers added for zsh parity: the +;; .git/HEAD branch reader and the exit-status segment. + +;;; Code: + +(require 'ert) + +(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) +(require 'eshell-config) + +(defvar eshell-last-command-status) ; declared special for the status tests + +;;; cj/--eshell-git-branch + +(ert-deftest test-eshell-git-branch-reads-head () + "Normal: a .git/HEAD pointing at a branch returns the branch name." + (let ((dir (make-temp-file "esh-git-" t))) + (unwind-protect + (progn + (make-directory (expand-file-name ".git" dir)) + (with-temp-file (expand-file-name ".git/HEAD" dir) + (insert "ref: refs/heads/feature-x\n")) + (let ((default-directory (file-name-as-directory dir))) + (should (equal (cj/--eshell-git-branch) "feature-x")))) + (delete-directory dir t)))) + +(ert-deftest test-eshell-git-branch-no-repo-nil () + "Boundary: a directory with no .git returns nil." + (let ((dir (make-temp-file "esh-nogit-" t))) + (unwind-protect + (let ((default-directory (file-name-as-directory dir))) + (should-not (cj/--eshell-git-branch))) + (delete-directory dir t)))) + +(ert-deftest test-eshell-git-branch-detached-nil () + "Boundary: a detached HEAD (a raw SHA, no ref) returns nil." + (let ((dir (make-temp-file "esh-detached-" t))) + (unwind-protect + (progn + (make-directory (expand-file-name ".git" dir)) + (with-temp-file (expand-file-name ".git/HEAD" dir) + (insert "a1b2c3d4e5f6\n")) + (let ((default-directory (file-name-as-directory dir))) + (should-not (cj/--eshell-git-branch)))) + (delete-directory dir t)))) + +(ert-deftest test-eshell-git-branch-remote-skipped () + "Boundary: a remote default-directory is skipped (no TRAMP read)." + (let ((default-directory "/ssh:host:/some/path/")) + (should-not (cj/--eshell-git-branch)))) + +;;; cj/--eshell-prompt-status-segment + +(ert-deftest test-eshell-prompt-status-zero-empty () + "Normal: a zero exit status yields an empty segment." + (let ((eshell-last-command-status 0)) + (should (equal (cj/--eshell-prompt-status-segment) "")))) + +(ert-deftest test-eshell-prompt-status-nonzero-bracketed () + "Normal: a non-zero exit status is shown in brackets." + (let ((eshell-last-command-status 1)) + (should (equal (cj/--eshell-prompt-status-segment) " [1]"))) + (let ((eshell-last-command-status 130)) + (should (equal (cj/--eshell-prompt-status-segment) " [130]")))) + +(ert-deftest test-eshell-prompt-status-unset-empty () + "Boundary: an unset status yields an empty segment, no error." + (let ((eshell-last-command-status nil)) + (should (equal (cj/--eshell-prompt-status-segment) "")))) + +(provide 'test-eshell-config--prompt) +;;; test-eshell-config--prompt.el ends here diff --git a/tests/test-external-open-commands.el b/tests/test-external-open-commands.el index c0c83a340..3d8adc15e 100644 --- a/tests/test-external-open-commands.el +++ b/tests/test-external-open-commands.el @@ -81,8 +81,9 @@ ;;; cj/find-file-auto (ert-deftest test-external-open-find-file-auto-routes-media-externally () - "Normal: a `.mp4' filename (in `default-open-extensions') triggers -`cj/xdg-open' instead of the original `find-file'." + "Normal: a non-video external extension (`.docx', in +`default-open-extensions') triggers `cj/xdg-open' instead of the original +`find-file'." (let ((opened nil) (orig-called nil)) (cl-letf (((symbol-function 'cj/xdg-open) @@ -90,8 +91,23 @@ ;; orig-fun replacement -- shouldn't run for a routed extension. ((symbol-function 'cj/find-file-auto--orig-stub) (lambda (&rest _) (setq orig-called t)))) - (cj/find-file-auto #'cj/find-file-auto--orig-stub "/tmp/video.mp4")) - (should (equal opened "/tmp/video.mp4")) + (cj/find-file-auto #'cj/find-file-auto--orig-stub "/tmp/report.docx")) + (should (equal opened "/tmp/report.docx")) + (should-not orig-called))) + +(ert-deftest test-external-open-find-file-auto-routes-video-to-looping-player () + "Normal: a video filename triggers `cj/open-video-looping', not `cj/xdg-open' +or the original `find-file'." + (let ((looped nil) (xdg nil) (orig-called nil)) + (cl-letf (((symbol-function 'cj/open-video-looping) + (lambda (file) (setq looped file))) + ((symbol-function 'cj/xdg-open) + (lambda (_) (setq xdg t))) + ((symbol-function 'cj/find-file-auto--orig-stub) + (lambda (&rest _) (setq orig-called t)))) + (cj/find-file-auto #'cj/find-file-auto--orig-stub "/tmp/clip.mp4")) + (should (equal looped "/tmp/clip.mp4")) + (should-not xdg) (should-not orig-called))) (ert-deftest test-external-open-find-file-auto-passes-through-text-files () @@ -116,5 +132,66 @@ (cj/find-file-auto #'cj/find-file-auto--orig-stub nil)) (should orig-called))) +;;; cj/--video-file-p + +(ert-deftest test-external-open-video-file-p-matches-video () + "Normal: common video extensions match, case-insensitively." + (should (cj/--video-file-p "/tmp/a.mp4")) + (should (cj/--video-file-p "/tmp/a.mkv")) + (should (cj/--video-file-p "/tmp/a.webm")) + (should (cj/--video-file-p "/tmp/A.MP4"))) + +(ert-deftest test-external-open-video-file-p-rejects-non-video () + "Boundary: audio, docs, and nil do not match." + (should-not (cj/--video-file-p "/tmp/a.mp3")) + (should-not (cj/--video-file-p "/tmp/a.txt")) + (should-not (cj/--video-file-p "/tmp/a.docx")) + (should-not (cj/--video-file-p nil))) + +;;; cj/--video-open-arglist + +(ert-deftest test-external-open-video-arglist-appends-file-after-args () + "Normal: the player args precede the file in the argument list." + (let ((cj/video-open-args '("--loop-file=inf"))) + (should (equal (cj/--video-open-arglist "/tmp/a.mp4") + '("--loop-file=inf" "/tmp/a.mp4"))))) + +(ert-deftest test-external-open-video-arglist-respects-custom-args () + "Boundary: custom args are honored; empty args yields just the file." + (let ((cj/video-open-args '("--loop=inf" "--mute=yes"))) + (should (equal (cj/--video-open-arglist "/tmp/a.mkv") + '("--loop=inf" "--mute=yes" "/tmp/a.mkv")))) + (let ((cj/video-open-args nil)) + (should (equal (cj/--video-open-arglist "/tmp/a.mkv") '("/tmp/a.mkv"))))) + +;;; cj/open-video-looping + +(ert-deftest test-external-open-video-looping-calls-player-with-loop-args () + "Normal: posix path calls the player with loop args + file, async (no wait)." + (let ((tmp (make-temp-file "test-ext-video-" nil ".mp4")) + (call nil)) + (unwind-protect + (cl-letf (((symbol-function 'env-windows-p) (lambda () nil)) + ((symbol-function 'call-process) + (lambda (prog _infile dest _disp &rest args) + (setq call (list prog dest args)) + 0))) + (let ((cj/video-open-command "mpv") + (cj/video-open-args '("--loop-file=inf"))) + (cj/open-video-looping tmp))) + (delete-file tmp)) + (should (equal (nth 0 call) "mpv")) + (should (equal (nth 1 call) 0)) ; async destination: don't wait + (should (member "--loop-file=inf" (nth 2 call))) + (should (cl-find-if (lambda (a) (and (stringp a) + (string-match-p "\\.mp4\\'" a))) + (nth 2 call))))) + +(ert-deftest test-external-open-video-looping-errors-when-no-file () + "Error: a buffer with no associated file signals user-error." + (with-temp-buffer + (cl-letf (((symbol-function 'cj/file-from-context) (lambda (_) nil))) + (should-error (cj/open-video-looping) :type 'user-error)))) + (provide 'test-external-open-commands) ;;; test-external-open-commands.el ends here diff --git a/tests/test-font-config--frame-lifecycle.el b/tests/test-font-config--frame-lifecycle.el index 826edbd69..8f338b996 100644 --- a/tests/test-font-config--frame-lifecycle.el +++ b/tests/test-font-config--frame-lifecycle.el @@ -2,7 +2,7 @@ ;;; Commentary: ;; cj/apply-font-settings-to-frame, cj/cleanup-frame-list, and -;; cj/maybe-install-all-the-icons-fonts were defined inside use-package +;; cj/maybe-install-nerd-icons-fonts were defined inside use-package ;; :config / with-eval-after-load (unreachable under `make test'). Lifting ;; them to top level makes their branching unit-testable; env-gui-p and the ;; package side-effect calls are mocked at the boundary. @@ -57,9 +57,9 @@ (let ((installed nil)) (cl-letf (((symbol-function 'env-gui-p) (lambda () t)) ((symbol-function 'cj/font-installed-p) (lambda (_n) nil)) - ((symbol-function 'all-the-icons-install-fonts) (lambda (&rest _) (setq installed t))) + ((symbol-function 'nerd-icons-install-fonts) (lambda (&rest _) (setq installed t))) ((symbol-function 'remove-hook) #'ignore)) - (cj/maybe-install-all-the-icons-fonts)) + (cj/maybe-install-nerd-icons-fonts)) (should installed))) (ert-deftest test-font-maybe-install-icons-already-present-skips () @@ -67,8 +67,8 @@ (let ((installed nil)) (cl-letf (((symbol-function 'env-gui-p) (lambda () t)) ((symbol-function 'cj/font-installed-p) (lambda (_n) t)) - ((symbol-function 'all-the-icons-install-fonts) (lambda (&rest _) (setq installed t)))) - (cj/maybe-install-all-the-icons-fonts)) + ((symbol-function 'nerd-icons-install-fonts) (lambda (&rest _) (setq installed t)))) + (cj/maybe-install-nerd-icons-fonts)) (should-not installed))) (provide 'test-font-config--frame-lifecycle) diff --git a/tests/test-font-config.el b/tests/test-font-config.el index 8fada25e2..393a77584 100644 --- a/tests/test-font-config.el +++ b/tests/test-font-config.el @@ -5,9 +5,10 @@ ;; font-config.el is mostly top-level font/package setup. These smoke tests ;; cover the logic that should stay correct regardless of which fonts are ;; installed: the install check, and the daemon-frame font applier (env-gui-p -;; guard plus idempotency). The module :demand's fontaine and all-the-icons, -;; so the tests skip when those packages are absent rather than failing on a -;; bare checkout. GUI and font lookups are stubbed so the run stays headless. +;; guard plus idempotency). The module :demand's fontaine and references +;; nerd-icons, so the tests skip when those packages are absent rather than +;; failing on a bare checkout. GUI and font lookups are stubbed so the run +;; stays headless. ;;; Code: @@ -21,9 +22,8 @@ (defconst test-font-config--available (and (locate-library "fontaine") - (locate-library "all-the-icons") - (locate-library "all-the-icons-nerd-fonts")) - "Non-nil when the packages font-config :demand's are loadable.") + (locate-library "nerd-icons")) + "Non-nil when the packages font-config needs are loadable.") ;;; cj/font-installed-p diff --git a/tests/test-init-module-headers.el b/tests/test-init-module-headers.el index 478819b89..f395fd71f 100644 --- a/tests/test-init-module-headers.el +++ b/tests/test-init-module-headers.el @@ -35,7 +35,9 @@ "custom-datetime" "custom-buffer-file" "custom-line-paragraph" - "custom-misc" + "custom-counts" + "custom-format" + "custom-text-transform" "custom-ordering" "custom-text-enclose" "custom-whitespace" @@ -97,6 +99,10 @@ "ai-term" "browser-config" "calendar-sync" + "calendar-sync-ics" + "calendar-sync-recurrence" + "calendar-sync-org" + "calendar-sync-source" "calibredb-epub-config" "chrono-tools" "dirvish-config" @@ -129,7 +135,8 @@ "tramp-config" "transcription-config" "video-audio-recording" - "term-config" + "video-audio-recording-devices" + "video-audio-recording-capture" "weather-config" "wrap-up") "Modules annotated with the load-graph header contract. diff --git a/tests/test-local-repository--car-member.el b/tests/test-local-repository--car-member.el index 8b8c9a7db..30ae58c6b 100644 --- a/tests/test-local-repository--car-member.el +++ b/tests/test-local-repository--car-member.el @@ -1,7 +1,7 @@ -;;; test-local-repository--car-member.el --- Tests for car-member -*- lexical-binding: t -*- +;;; test-local-repository--car-member.el --- Tests for localrepo--car-member -*- lexical-binding: t -*- ;;; Commentary: -;; Tests for `car-member' in local-repository.el — the predicate +;; Tests for `localrepo--car-member' in local-repository.el — the predicate ;; localrepo-initialize uses to check whether an archive id is already ;; registered in package-archives / package-archive-priorities. @@ -12,47 +12,47 @@ ;;; Normal Cases -(ert-deftest test-local-repository-car-member-found () +(ert-deftest test-local-repository-localrepo--car-member-found () "Normal: VALUE present as a car returns the matching tail (non-nil)." - (should (equal (car-member 'b '((a . 1) (b . 2) (c . 3))) + (should (equal (localrepo--car-member 'b '((a . 1) (b . 2) (c . 3))) '(b c)))) -(ert-deftest test-local-repository-car-member-not-found () +(ert-deftest test-local-repository-localrepo--car-member-not-found () "Normal: VALUE absent from every car returns nil." - (should-not (car-member 'z '((a . 1) (b . 2))))) + (should-not (localrepo--car-member 'z '((a . 1) (b . 2))))) -(ert-deftest test-local-repository-car-member-string-car () +(ert-deftest test-local-repository-localrepo--car-member-string-car () "Normal: car comparison uses `equal', so string keys match by value." - (should (car-member "localrepo" + (should (localrepo--car-member "localrepo" '(("gnu" . "url1") ("localrepo" . "url2"))))) ;;; Boundary Cases -(ert-deftest test-local-repository-car-member-empty-list () +(ert-deftest test-local-repository-localrepo--car-member-empty-list () "Boundary: an empty list never matches." - (should-not (car-member 'a nil))) + (should-not (localrepo--car-member 'a nil))) -(ert-deftest test-local-repository-car-member-single-match () +(ert-deftest test-local-repository-localrepo--car-member-single-match () "Boundary: a single-element list whose car matches returns non-nil." - (should (car-member 'only '((only . 1))))) + (should (localrepo--car-member 'only '((only . 1))))) -(ert-deftest test-local-repository-car-member-single-no-match () +(ert-deftest test-local-repository-localrepo--car-member-single-no-match () "Boundary: a single-element list whose car differs returns nil." - (should-not (car-member 'x '((only . 1))))) + (should-not (localrepo--car-member 'x '((only . 1))))) -(ert-deftest test-local-repository-car-member-nil-value-with-nil-car () +(ert-deftest test-local-repository-localrepo--car-member-nil-value-with-nil-car () "Boundary: a nil VALUE matches a cons whose car is nil." - (should (car-member nil '((nil . 1) (a . 2))))) + (should (localrepo--car-member nil '((nil . 1) (a . 2))))) -(ert-deftest test-local-repository-car-member-nil-value-no-nil-car () +(ert-deftest test-local-repository-localrepo--car-member-nil-value-no-nil-car () "Boundary: a nil VALUE with no nil car returns nil." - (should-not (car-member nil '((a . 1) (b . 2))))) + (should-not (localrepo--car-member nil '((a . 1) (b . 2))))) ;;; Error Cases -(ert-deftest test-local-repository-car-member-non-cons-element () +(ert-deftest test-local-repository-localrepo--car-member-non-cons-element () "Error: a non-cons element makes `car' signal wrong-type-argument." - (should-error (car-member 'x '(1 2)) :type 'wrong-type-argument)) + (should-error (localrepo--car-member 'x '(1 2)) :type 'wrong-type-argument)) (provide 'test-local-repository--car-member) ;;; test-local-repository--car-member.el ends here diff --git a/tests/test-meta-package-headers.el b/tests/test-meta-package-headers.el new file mode 100644 index 000000000..f9b57cbfc --- /dev/null +++ b/tests/test-meta-package-headers.el @@ -0,0 +1,98 @@ +;;; test-meta-package-headers.el --- Enforce Elisp package-header conventions -*- lexical-binding: t; -*- + +;;; Commentary: +;; Checks that every owned active config module follows the standard Emacs +;; Library Header conventions -- the part test-init-module-headers.el does not +;; cover (it enforces the load-graph metadata block inside the Commentary): +;; +;; 1. First line is ;;; NAME.el --- SUMMARY -*- ... -*- (name carries the +;; .el, summary present, file-local-variable cookie present). +;; 2. ;;; Commentary: appears before ;;; Code:. +;; 3. A (provide 'NAME) footer, so the file is require-able. +;; 4. No UTF-8 BOM before the header. +;; +;; Scope is modules/*.el, the owned active module set. Vendored (custom/), +;; generated (themes/, browser-choice.el), archived (archive/), and private +;; (*.local.el) files are out of scope by design -- classifying those is the +;; file-class policy task, not this test. The checker reads files on disk +;; without loading them, so it adds no startup or package dependency. + +;;; Code: + +(require 'ert) + +(defconst test-pkg-header--exempt '() + "Basenames under modules/ exempt from the package-header checks. +Empty today. Add a basename with a comment when a module is intentionally +shaped differently, so the exemption is explicit rather than silent.") + +(defun test-pkg-header--check (name text) + "Return the list of violation symbols for module NAME given file TEXT. +NAME is the basename (e.g. \"font-config.el\"). An empty list means the +file is conformant. Possible symbols: `bom', `header', `markers', +`order', `provide'." + (let ((violations '())) + (when (string-prefix-p "" text) + (push 'bom violations)) + (let ((first-line (car (split-string text "\n")))) + (unless (string-match-p + (concat "\\`;;; " (regexp-quote name) " --- .+-\\*-.*-\\*-") + first-line) + (push 'header violations))) + (let ((commentary (string-match "^;;; Commentary:" text)) + (code (string-match "^;;; Code:" text))) + (cond ((or (null commentary) (null code)) (push 'markers violations)) + ((>= commentary code) (push 'order violations)))) + (let ((stem (file-name-sans-extension name))) + (unless (string-match-p (concat "^(provide '" (regexp-quote stem) ")") text) + (push 'provide violations))) + (nreverse violations))) + +(ert-deftest test-pkg-header-checker-flags-malformed () + "Error: the checker catches each malformed shape." + (should (memq 'bom + (test-pkg-header--check + "foo.el" + ";;; foo.el --- x -*- lexical-binding: t; -*-\n;;; Commentary:\n;;; Code:\n(provide 'foo)"))) + (should (memq 'header + (test-pkg-header--check + "foo.el" + ";;; foo --- x -*- lexical-binding: t; -*-\n;;; Commentary:\n;;; Code:\n(provide 'foo)"))) + (should (memq 'order + (test-pkg-header--check + "foo.el" + ";;; foo.el --- x -*- lexical-binding: t; -*-\n;;; Code:\n;;; Commentary:\n(provide 'foo)"))) + (should (memq 'provide + (test-pkg-header--check + "foo.el" + ";;; foo.el --- x -*- lexical-binding: t; -*-\n;;; Commentary:\n;;; Code:\n")))) + +(ert-deftest test-pkg-header-checker-passes-conformant () + "Normal: a well-formed module yields no violations." + (should-not (test-pkg-header--check + "foo.el" + ";;; foo.el --- A thing -*- lexical-binding: t; -*-\n;;; Commentary:\n;; doc\n;;; Code:\n(provide 'foo)\n"))) + +(ert-deftest test-pkg-header-checker-boundary-empty () + "Boundary: empty file text reports every applicable violation, no crash." + (let ((v (test-pkg-header--check "foo.el" ""))) + (should (memq 'header v)) + (should (memq 'markers v)) + (should (memq 'provide v)))) + +(ert-deftest test-pkg-header-all-modules-conform () + "Normal: every modules/*.el passes the package-header checks." + (let ((dir (expand-file-name "modules" user-emacs-directory)) + (bad '())) + (dolist (file (directory-files dir t "\\.el\\'")) + (let ((name (file-name-nondirectory file))) + (unless (member name test-pkg-header--exempt) + (let* ((text (with-temp-buffer + (insert-file-contents file) + (buffer-string))) + (violations (test-pkg-header--check name text))) + (when violations (push (cons name violations) bad)))))) + (should-not bad))) + +(provide 'test-meta-package-headers) +;;; test-meta-package-headers.el ends here diff --git a/tests/test-music-config--faces.el b/tests/test-music-config--faces.el new file mode 100644 index 000000000..c45049e1a --- /dev/null +++ b/tests/test-music-config--faces.el @@ -0,0 +1,25 @@ +;;; test-music-config--faces.el --- music playlist face definitions -*- lexical-binding: t; -*- + +;;; Commentary: +;; The playlist header propertizes text with cj/music-* faces. Each must be a +;; defined face (defface) or the reference is invalid -- an undefined face spams +;; "Invalid face reference" on every header render. The faces inherit from +;; themed base faces so the theme still owns their colors. + +;;; Code: + +(require 'ert) +(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) +(require 'music-config) + +(ert-deftest test-music-config-header-faces-are-defined () + "Normal: every cj/music face the playlist header uses is a defined face." + (dolist (f '(cj/music-header-face + cj/music-header-value-face + cj/music-mode-on-face + cj/music-mode-off-face + cj/music-keyhint-face)) + (should (facep f)))) + +(provide 'test-music-config--faces) +;;; test-music-config--faces.el ends here diff --git a/tests/test-nov-reading--palette.el b/tests/test-nov-reading--palette.el new file mode 100644 index 000000000..b34ea2cac --- /dev/null +++ b/tests/test-nov-reading--palette.el @@ -0,0 +1,92 @@ +;;; test-nov-reading--palette.el --- nov reading-palette tests -*- lexical-binding: t; -*- + +;;; Commentary: +;; Pure-logic tests for the nov-mode reading-palette selector: name->face +;; resolution and the cycle order (palettes, then the no-palette state, wrapping). +;; The buffer-local face-remap application is exercised live, not here. + +;;; Code: + +(require 'ert) +(require 'cl-lib) +(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) +(require 'nov-reading) + +(declare-function cj/nov--reading-palette-face "nov-reading" (name)) +(declare-function cj/nov--reading-palette-plist "nov-reading" (name)) +(declare-function cj/nov--next-reading-palette "nov-reading" (current names)) +(defvar cj/nov-reading-palettes) + +;; Each palette entry is a property list: :face supplies bg/fg, :heading and +;; :link recolor shr's heading/link faces. Structural keys are optional. +(defconst test-nov-reading--palettes + '(("sepia" :face cj/nov-reading-sepia + :heading cj/nov-reading-sepia-heading + :link cj/nov-reading-sepia-link) + ("dark" :face cj/nov-reading-dark)) + "Bundle-shaped palette fixture: sepia carries structural faces, dark omits them.") + +;;; ----------------------- cj/nov--reading-palette-face ----------------------- + +(ert-deftest test-nov-reading-palette-face-known () + "Normal: a known palette name resolves to its :face." + (let ((cj/nov-reading-palettes test-nov-reading--palettes)) + (should (eq (cj/nov--reading-palette-face "sepia") 'cj/nov-reading-sepia)) + (should (eq (cj/nov--reading-palette-face "dark") 'cj/nov-reading-dark)))) + +(ert-deftest test-nov-reading-palette-face-unknown () + "Error: an unknown name resolves to nil." + (let ((cj/nov-reading-palettes test-nov-reading--palettes)) + (should-not (cj/nov--reading-palette-face "nope")))) + +(ert-deftest test-nov-reading-palette-face-nil () + "Boundary: a nil name resolves to nil." + (let ((cj/nov-reading-palettes test-nov-reading--palettes)) + (should-not (cj/nov--reading-palette-face nil)))) + +;;; ---------------------- cj/nov--reading-palette-plist ----------------------- + +(ert-deftest test-nov-reading-palette-plist-structural-faces () + "Normal: a palette's :heading and :link faces are retrievable from its plist." + (let ((cj/nov-reading-palettes test-nov-reading--palettes)) + (should (eq (plist-get (cj/nov--reading-palette-plist "sepia") :heading) + 'cj/nov-reading-sepia-heading)) + (should (eq (plist-get (cj/nov--reading-palette-plist "sepia") :link) + 'cj/nov-reading-sepia-link)))) + +(ert-deftest test-nov-reading-palette-plist-omitted-structural () + "Boundary: a palette that omits structural keys yields nil for them." + (let ((cj/nov-reading-palettes test-nov-reading--palettes)) + (should (eq (plist-get (cj/nov--reading-palette-plist "dark") :face) + 'cj/nov-reading-dark)) + (should-not (plist-get (cj/nov--reading-palette-plist "dark") :heading)) + (should-not (plist-get (cj/nov--reading-palette-plist "dark") :link)))) + +(ert-deftest test-nov-reading-palette-plist-unknown () + "Error: an unknown palette name yields a nil plist." + (let ((cj/nov-reading-palettes test-nov-reading--palettes)) + (should-not (cj/nov--reading-palette-plist "nope")))) + +;;; ----------------------- cj/nov--next-reading-palette ----------------------- + +(ert-deftest test-nov-reading-next-palette-advances () + "Normal: cycles to the next palette in order." + (should (equal (cj/nov--next-reading-palette "sepia" '("sepia" "dark" "light")) + "dark"))) + +(ert-deftest test-nov-reading-next-palette-last-to-none () + "Boundary: the last palette cycles to the no-palette state (nil)." + (should-not (cj/nov--next-reading-palette "light" '("sepia" "dark" "light")))) + +(ert-deftest test-nov-reading-next-palette-none-to-first () + "Boundary: the no-palette state (nil) cycles to the first palette." + (should (equal (cj/nov--next-reading-palette nil '("sepia" "dark" "light")) + "sepia"))) + +(ert-deftest test-nov-reading-next-palette-unknown-current-falls-to-first () + "Error: an unknown current palette falls back to the first." + (should (equal (cj/nov--next-reading-palette "gone" '("sepia" "dark" "light")) + "sepia"))) + +(provide 'test-nov-reading--palette) +;;; test-nov-reading--palette.el ends here diff --git a/tests/test-nov-reading--text-scale.el b/tests/test-nov-reading--text-scale.el new file mode 100644 index 000000000..8c2fed8b4 --- /dev/null +++ b/tests/test-nov-reading--text-scale.el @@ -0,0 +1,105 @@ +;;; test-nov-reading--text-scale.el --- nov reading text-scale persistence tests -*- lexical-binding: t; -*- + +;;; Commentary: +;; Tests for the persisted global reading text-scale offset: parsing the stored +;; value (pure) and the save/load round-trip through the data file. The live +;; text-scale application in the +/-/= commands is exercised live, not here. + +;;; Code: + +(require 'ert) +(require 'cl-lib) +(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) +(require 'nov-reading) + +(declare-function cj/nov-reading--parse-text-scale "nov-reading" (s)) +(declare-function cj/nov-reading--load-text-scale "nov-reading" ()) +(declare-function cj/nov-reading--save-text-scale "nov-reading" (amount)) +(defvar cj/nov-reading-text-scale-file) + +;;; --------------------- cj/nov-reading--parse-text-scale ---------------------- + +(ert-deftest test-nov-reading-parse-text-scale-positive () + "Normal: a positive integer string parses to that integer." + (should (= (cj/nov-reading--parse-text-scale "3") 3))) + +(ert-deftest test-nov-reading-parse-text-scale-negative () + "Normal: a negative integer string parses to that integer." + (should (= (cj/nov-reading--parse-text-scale "-2") -2))) + +(ert-deftest test-nov-reading-parse-text-scale-trailing-newline () + "Boundary: surrounding whitespace/newline is tolerated." + (should (= (cj/nov-reading--parse-text-scale "4\n") 4))) + +(ert-deftest test-nov-reading-parse-text-scale-zero () + "Boundary: \"0\" parses to 0." + (should (= (cj/nov-reading--parse-text-scale "0") 0))) + +(ert-deftest test-nov-reading-parse-text-scale-nil () + "Boundary: nil parses to 0." + (should (= (cj/nov-reading--parse-text-scale nil) 0))) + +(ert-deftest test-nov-reading-parse-text-scale-empty () + "Boundary: an empty string parses to 0." + (should (= (cj/nov-reading--parse-text-scale "") 0))) + +(ert-deftest test-nov-reading-parse-text-scale-garbage () + "Error: non-numeric content parses to 0." + (should (= (cj/nov-reading--parse-text-scale "garbage") 0))) + +(ert-deftest test-nov-reading-parse-text-scale-float-rejected () + "Error: a non-integer numeric string parses to 0 (offsets are integers)." + (should (= (cj/nov-reading--parse-text-scale "3.5") 0))) + +;;; ------------------ cj/nov-reading--save/load round-trip --------------------- + +(ert-deftest test-nov-reading-save-load-roundtrip-positive () + "Normal: a saved positive offset loads back unchanged." + (let ((cj/nov-reading-text-scale-file (make-temp-file "nov-scale-"))) + (unwind-protect + (progn + (cj/nov-reading--save-text-scale 4) + (should (= (cj/nov-reading--load-text-scale) 4))) + (delete-file cj/nov-reading-text-scale-file)))) + +(ert-deftest test-nov-reading-save-load-roundtrip-negative () + "Normal: a saved negative offset loads back unchanged." + (let ((cj/nov-reading-text-scale-file (make-temp-file "nov-scale-"))) + (unwind-protect + (progn + (cj/nov-reading--save-text-scale -3) + (should (= (cj/nov-reading--load-text-scale) -3))) + (delete-file cj/nov-reading-text-scale-file)))) + +(ert-deftest test-nov-reading-save-load-roundtrip-zero () + "Boundary: a saved 0 offset loads back as 0." + (let ((cj/nov-reading-text-scale-file (make-temp-file "nov-scale-"))) + (unwind-protect + (progn + (cj/nov-reading--save-text-scale 0) + (should (= (cj/nov-reading--load-text-scale) 0))) + (delete-file cj/nov-reading-text-scale-file)))) + +(ert-deftest test-nov-reading-load-missing-file-defaults-zero () + "Boundary: loading when no file exists yet returns 0." + (let ((cj/nov-reading-text-scale-file + (expand-file-name "nov-scale-absent" + (make-temp-file "nov-scale-dir-" t)))) + (unwind-protect + (should (= (cj/nov-reading--load-text-scale) 0)) + (delete-directory (file-name-directory cj/nov-reading-text-scale-file) t)))) + +(ert-deftest test-nov-reading-save-creates-missing-directory () + "Boundary: save creates the data directory when it is absent." + (let* ((dir (make-temp-file "nov-scale-dir-" t)) + (cj/nov-reading-text-scale-file + (expand-file-name "sub/nov-reading-text-scale" dir))) + (unwind-protect + (progn + (cj/nov-reading--save-text-scale 2) + (should (file-readable-p cj/nov-reading-text-scale-file)) + (should (= (cj/nov-reading--load-text-scale) 2))) + (delete-directory dir t)))) + +(provide 'test-nov-reading--text-scale) +;;; test-nov-reading--text-scale.el ends here diff --git a/tests/test-org-capture-config-popup-window.el b/tests/test-org-capture-config-popup-window.el index 671d55ab9..af96ba012 100644 --- a/tests/test-org-capture-config-popup-window.el +++ b/tests/test-org-capture-config-popup-window.el @@ -110,11 +110,11 @@ deletes the popup frame instead of leaving it orphaned. Components integrated: - cj/quick-capture (real) - org-capture (MOCKED — signals user-error \"Abort\") -- cj/org-capture--delete-popup-frame (MOCKED — records the call)" +- cj/org-capture-reap-popup-frames (MOCKED — records the call)" (let ((deleted 0)) (cl-letf (((symbol-function 'org-capture) (lambda (&rest _) (user-error "Abort"))) - ((symbol-function 'cj/org-capture--delete-popup-frame) + ((symbol-function 'cj/org-capture-reap-popup-frames) (lambda () (cl-incf deleted)))) (cj/quick-capture)) (should (= deleted 1)))) @@ -124,7 +124,7 @@ Components integrated: (let ((deleted 0)) (cl-letf (((symbol-function 'org-capture) (lambda (&rest _) (signal 'quit nil))) - ((symbol-function 'cj/org-capture--delete-popup-frame) + ((symbol-function 'cj/org-capture-reap-popup-frames) (lambda () (cl-incf deleted)))) (cj/quick-capture)) (should (= deleted 1)))) @@ -134,19 +134,32 @@ Components integrated: the finalize hook owns that." (let ((deleted 0)) (cl-letf (((symbol-function 'org-capture) (lambda (&rest _) nil)) - ((symbol-function 'cj/org-capture--delete-popup-frame) + ((symbol-function 'cj/org-capture-reap-popup-frames) (lambda () (cl-incf deleted)))) (cj/quick-capture)) (should (= deleted 0)))) -;;; cj/org-capture--popup-frame-p +;;; cj/org-capture--frame-reapable-p -(ert-deftest test-org-capture-config-popup-frame-p () - "Normal/Boundary: true only when the selected frame is named \"org-capture\"." - (cl-letf (((symbol-function 'frame-parameter) (lambda (&rest _) "org-capture"))) - (should (cj/org-capture--popup-frame-p))) - (cl-letf (((symbol-function 'frame-parameter) (lambda (&rest _) "emacs"))) - (should-not (cj/org-capture--popup-frame-p)))) +(ert-deftest test-org-capture-config-frame-reapable-p-no-capture-ui () + "Normal: an \"org-capture\" frame showing only non-capture buffers is reapable." + (should (cj/org-capture--frame-reapable-p + "org-capture" '("agent [.emacs.d]" "*dashboard*")))) + +(ert-deftest test-org-capture-config-frame-reapable-p-capture-buffer-spares () + "Boundary: a CAPTURE-* buffer means the popup is mid-capture — not reapable." + (should-not (cj/org-capture--frame-reapable-p + "org-capture" '("CAPTURE-todo.org" "*dashboard*")))) + +(ert-deftest test-org-capture-config-frame-reapable-p-select-menu-spares () + "Boundary: the *Org Select* template menu means mid-capture — not reapable." + (should-not (cj/org-capture--frame-reapable-p + "org-capture" '("*Org Select*")))) + +(ert-deftest test-org-capture-config-frame-reapable-p-other-frame-never () + "Error: a frame not named \"org-capture\" is never reapable, even when empty." + (should-not (cj/org-capture--frame-reapable-p + "Emacs 30.2 : agent [.emacs.d]" '("agent [.emacs.d]")))) ;;; cj/org-capture--popup-frame (find the popup frame by name) diff --git a/tests/test-system-commands-keymap.el b/tests/test-system-commands-keymap.el index ac78a25d5..82be1d8de 100644 --- a/tests/test-system-commands-keymap.el +++ b/tests/test-system-commands-keymap.el @@ -2,8 +2,9 @@ ;;; Commentary: -;; The system command keymap should remain mounted as a prefix under C-; ! so -;; which-key can show the documented subcommands. +;; C-; ! is bound directly to the completing-read menu. The per-command leaf +;; keys (s/r/e/l/L/E/S) were removed to reclaim the key real-estate; every +;; command stays reachable through the menu (see the menu-dispatch test). ;;; Code: @@ -14,23 +15,21 @@ (require 'system-commands) -(ert-deftest test-system-commands-keymap-normal-prefix-mounted () - "Normal: C-; ! remains a prefix keymap, not a direct command." - (should (eq (keymap-lookup cj/custom-keymap "!") - cj/system-command-map))) - -(ert-deftest test-system-commands-keymap-normal-documented-subkeys () - "Normal: documented system command subkeys resolve under the prefix." - (dolist (binding '(("!" . cj/system-command-menu) - ("L" . cj/system-cmd-logout) - ("r" . cj/system-cmd-reboot) - ("s" . cj/system-cmd-shutdown) - ("S" . cj/system-cmd-suspend) - ("l" . cj/system-cmd-lock) - ("E" . cj/system-cmd-exit-emacs) - ("e" . cj/system-cmd-restart-emacs))) - (should (eq (keymap-lookup cj/system-command-map (car binding)) - (cdr binding))))) +(ert-deftest test-system-commands-keymap-normal-menu-bound-directly () + "Normal: C-; ! is the completing-read menu command, not a prefix keymap." + (let ((binding (keymap-lookup cj/custom-keymap "!"))) + (should (eq binding 'cj/system-command-menu)) + (should (commandp binding)))) + +(ert-deftest test-system-commands-keymap-normal-leaf-subkeys-removed () + "Normal: no subkeys hang off C-; !, and the commands remain defined." + ;; "!" is now a command, not a prefix, so there is no submap to walk into. + (should-not (keymapp (keymap-lookup cj/custom-keymap "!"))) + ;; The commands themselves stay defined and reachable via the menu. + (dolist (cmd '(cj/system-cmd-logout cj/system-cmd-reboot cj/system-cmd-shutdown + cj/system-cmd-suspend cj/system-cmd-lock cj/system-cmd-exit-emacs + cj/system-cmd-restart-emacs)) + (should (fboundp cmd)))) (provide 'test-system-commands-keymap) ;;; test-system-commands-keymap.el ends here diff --git a/tests/test-system-commands-resolve-and-run.el b/tests/test-system-commands-resolve-and-run.el index af2288fd9..9d92c5d68 100644 --- a/tests/test-system-commands-resolve-and-run.el +++ b/tests/test-system-commands-resolve-and-run.el @@ -172,9 +172,15 @@ does not run the command." (ert-deftest test-system-cmd-restart-emacs-no-service-aborts () "Error: when no emacs.service exists, restart aborts without running anything." (let ((ran nil)) + ;; Drive the real service check to nil at its boundary (no systemctl on + ;; PATH) rather than mocking cj/system-cmd--emacs-service-available-p + ;; itself: cj/system-cmd-restart-emacs reaches that helper through a + ;; native-comp intra-file direct call that bypasses a symbol-function + ;; redefinition, so the helper-level mock silently no-ops and the real + ;; check passes on a machine that has emacs.service. executable-find is a + ;; subr the helper calls, and its trampoline honors the cl-letf swap. (cl-letf (((symbol-function 'daemonp) (lambda () t)) - ((symbol-function 'cj/system-cmd--emacs-service-available-p) - (lambda () nil)) + ((symbol-function 'executable-find) (lambda (&rest _) nil)) ((symbol-function 'read-char-choice) (lambda (&rest _) ?y)) ((symbol-function 'call-process-shell-command) (lambda (&rest _) (setq ran t)))) diff --git a/tests/test-system-defaults-functions.el b/tests/test-system-defaults-functions.el index 2562ff6aa..c603fc7eb 100644 --- a/tests/test-system-defaults-functions.el +++ b/tests/test-system-defaults-functions.el @@ -9,7 +9,7 @@ ;; cj/minibuffer-setup-hook -- inflate gc-cons-threshold while ;; typing in the minibuffer ;; cj/minibuffer-exit-hook -- restore gc-cons-threshold on exit -;; unpropertize-kill-ring -- strip text properties from +;; cj/--unpropertize-kill-ring -- strip text properties from ;; kill-ring at shutdown ;; cj/log-comp-warning -- route native-comp warnings to a ;; file rather than the *Warnings* @@ -79,13 +79,13 @@ (should (eq (cj/disabled) nil)) (should (commandp #'cj/disabled))) -;;; unpropertize-kill-ring +;;; cj/--unpropertize-kill-ring (ert-deftest test-system-defaults-unpropertize-kill-ring-strips-properties () "Normal: every kill-ring entry comes back with no text properties." (let ((kill-ring (list (propertize "alpha" 'face 'bold) (propertize "beta" 'face 'underline)))) - (unpropertize-kill-ring) + (cj/--unpropertize-kill-ring) (should (equal kill-ring '("alpha" "beta"))) (should-not (text-properties-at 0 (nth 0 kill-ring))) (should-not (text-properties-at 0 (nth 1 kill-ring))))) @@ -93,7 +93,7 @@ (ert-deftest test-system-defaults-unpropertize-kill-ring-boundary-empty-ring () "Boundary: an empty `kill-ring' stays empty after the strip pass." (let ((kill-ring nil)) - (unpropertize-kill-ring) + (cj/--unpropertize-kill-ring) (should (null kill-ring)))) ;;; cj/log-comp-warning diff --git a/tests/test-system-defaults.el b/tests/test-system-defaults.el index f653e1fbb..a641adea1 100644 --- a/tests/test-system-defaults.el +++ b/tests/test-system-defaults.el @@ -8,7 +8,7 @@ ;; writes land, where backups go, and whether the minibuffer GC hooks are ;; installed. Load happens in the shared sandbox (testutil-system-defaults.el). ;; -;; The module's functions (cj/disabled, the GC hook bodies, unpropertize-kill-ring, +;; The module's functions (cj/disabled, the GC hook bodies, cj/--unpropertize-kill-ring, ;; cj/log-comp-warning) are covered by test-system-defaults-functions.el, and the ;; vc-follow-symlinks default by test-system-defaults-vc-follow-symlinks.el. diff --git a/tests/test-system-lib--completion-file-annotator.el b/tests/test-system-lib--completion-file-annotator.el new file mode 100644 index 000000000..9e1f4aa4a --- /dev/null +++ b/tests/test-system-lib--completion-file-annotator.el @@ -0,0 +1,54 @@ +;;; test-system-lib--completion-file-annotator.el --- Tests for cj/completion-file-annotator -*- lexical-binding: t; -*- + +;;; Commentary: +;; Unit tests for `cj/completion-file-annotator', the annotation-function +;; factory used to annotate file-basename completion pickers with size and +;; modification date. + +;;; Code: + +(require 'ert) +(require 'system-lib) + +(ert-deftest test-system-lib-completion-file-annotator-normal-file-shows-size-and-date () + "Normal: a regular file is annotated with a size and an ISO date." + (let ((file (make-temp-file "cfa-test-" nil ".txt" "hello world"))) + (unwind-protect + (let* ((annotate (cj/completion-file-annotator + (lambda (_cand) file))) + (result (funcall annotate "anything"))) + (should (stringp result)) + ;; file-size-human-readable of 11 bytes is "11" + (should (string-match-p "11" result)) + ;; ISO date for the file's mtime + (should (string-match-p + (format-time-string "%Y-%m-%d" + (file-attribute-modification-time + (file-attributes file))) + result))) + (delete-file file)))) + +(ert-deftest test-system-lib-completion-file-annotator-boundary-directory-marked-dir () + "Boundary: a directory candidate is annotated with the `dir' marker." + (let ((dir (make-temp-file "cfa-dir-" t))) + (unwind-protect + (let* ((annotate (cj/completion-file-annotator (lambda (_c) dir))) + (result (funcall annotate "d"))) + (should (stringp result)) + (should (string-match-p "dir" result))) + (delete-directory dir t)))) + +(ert-deftest test-system-lib-completion-file-annotator-error-nil-path-returns-nil () + "Error: a candidate whose path-resolver returns nil yields no annotation." + (let ((annotate (cj/completion-file-annotator (lambda (_c) nil)))) + (should (null (funcall annotate "missing"))))) + +(ert-deftest test-system-lib-completion-file-annotator-error-missing-file-returns-nil () + "Error: a path that does not exist yields no annotation." + (let* ((path (expand-file-name "definitely-not-here-12345.txt" + temporary-file-directory)) + (annotate (cj/completion-file-annotator (lambda (_c) path)))) + (should (null (funcall annotate "gone"))))) + +(provide 'test-system-lib--completion-file-annotator) +;;; test-system-lib--completion-file-annotator.el ends here diff --git a/tests/test-system-utils-commands.el b/tests/test-system-utils-commands.el index b7b61dc22..6f2099a24 100644 --- a/tests/test-system-utils-commands.el +++ b/tests/test-system-utils-commands.el @@ -90,5 +90,14 @@ and lands in a dedicated output buffer." (should saved) (should killed))) +;;; ibuffer delete/diff keybinding swap + +(ert-deftest test-system-utils-ibuffer-d-diffs-D-deletes () + "Normal: in the ibuffer list, d diffs the buffer at point against its file and +D marks it for deletion (the swap of ibuffer's default d/= bindings)." + (require 'ibuffer) + (should (eq (keymap-lookup ibuffer-mode-map "d") #'ibuffer-diff-with-file)) + (should (eq (keymap-lookup ibuffer-mode-map "D") #'ibuffer-mark-for-delete))) + (provide 'test-system-utils-commands) ;;; test-system-utils-commands.el ends here diff --git a/tests/test-term-config--f8-in-term.el b/tests/test-term-config--f8-in-term.el deleted file mode 100644 index 6cee4ff46..000000000 --- a/tests/test-term-config--f8-in-term.el +++ /dev/null @@ -1,42 +0,0 @@ -;;; test-term-config--f8-in-term.el --- F8 reaches Emacs from inside a ghostel buffer -*- lexical-binding: t; -*- - -;;; Commentary: -;; <f8> is a global binding (`cj/main-agenda-display', set in org-agenda-config). -;; ghostel's semi-char mode forwards every key NOT in `ghostel-keymap-exceptions' -;; to the terminal program, so a plain <f8> typed while point is in a ghostel -;; buffer would be sent to the program instead of opening the agenda. Unlike the -;; F9 family, F8 is NOT re-bound in `ghostel-mode-map' -- it simply falls through -;; to the global map once the semi-char map stops forwarding it, so the only -;; wiring term-config.el adds is the keymap-exceptions entry plus the rebuild. -;; These tests require ghostel (so term-config's `with-eval-after-load' fires) -;; BEFORE term-config, then confirm the exception landed and the rebuilt -;; semi-char map no longer forwards <f8>. `(require 'ghostel)' does not load the -;; native module, so this stays light. - -;;; Code: - -(require 'ert) -(require 'package) - -(setq package-user-dir (expand-file-name "elpa" user-emacs-directory)) -(package-initialize) -(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) -(require 'ghostel) -(require 'term-config) - -(ert-deftest test-term-config-f8-in-keymap-exceptions () - "Regression: <f8> is in `ghostel-keymap-exceptions' so semi-char mode lets it -reach Emacs instead of forwarding it to the terminal program. This is what lets -the global agenda binding work from inside a ghostel buffer." - (should (member "<f8>" ghostel-keymap-exceptions))) - -(ert-deftest test-term-config-f8-not-forwarded-by-semi-char-map () - "Regression: the rebuilt semi-char map must no longer forward <f8> to the pty. -`add-to-list' updates the exceptions list but not the already-built map -- only -`ghostel--rebuild-semi-char-keymap' (run in term-config's :init) drops the -forwarding binding so <f8> falls through to the global agenda command." - (should-not (eq (keymap-lookup ghostel-semi-char-mode-map "<f8>") - 'ghostel--send-event))) - -(provide 'test-term-config--f8-in-term) -;;; test-term-config--f8-in-term.el ends here diff --git a/tests/test-term-tmux-history.el b/tests/test-term-tmux-history.el index 0ea7cf37d..a5f5c93cd 100644 --- a/tests/test-term-tmux-history.el +++ b/tests/test-term-tmux-history.el @@ -1,14 +1,13 @@ -;;; test-term-tmux-history.el --- Tests for term-config tmux history + menu UX -*- lexical-binding: t; -*- +;;; test-term-tmux-history.el --- Tests for the EAT terminal copy-mode + tmux history -*- lexical-binding: t; -*- ;;; Commentary: -;; Exercises the term-config (ghostel) terminal UX: the Emacs-owned tmux -;; history buffer, the copy-mode-dwim engine pick, the tmux pane-id / -;; attached-client predicates, and the C-; x menu bindings. +;; Exercises the terminal UX carried into eat-config for the EAT agent +;; terminals: the Emacs-owned tmux history buffer, the copy-mode-dwim engine +;; pick, the tmux pane-id / attached-client predicates, and the C-; x menu +;; bindings. Agents run EAT over tmux, so copy-mode is tmux's own copy-mode. ;; -;; ghostel is required (which defines `ghostel-mode-map' / -;; `ghostel-keymap-exceptions' and lets term-config's `with-eval-after-load' -;; fire) before term-config. `(require 'ghostel)' does not load the native -;; module; tmux is mocked via `process-file', so nothing spawns. +;; eat is required (so eat-config's `with-eval-after-load' fires for the C-<up> +;; bind) before eat-config; tmux is mocked via `process-file', so nothing spawns. ;;; Code: @@ -21,9 +20,9 @@ (add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) (add-to-list 'load-path (expand-file-name "tests" user-emacs-directory)) (setq load-prefer-newer t) -(require 'ghostel) -(require 'term-config) -(require 'testutil-ghostel-buffers) +(require 'eat) +(require 'eat-config) +(require 'testutil-terminal-buffers) (defmacro test-term-tmux-history--with-tmux-mock (responses &rest body) "Run BODY with `process-file' mocked for tmux RESPONSES. @@ -51,6 +50,8 @@ RESPONSES is an alist of (ARGS EXIT-CODE OUTPUT)." exit-code)))) ,@body))) +;;; tmux helpers + (ert-deftest test-term-tmux-history--pane-id-for-tty-matches-client () "Normal: current terminal pty maps to the active pane for that tmux client." (test-term-tmux-history--with-tmux-mock @@ -66,9 +67,32 @@ RESPONSES is an alist of (ARGS EXIT-CODE OUTPUT)." (should (equal (cj/term--tmux-capture-pane "%8") "first line\nsecond line\n")))) +(ert-deftest test-term-current-tmux-pane-id-rejects-non-eat-buffer () + "Error: pane-id lookup refuses a buffer that is not in `eat-mode'." + (with-temp-buffer + (should-error (cj/term--current-tmux-pane-id) :type 'user-error))) + +(ert-deftest test-term-current-tmux-pane-id-accepts-agent-named-buffer () + "Normal: an agent-named eat buffer resolves by process TTY, not buffer name." + (let ((agent (cj/test--make-fake-eat-buffer "agent [emacs.d]"))) + (unwind-protect + (with-current-buffer agent + (cl-letf (((symbol-function 'get-buffer-process) + (lambda (_buffer) 'fake-process)) + ((symbol-function 'process-tty-name) + (lambda (_process &rest _) "/dev/pts/8"))) + (test-term-tmux-history--with-tmux-mock + '((("list-clients" "-F" "#{client_tty}\t#{pane_id}") 0 + "/dev/pts/1\t%1\n/dev/pts/8\t%8\n")) + (should (equal (cj/term--current-tmux-pane-id) "%8"))))) + (when (buffer-live-p agent) + (kill-buffer agent))))) + +;;; tmux history buffer + (ert-deftest test-term-tmux-history-open-renders-read-only-history-buffer () - "Normal: command renders tmux history in a normal Emacs buffer." - (let ((origin (cj/test--make-fake-ghostel-buffer "*test-term-history-origin*"))) + "Normal: the command renders tmux history in a normal Emacs buffer." + (let ((origin (cj/test--make-fake-eat-buffer "*test-term-history-origin*"))) (unwind-protect (save-window-excursion (switch-to-buffer origin) @@ -90,41 +114,8 @@ RESPONSES is an alist of (ARGS EXIT-CODE OUTPUT)." (when (buffer-live-p origin) (kill-buffer origin))))) -(ert-deftest test-term-tmux-history-replaces-origin-buffer-in-same-window () - "Normal: the history view replaces the origin in the selected window. - -`cj/term-tmux-history' uses `switch-to-buffer' so reading scrollback keeps -the terminal's frame slot rather than splitting or popping a new window." - (let ((origin (cj/test--make-fake-ghostel-buffer "*test-term-history-inplace*"))) - (unwind-protect - (save-window-excursion - (delete-other-windows) - (switch-to-buffer origin) - (let ((win (selected-window))) - (should (eq (window-buffer win) origin)) - (should (one-window-p)) - (cl-letf (((symbol-function 'get-buffer-process) - (lambda (_buffer) 'fake-process)) - ((symbol-function 'process-tty-name) - (lambda (_process &rest _) "/dev/pts/8"))) - (test-term-tmux-history--with-tmux-mock - '((("list-clients" "-F" "#{client_tty}\t#{pane_id}") 0 - "/dev/pts/8\t%8\n") - (("capture-pane" "-p" "-J" "-S" "-" "-E" "-" "-t" "%8") 0 - "scrollback line\n")) - (cj/term-tmux-history))) - (should (one-window-p)) - (should (eq (selected-window) win)) - (should (string-prefix-p - "*terminal tmux history:" - (buffer-name (window-buffer win)))))) - (cj/test--kill-buffers-matching-prefix "*terminal tmux history") - (when (buffer-live-p origin) - (kill-buffer origin))))) - (ert-deftest test-term-tmux-history-quit-returns-to-origin () - "Normal: q / <escape> / C-g (cj/term-tmux-history-quit) kills the history -buffer and restores the origin buffer, window, and point." + "Normal: quit kills the history buffer and restores origin buffer/window/point." (let ((origin (get-buffer-create "*test-term-history-return*"))) (unwind-protect (let ((history (get-buffer-create "*terminal tmux history: test*"))) @@ -149,10 +140,8 @@ buffer and restores the origin buffer, window, and point." (kill-buffer origin))))) (ert-deftest test-term-tmux-history-mode-keymap () - "Normal: in the history buffer M-w copies without quitting; q, <escape>, -and C-g quit back to the terminal; RET is left unbound (no special exit)." - (should (eq (keymap-lookup cj/term-tmux-history-mode-map "M-w") - #'kill-ring-save)) + "Normal: M-w copies; q/<escape>/C-g quit; RET is left unbound." + (should (eq (keymap-lookup cj/term-tmux-history-mode-map "M-w") #'kill-ring-save)) (should (eq (keymap-lookup cj/term-tmux-history-mode-map "q") #'cj/term-tmux-history-quit)) (should (eq (keymap-lookup cj/term-tmux-history-mode-map "<escape>") @@ -161,50 +150,11 @@ and C-g quit back to the terminal; RET is left unbound (no special exit)." #'cj/term-tmux-history-quit)) (should-not (keymap-lookup cj/term-tmux-history-mode-map "RET"))) -(ert-deftest test-term-keymap-includes-history-and-copy-bindings () - "Normal: the personal terminal map owns the high-level UX commands, and C-; -reaches Emacs inside ghostel buffers so the prefix works there." - (should (member "C-;" ghostel-keymap-exceptions)) - (should (eq (keymap-lookup cj/custom-keymap "x h") #'cj/term-tmux-history)) - (should (eq (keymap-lookup cj/custom-keymap "x c") #'cj/term-copy-mode-dwim)) - (should (equal (keymap-lookup ghostel-mode-map "C-;") cj/custom-keymap)) - (should (eq (keymap-lookup ghostel-mode-map "C-; x h") #'cj/term-tmux-history)) - (should (eq (keymap-lookup ghostel-mode-map "C-; x c") #'cj/term-copy-mode-dwim))) - -(ert-deftest test-term-keymap-prompt-navigation () - "Normal: n/p navigate prompts, capital N creates a new terminal buffer." - (should (eq (keymap-lookup cj/custom-keymap "x n") #'ghostel-next-prompt)) - (should (eq (keymap-lookup cj/custom-keymap "x p") #'ghostel-previous-prompt)) - (should (eq (keymap-lookup cj/custom-keymap "x N") #'ghostel))) - -(ert-deftest test-term-current-tmux-pane-id-rejects-non-ghostel-buffer () - "Error: pane-id lookup refuses a buffer that is not in `ghostel-mode'." - (with-temp-buffer - (should-error (cj/term--current-tmux-pane-id) :type 'user-error))) - -(ert-deftest test-term-current-tmux-pane-id-accepts-agent-named-buffer () - "Normal: an agent-named ghostel buffer resolves by process TTY. - -The pane lookup keys off the live process TTY, never the buffer name, so a -buffer named `agent [repo]' (ai-term.el's naming) resolves like any other -ghostel-mode terminal." - (let ((agent (cj/test--make-fake-ghostel-buffer "agent [emacs.d]"))) - (unwind-protect - (with-current-buffer agent - (cl-letf (((symbol-function 'get-buffer-process) - (lambda (_buffer) 'fake-process)) - ((symbol-function 'process-tty-name) - (lambda (_process &rest _) "/dev/pts/8"))) - (test-term-tmux-history--with-tmux-mock - '((("list-clients" "-F" "#{client_tty}\t#{pane_id}") 0 - "/dev/pts/1\t%1\n/dev/pts/8\t%8\n")) - (should (equal (cj/term--current-tmux-pane-id) "%8"))))) - (when (buffer-live-p agent) - (kill-buffer agent))))) +;;; in-tmux-p predicate (ert-deftest test-term-in-tmux-p-true-when-client-attached () "Normal: predicate returns t when tmux reports a client for our tty." - (let ((agent (cj/test--make-fake-ghostel-buffer "agent [emacs.d]"))) + (let ((agent (cj/test--make-fake-eat-buffer "agent [emacs.d]"))) (unwind-protect (with-current-buffer agent (cl-letf (((symbol-function 'get-buffer-process) @@ -218,25 +168,18 @@ ghostel-mode terminal." (when (buffer-live-p agent) (kill-buffer agent))))) -(ert-deftest test-term-in-tmux-p-nil-when-no-matching-client () - "Boundary: predicate returns nil when tmux runs but our tty has no client." - (let ((agent (cj/test--make-fake-ghostel-buffer "agent [emacs.d]"))) - (unwind-protect - (with-current-buffer agent - (cl-letf (((symbol-function 'get-buffer-process) - (lambda (_buffer) 'fake-process)) - ((symbol-function 'process-tty-name) - (lambda (_process &rest _) "/dev/pts/8"))) - (test-term-tmux-history--with-tmux-mock - '((("list-clients" "-F" "#{client_tty}\t#{pane_id}") 0 - "/dev/pts/1\t%1\n")) - (should-not (cj/term--in-tmux-p))))) - (when (buffer-live-p agent) - (kill-buffer agent))))) +(ert-deftest test-term-in-tmux-p-nil-when-not-eat-mode () + "Boundary: predicate refuses non-eat buffers without calling tmux." + (with-temp-buffer + (let ((tmux-called nil)) + (cl-letf (((symbol-function 'process-file) + (lambda (&rest _) (setq tmux-called t) 0))) + (should-not (cj/term--in-tmux-p)) + (should-not tmux-called))))) (ert-deftest test-term-in-tmux-p-nil-when-tmux-fails () "Error: predicate swallows tmux failures and returns nil." - (let ((agent (cj/test--make-fake-ghostel-buffer "agent [emacs.d]"))) + (let ((agent (cj/test--make-fake-eat-buffer "agent [emacs.d]"))) (unwind-protect (with-current-buffer agent (cl-letf (((symbol-function 'get-buffer-process) @@ -250,117 +193,33 @@ ghostel-mode terminal." (when (buffer-live-p agent) (kill-buffer agent))))) -(ert-deftest test-term-in-tmux-p-nil-when-not-ghostel-mode () - "Boundary: predicate refuses non-ghostel buffers without calling tmux." - (with-temp-buffer - (let ((tmux-called nil)) - (cl-letf (((symbol-function 'process-file) - (lambda (&rest _) (setq tmux-called t) 0))) - (should-not (cj/term--in-tmux-p)) - (should-not tmux-called))))) +;;; copy-mode (tmux path -- the agent terminal case) (ert-deftest test-term-copy-mode-dwim-sends-tmux-prefix-when-attached () - "Normal: with tmux attached, dwim writes C-b [ then C-a into the pty so -tmux enters its own copy-mode and lands the cursor at the start of the -line. Without the trailing C-a the cursor inherits the live column (far -right after a prompt) and scrolling up runs up the right edge; start-of-line -puts it at column 0 so it runs up the left." - (let ((agent (cj/test--make-fake-ghostel-buffer "agent [emacs.d]")) - (sent nil) - (copy-mode-called nil)) + "Normal: with tmux attached, dwim writes C-b [ then C-a into the pty so tmux +enters copy-mode with the cursor at column 0." + (let ((agent (cj/test--make-fake-eat-buffer "agent [emacs.d]")) + (sent nil)) (unwind-protect (with-current-buffer agent (cl-letf (((symbol-function 'get-buffer-process) (lambda (_buffer) 'fake-process)) ((symbol-function 'process-tty-name) (lambda (_process &rest _) "/dev/pts/8")) - ((symbol-function 'ghostel-send-string) - (lambda (s) (push s sent))) - ((symbol-function 'ghostel-copy-mode) - (lambda () (setq copy-mode-called t)))) + ((symbol-function 'cj/--term-send-string) + (lambda (s) (push s sent)))) (test-term-tmux-history--with-tmux-mock '((("list-clients" "-F" "#{client_tty}\t#{pane_id}") 0 "/dev/pts/8\t%8\n")) (cj/term-copy-mode-dwim) - (should (equal sent '("\C-b[\C-a"))) - (should-not copy-mode-called)))) - (when (buffer-live-p agent) - (kill-buffer agent))))) - -(ert-deftest test-term-copy-mode-dwim-falls-back-without-tmux () - "Boundary: without tmux, dwim calls `ghostel-copy-mode' then moves point -to the start of the line and sends nothing to the pty. The -`beginning-of-line' must run after `ghostel-copy-mode' so it repositions -inside the copy view; column 0 keeps the cursor on the left edge while -scrolling, parity with the tmux branch's trailing C-a." - (let ((agent (cj/test--make-fake-ghostel-buffer "agent [emacs.d]")) - (sent nil) - (dwim-order nil)) - (unwind-protect - (with-current-buffer agent - (cl-letf (((symbol-function 'get-buffer-process) - (lambda (_buffer) 'fake-process)) - ((symbol-function 'process-tty-name) - (lambda (_process &rest _) "/dev/pts/8")) - ((symbol-function 'ghostel-send-string) - (lambda (s) (push s sent))) - ((symbol-function 'ghostel-copy-mode) - (lambda () (push 'copy-mode dwim-order))) - ((symbol-function 'beginning-of-line) - (lambda (&optional _n) (push 'beginning-of-line dwim-order)))) - (test-term-tmux-history--with-tmux-mock - '((("list-clients" "-F" "#{client_tty}\t#{pane_id}") 1 - "no server running")) - (cj/term-copy-mode-dwim) - (should-not sent) - (should (equal (reverse dwim-order) '(copy-mode beginning-of-line)))))) + (should (equal sent '("\C-b[\C-a")))))) (when (buffer-live-p agent) (kill-buffer agent))))) -(ert-deftest test-term-prefix-and-f12-in-keymap-exceptions () - "Regression: C-; and F12 are in `ghostel-keymap-exceptions' and the rebuilt -semi-char map no longer forwards them to the pty, so the prefix keymap and the -F12 toggle reach Emacs inside ghostel buffers." - (dolist (key '("C-;" "<f12>")) - (should (member key ghostel-keymap-exceptions))) - (should-not (eq (keymap-lookup ghostel-semi-char-mode-map "<f12>") - 'ghostel--send-event))) - -(ert-deftest test-term-window-nav-keys-in-keymap-exceptions () - "Regression: windmove (S-arrows) and buffer-move (C-M-arrows) are in -`ghostel-keymap-exceptions' so they reach Emacs from inside a ghostel buffer -instead of being forwarded to the terminal program." - (dolist (key '("S-<up>" "S-<down>" "S-<left>" "S-<right>" - "C-M-<up>" "C-M-<down>" "C-M-<left>" "C-M-<right>")) - (should (member key ghostel-keymap-exceptions))) - (should-not (eq (keymap-lookup ghostel-semi-char-mode-map "C-M-<left>") - 'ghostel--send-event))) - -(ert-deftest test-term-f10-music-in-keymap-exceptions () - "Regression: F10 (music playlist toggle) is in `ghostel-keymap-exceptions' -so it reaches Emacs from inside a ghostel buffer instead of being forwarded -to the terminal program. It is a global binding, so dropping it from the -semi-char map lets the lookup fall through to the global map. Server -shutdown moved off C-F10 to C-x C, which is deliberately NOT an exception -(C-x C stays forwarding to the terminal program inside an agent buffer)." - (should (member "<f10>" ghostel-keymap-exceptions)) - (should-not (member "C-<f10>" ghostel-keymap-exceptions)) - (should-not (eq (keymap-lookup ghostel-semi-char-mode-map "<f10>") - 'ghostel--send-event))) - -(ert-deftest test-term-c-spc-forwarded-not-set-mark () - "Regression: C-SPC is forwarded to the terminal, not bound to the global -`set-mark-command'. ghostel only forwards the `C-@' event, so without this an -Emacs region gets stuck in the ghostel buffer and tmux copy-mode's -begin-selection never starts." - (should (eq (keymap-lookup ghostel-mode-map "C-SPC") #'cj/term-send-C-SPC))) - -;; ----------------------------- copy-mode scroll ------------------------------ - (ert-deftest test-term-copy-mode-up-tmux-enters-then-scrolls-up () "Normal: from a live (non-copy) tmux pane, C-<up> enters copy-mode then sends the up-arrow, so one stroke both enters copy-mode and scrolls up." - (let ((agent (cj/test--make-fake-ghostel-buffer "agent [emacs.d]")) + (let ((agent (cj/test--make-fake-eat-buffer "agent [emacs.d]")) (sent nil)) (unwind-protect (with-current-buffer agent @@ -368,7 +227,7 @@ the up-arrow, so one stroke both enters copy-mode and scrolls up." (lambda (_buffer) 'fake-process)) ((symbol-function 'process-tty-name) (lambda (_process &rest _) "/dev/pts/8")) - ((symbol-function 'ghostel-send-string) + ((symbol-function 'cj/--term-send-string) (lambda (s) (push s sent)))) (test-term-tmux-history--with-tmux-mock '((("list-clients" "-F" "#{client_tty}\t#{pane_id}") 0 @@ -381,8 +240,8 @@ the up-arrow, so one stroke both enters copy-mode and scrolls up." (ert-deftest test-term-copy-mode-up-tmux-already-in-mode-just-scrolls () "Normal: when the tmux pane is already in copy-mode, C-<up> only sends the -up-arrow -- it does not re-enter (which would reset the cursor)." - (let ((agent (cj/test--make-fake-ghostel-buffer "agent [emacs.d]")) +up-arrow -- it does not re-enter and reset the cursor." + (let ((agent (cj/test--make-fake-eat-buffer "agent [emacs.d]")) (sent nil)) (unwind-protect (with-current-buffer agent @@ -390,7 +249,7 @@ up-arrow -- it does not re-enter (which would reset the cursor)." (lambda (_buffer) 'fake-process)) ((symbol-function 'process-tty-name) (lambda (_process &rest _) "/dev/pts/8")) - ((symbol-function 'ghostel-send-string) + ((symbol-function 'cj/--term-send-string) (lambda (s) (push s sent)))) (test-term-tmux-history--with-tmux-mock '((("list-clients" "-F" "#{client_tty}\t#{pane_id}") 0 @@ -401,54 +260,61 @@ up-arrow -- it does not re-enter (which would reset the cursor)." (when (buffer-live-p agent) (kill-buffer agent))))) -(ert-deftest test-term-copy-mode-up-nontmux-enters-then-moves-up () - "Boundary: without tmux and not yet in copy-mode, C-<up> enters -ghostel-copy-mode then moves point up a line, sending nothing to the pty." - (with-temp-buffer - (insert "abc\ndef\nghi\n") - (goto-char (point-min)) - (forward-line 2) ; land on line 3 - (let ((sent nil) (entered nil)) - (cl-letf (((symbol-function 'ghostel-send-string) (lambda (s) (push s sent))) - ((symbol-function 'ghostel-copy-mode) (lambda () (setq entered t)))) - (cj/term-copy-mode-up) - (should entered) - (should-not sent) - (should (= (line-number-at-pos) 2)))))) - -(ert-deftest test-term-copy-mode-up-nontmux-already-in-copy-just-moves () - "Normal: when ghostel is already in copy-mode, C-<up> just moves point up -- -it does not call `ghostel-copy-mode' again (which would toggle copy-mode off)." +;;; bindings + +(ert-deftest test-term-keymap-history-and-copy-bindings () + "Normal: the C-; x terminal map owns the tmux-history and copy-mode commands." + (should (eq (keymap-lookup cj/custom-keymap "x h") #'cj/term-tmux-history)) + (should (eq (keymap-lookup cj/custom-keymap "x c") #'cj/term-copy-mode-dwim)) + (should (eq (keymap-lookup cj/custom-keymap "x t") #'cj/term-toggle))) + +(ert-deftest test-term-copy-mode-up-bound-in-eat-semi-char-map () + "Normal: C-<up> enters copy-mode + scrolls up from inside an EAT terminal." + (should (eq (keymap-lookup eat-semi-char-mode-map "C-<up>") + #'cj/term-copy-mode-up))) + +(ert-deftest test-term-escape-bound-as-unified-exit () + "Normal: Escape sends ESC in semi-char mode (cancels tmux copy-mode) and +returns to semi-char from EAT's emacs/char mode -- one exit key for both." + (should (eq (keymap-lookup eat-semi-char-mode-map "<escape>") + #'cj/term-send-escape)) + (should (eq (keymap-lookup eat-mode-map "<escape>") #'eat-semi-char-mode))) + +(ert-deftest test-term-send-escape-writes-esc-to-pty () + "Normal: `cj/term-send-escape' sends a bare ESC to the terminal process." + (let ((sent nil)) + (cl-letf (((symbol-function 'cj/--term-send-string) + (lambda (s) (push s sent)))) + (cj/term-send-escape) + (should (equal sent '("\e")))))) + +(ert-deftest test-term-word-motion-arrows-forwarded-not-window-arrows () + "Normal: C-/M-left/right forward to the terminal (word motion in the program's +input) instead of moving Emacs point; windmove's S-arrows still reach Emacs." + (dolist (key '("C-<left>" "C-<right>" "M-<left>" "M-<right>")) + (should (eq (keymap-lookup eat-semi-char-mode-map key) #'eat-self-input))) + (dolist (key '("S-<left>" "S-<right>")) + (should-not (eq (keymap-lookup eat-semi-char-mode-map key) #'eat-self-input)))) + +(ert-deftest test-term-eat-tame-scroll-sets-minimal-scroll () + "Normal: `cj/--eat-tame-scroll' sets buffer-local minimal-scroll behavior so +the EAT window line-scrolls instead of recentering on full-frame redraws." (with-temp-buffer - (insert "abc\ndef\nghi\n") - (goto-char (point-min)) - (forward-line 2) ; land on line 3 - (setq-local ghostel--input-mode 'copy) - (let ((sent nil) (entered nil)) - (cl-letf (((symbol-function 'ghostel-send-string) (lambda (s) (push s sent))) - ((symbol-function 'ghostel-copy-mode) (lambda () (setq entered t)))) - (cj/term-copy-mode-up) - (should-not entered) - (should-not sent) - (should (= (line-number-at-pos) 2)))))) - -(ert-deftest test-term-copy-mode-only-c-up-bound () - "Normal/Regression: only C-<up> enters copy-mode in ghostel-mode-map; the -other arrows are not bound to it, so they pass through to the terminal." - (should (eq (keymap-lookup ghostel-mode-map "C-<up>") #'cj/term-copy-mode-up)) - (dolist (key '("C-<down>" "C-<left>" "C-<right>" - "M-<up>" "M-<down>" "M-<left>" "M-<right>")) - (should-not (eq (keymap-lookup ghostel-mode-map key) #'cj/term-copy-mode-up)))) - -(ert-deftest test-term-copy-mode-only-c-up-in-keymap-exceptions () - "Regression (C-arrow copy-mode bug): only C-<up> is in -`ghostel-keymap-exceptions'. C-<left>/<right>/<down> are readline word-motion -at the shell prompt and the M-arrows have no copy-mode role, so none are -exceptions -- they reach the terminal program instead of Emacs." - (should (member "C-<up>" ghostel-keymap-exceptions)) - (dolist (key '("C-<down>" "C-<left>" "C-<right>" - "M-<up>" "M-<down>" "M-<left>" "M-<right>")) - (should-not (member key ghostel-keymap-exceptions)))) + (cj/--eat-tame-scroll) + (should (= scroll-conservatively 101)) + (should (= scroll-margin 0)) + (should (null auto-window-vscroll)))) + +(ert-deftest test-term-eat-reset-sgr-at-newline () + "Normal: the SGR-reset advice injects a reset before each newline when enabled +\(containing an unterminated color), and passes output through unchanged when +disabled." + (let ((cj/eat-reset-sgr-at-newline t)) + (should (equal (cj/--eat-reset-sgr-at-newline (list (quote term) "a\nb\n")) + (list (quote term) "a\e[0m\nb\e[0m\n")))) + (let ((cj/eat-reset-sgr-at-newline nil)) + (should (equal (cj/--eat-reset-sgr-at-newline (list (quote term) "a\nb\n")) + (list (quote term) "a\nb\n"))))) (provide 'test-term-tmux-history) ;;; test-term-tmux-history.el ends here diff --git a/tests/test-term-toggle--buffer-filter.el b/tests/test-term-toggle--buffer-filter.el index 44f30aad6..f56459a06 100644 --- a/tests/test-term-toggle--buffer-filter.el +++ b/tests/test-term-toggle--buffer-filter.el @@ -4,9 +4,9 @@ ;; Three closely-related helpers determine which terminal buffer F12 ;; manages: the predicate `cj/--term-toggle-buffer-p', the list ;; `cj/--term-toggle-buffers', and the per-frame window finder -;; `cj/--term-toggle-displayed-window'. F12 manages the EAT terminal; -;; ghostel buffers (including ai-term's agent buffers) are NOT F12-managed -- -;; they live on M-SPC. +;; `cj/--term-toggle-displayed-window'. F12 opens eshell (run through EAT via +;; eat-eshell-mode), so it manages eshell-mode buffers. Standalone eat buffers +;; and ai-term's agent buffers (also eat) are NOT F12-managed. ;;; Code: @@ -14,26 +14,26 @@ (add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) (add-to-list 'load-path (expand-file-name "tests" user-emacs-directory)) -(require 'term-config) -(require 'testutil-ghostel-buffers) +(require 'eat-config) +(require 'testutil-terminal-buffers) (defun test-term-toggle--cleanup () "Kill leftover agent- and *test-term- prefixed buffers." (cj/test--kill-agent-buffers) (cj/test--kill-test-term-buffers)) -(ert-deftest test-term-toggle--buffer-p-accepts-eat-mode () - "Normal: an eat-mode buffer qualifies as the F12 terminal." +(ert-deftest test-term-toggle--buffer-p-accepts-eshell-mode () + "Normal: an eshell-mode buffer qualifies as the F12 terminal." (test-term-toggle--cleanup) - (let ((buf (cj/test--make-fake-eat-buffer "*test-term-1*"))) + (let ((buf (cj/test--make-fake-eshell-buffer "*test-term-1*"))) (unwind-protect (should (cj/--term-toggle-buffer-p buf)) (kill-buffer buf)))) -(ert-deftest test-term-toggle--buffer-p-rejects-ghostel () - "Boundary: a ghostel buffer is NOT F12-managed (ghostel is ai-term's, M-SPC)." +(ert-deftest test-term-toggle--buffer-p-rejects-eat () + "Boundary: a standalone eat buffer is NOT F12-managed (F12 opens eshell)." (test-term-toggle--cleanup) - (let ((buf (cj/test--make-fake-ghostel-buffer "*test-term-ghostel*"))) + (let ((buf (cj/test--make-fake-eat-buffer "*test-term-eat*"))) (unwind-protect (should-not (cj/--term-toggle-buffer-p buf)) (kill-buffer buf)))) @@ -41,13 +41,13 @@ (ert-deftest test-term-toggle--buffer-p-rejects-agent () "Boundary: ai-term agent buffers are excluded from F12's set." (test-term-toggle--cleanup) - (let ((buf (cj/test--make-fake-ghostel-buffer "agent [project-a]"))) + (let ((buf (cj/test--make-fake-eat-buffer "agent [project-a]"))) (unwind-protect (should-not (cj/--term-toggle-buffer-p buf)) (kill-buffer buf)))) (ert-deftest test-term-toggle--buffer-p-rejects-non-terminal () - "Boundary: a regular buffer (not eat-mode, no terminal name prefix) -> nil." + "Boundary: a regular buffer (not eshell-mode) -> nil." (test-term-toggle--cleanup) (let ((buf (get-buffer-create "*test-term-regular*"))) (unwind-protect @@ -57,40 +57,40 @@ (ert-deftest test-term-toggle--buffer-p-rejects-dead-buffer () "Boundary: nil and dead buffers -> nil." (should-not (cj/--term-toggle-buffer-p nil)) - (let ((buf (cj/test--make-fake-eat-buffer "*test-term-dead*"))) + (let ((buf (cj/test--make-fake-eshell-buffer "*test-term-dead*"))) (kill-buffer buf) (should-not (cj/--term-toggle-buffer-p buf)))) -(ert-deftest test-term-toggle--buffers-returns-eat-excludes-others () - "Normal: returns the EAT terminal but not ghostel/agent buffers." +(ert-deftest test-term-toggle--buffers-returns-eshell-excludes-others () + "Normal: returns the eshell terminal but not eat/agent buffers." (test-term-toggle--cleanup) - (let ((eat (cj/test--make-fake-eat-buffer "*test-term-eat*")) - (agent (cj/test--make-fake-ghostel-buffer "agent [for-test]"))) + (let ((esh (cj/test--make-fake-eshell-buffer "*test-term-esh*")) + (agent (cj/test--make-fake-eat-buffer "agent [for-test]"))) (unwind-protect (let ((result (cj/--term-toggle-buffers))) - (should (memq eat result)) + (should (memq esh result)) (should-not (memq agent result))) - (kill-buffer eat) + (kill-buffer esh) (kill-buffer agent)))) (ert-deftest test-term-toggle--displayed-window-finds-terminal () - "Normal: the EAT terminal in a window -> returns that window." + "Normal: the eshell terminal in a window -> returns that window." (test-term-toggle--cleanup) - (let ((eat (cj/test--make-fake-eat-buffer "*test-term-shown*"))) + (let ((esh (cj/test--make-fake-eshell-buffer "*test-term-shown*"))) (unwind-protect (save-window-excursion (delete-other-windows) (let ((win (split-window-right))) - (set-window-buffer win eat) + (set-window-buffer win esh) (let ((result (cj/--term-toggle-displayed-window))) (should (windowp result)) - (should (eq (window-buffer result) eat))))) - (kill-buffer eat)))) + (should (eq (window-buffer result) esh))))) + (kill-buffer esh)))) (ert-deftest test-term-toggle--displayed-window-skips-agent () "Boundary: only an agent terminal is displayed -> nil (agent not F12-managed)." (test-term-toggle--cleanup) - (let ((agent (cj/test--make-fake-ghostel-buffer "agent [skip-test]"))) + (let ((agent (cj/test--make-fake-eat-buffer "agent [skip-test]"))) (unwind-protect (save-window-excursion (delete-other-windows) diff --git a/tests/test-term-toggle--dispatch.el b/tests/test-term-toggle--dispatch.el index f13c2840b..43db4c3fe 100644 --- a/tests/test-term-toggle--dispatch.el +++ b/tests/test-term-toggle--dispatch.el @@ -14,8 +14,8 @@ (add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) (add-to-list 'load-path (expand-file-name "tests" user-emacs-directory)) -(require 'term-config) -(require 'testutil-ghostel-buffers) +(require 'eat-config) +(require 'testutil-terminal-buffers) (ert-deftest test-term-toggle--dispatch-window-displayed-returns-toggle-off () "Normal: displayed terminal window -> (toggle-off . WIN)." diff --git a/tests/test-term-toggle--display.el b/tests/test-term-toggle--display.el index d6dd33da2..d59d23b15 100644 --- a/tests/test-term-toggle--display.el +++ b/tests/test-term-toggle--display.el @@ -14,7 +14,7 @@ (require 'cl-lib) (add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) -(require 'term-config) +(require 'eat-config) (ert-deftest test-term-toggle--capture-state-records-direction-and-size () "Normal: capture-state writes direction and integer size. diff --git a/tests/test-transcription-process-and-sentinel.el b/tests/test-transcription-process-and-sentinel.el index 90b56f0a5..185412934 100644 --- a/tests/test-transcription-process-and-sentinel.el +++ b/tests/test-transcription-process-and-sentinel.el @@ -96,6 +96,35 @@ the script and the audio path." (should (equal (plist-get make-process-args :command) (list script audio))))) +(ert-deftest test-tx-start-process-stderr-is-a-buffer-not-a-path () + "Normal: :stderr is a live buffer, not a file path. +Passing a path string makes Emacs create a phantom buffer named after the +path, so stderr never reaches the log file and that buffer leaks per run." + (let* ((audio (make-temp-file "cj-tx-audio-" nil ".mp3")) + (script (make-temp-file "cj-tx-script-")) + (cj/transcriptions-list nil) + make-process-args) + (set-file-modes script #o755) + (unwind-protect + (cl-letf (((symbol-function 'cj/--transcription-script-path) + (lambda () script)) + ((symbol-function 'cj/--init-log-file) #'ignore) + ((symbol-function 'cj/--build-process-environment) + (lambda (_) '("FOO=bar"))) + ((symbol-function 'make-process) + (lambda (&rest kwargs) + (setq make-process-args kwargs) + 'fake-process)) + ((symbol-function 'cj/--notify) #'ignore) + ((symbol-function 'force-mode-line-update) #'ignore)) + (cj/--start-transcription-process audio)) + (delete-file audio) + (delete-file script)) + (let ((stderr (plist-get make-process-args :stderr))) + (should (bufferp stderr)) + (should (buffer-live-p stderr)) + (when (buffer-live-p stderr) (kill-buffer stderr))))) + ;;; cj/--transcription-sentinel (ert-deftest test-tx-sentinel-success-writes-transcript-and-updates-status () @@ -105,6 +134,7 @@ the entry status to `complete', and fires a normal-urgency notification." (log-file (make-temp-file "cj-tx-log-" nil ".log")) (process-buffer (generate-new-buffer " *cj-tx-test*")) (proc (list 'mock-process)) + (stderr-buffer (generate-new-buffer " *cj-tx-test-stderr*")) (cj/transcriptions-list (list (list proc "/tmp/audio.mp3" (current-time) 'running))) notify-urgency) @@ -121,12 +151,15 @@ the entry status to `complete', and fires a normal-urgency notification." (lambda (_t _m &optional u) (setq notify-urgency u)))) (cj/--transcription-sentinel proc "finished\n" "/tmp/audio.mp3" - txt-file log-file)) + txt-file log-file stderr-buffer)) (when (buffer-live-p process-buffer) (kill-buffer process-buffer)) + (when (buffer-live-p stderr-buffer) (kill-buffer stderr-buffer)) (delete-file txt-file) (delete-file log-file)) ;; success notification uses default (nil/normal) urgency. (should-not notify-urgency) + ;; the stderr buffer is drained and killed, never leaked. + (should-not (buffer-live-p stderr-buffer)) ;; entry status updated to complete. (let ((entry (car cj/transcriptions-list))) (should (eq (nth 3 entry) 'complete))))) @@ -138,10 +171,14 @@ marks the entry as `error'." (log-file (make-temp-file "cj-tx-log-" nil ".log")) (process-buffer (generate-new-buffer " *cj-tx-fail*")) (proc (list 'mock-fail)) + (stderr-buffer (generate-new-buffer " *cj-tx-fail-stderr*")) (cj/transcriptions-list (list (list proc "/tmp/audio.mp3" (current-time) 'running))) + log-contents notify-urgency) - (with-current-buffer process-buffer (insert "stderr blob")) + (with-current-buffer process-buffer (insert "partial transcript")) + (with-current-buffer stderr-buffer (insert "whisper: CUDA out of memory")) + (with-temp-file log-file (insert "HEADER\n")) (unwind-protect (cl-letf (((symbol-function 'process-buffer) (lambda (_) process-buffer)) @@ -153,11 +190,18 @@ marks the entry as `error'." (lambda (_t _m &optional u) (setq notify-urgency u)))) (cj/--transcription-sentinel proc "exited abnormally\n" "/tmp/audio.mp3" - txt-file log-file)) + txt-file log-file stderr-buffer) + (setq log-contents + (with-temp-buffer (insert-file-contents log-file) (buffer-string)))) (when (buffer-live-p process-buffer) (kill-buffer process-buffer)) + (when (buffer-live-p stderr-buffer) (kill-buffer stderr-buffer)) (delete-file txt-file) (delete-file log-file)) (should (eq notify-urgency 'critical)) + ;; the actual stderr error text reaches the log on failure. + (should (string-match-p "CUDA out of memory" log-contents)) + ;; the stderr buffer is killed, never leaked. + (should-not (buffer-live-p stderr-buffer)) (let ((entry (car cj/transcriptions-list))) (should (eq (nth 3 entry) 'error))))) diff --git a/tests/test-ui-navigation--window-resize.el b/tests/test-ui-navigation--window-resize.el index 553219755..b011fb063 100644 --- a/tests/test-ui-navigation--window-resize.el +++ b/tests/test-ui-navigation--window-resize.el @@ -82,5 +82,50 @@ real window split happens under `--batch'." (should (eq (keymap-lookup cj/buffer-and-file-map arrow) #'cj/window-resize-sticky)))) +(ert-deftest test-ui-navigation-window-resize-sticky-meta-arrow-pulls-away () + "Normal: M-<arrow> reaches the same pull-away as the bare arrow. The +direction is derived with `event-basic-type', so the Meta modifier is stripped +and a sole window pulls a sliver to the side opposite the arrow, exactly as the +bare-arrow path does." + (dolist (case '((M-down . above) + (M-up . below) + (M-left . right) + (M-right . left))) + (let ((pulled nil) + (overriding-terminal-local-map nil) + (pre-command-hook nil)) + (cl-letf (((symbol-function 'one-window-p) (lambda (&rest _) t)) + ((symbol-function 'cj/window--pull-away) + (lambda (dir) (setq pulled dir)))) + (let ((last-command-event (car case))) + (cj/window-resize-sticky))) + (should (eq pulled (cdr case))) ; meta stripped, pulled to opposite side + (should overriding-terminal-local-map)))) ; loop armed + +(ert-deftest test-ui-navigation-window-resize-sticky-meta-arrow-resizes () + "Normal: with more than one window, M-<arrow> dispatches the matching +`windsize' command, same as the bare arrow -- the Meta modifier is stripped +before the resize-map lookup." + (dolist (case '((M-left . windsize-left) + (M-right . windsize-right) + (M-up . windsize-up) + (M-down . windsize-down))) + (let ((ran nil) + (overriding-terminal-local-map nil) + (pre-command-hook nil)) + (cl-letf (((symbol-function 'one-window-p) (lambda (&rest _) nil)) + ((symbol-function (cdr case)) + (lambda (&rest _) (interactive) (setq ran t)))) + (let ((last-command-event (car case))) + (cj/window-resize-sticky))) + (should ran) + (should overriding-terminal-local-map)))) + +(ert-deftest test-ui-navigation-window-resize-bound-under-meta-arrow () + "Normal: each global `M-<arrow>' reaches the sticky-resize command." + (dolist (arrow '("M-<left>" "M-<right>" "M-<up>" "M-<down>")) + (should (eq (keymap-lookup (current-global-map) arrow) + #'cj/window-resize-sticky)))) + (provide 'test-ui-navigation--window-resize) ;;; test-ui-navigation--window-resize.el ends here diff --git a/tests/test-undead-buffers--buffer-undead-p.el b/tests/test-undead-buffers--buffer-undead-p.el new file mode 100644 index 000000000..e196e41a9 --- /dev/null +++ b/tests/test-undead-buffers--buffer-undead-p.el @@ -0,0 +1,52 @@ +;;; test-undead-buffers--buffer-undead-p.el --- undead predicate (name + regexp) -*- lexical-binding: t; -*- + +;;; Commentary: +;; `cj/--buffer-undead-p' decides whether a buffer name is buried instead of +;; killed. A name is undead when it is in `cj/undead-buffer-list' (exact) or +;; matches any regexp in `cj/undead-buffer-regexps' (dynamic families like the +;; ai-term agent buffers, named "agent [<project>]"). `cj/make-buffer-pattern-undead' +;; registers a regexp. + +;;; Code: + +(require 'ert) +(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) +(require 'undead-buffers) + +(ert-deftest test-undead-buffer-undead-p-name-list () + "Normal: a name in the exact list is undead; others are not." + (let ((cj/undead-buffer-list '("*scratch*" "*Messages*")) + (cj/undead-buffer-regexps nil)) + (should (cj/--buffer-undead-p "*scratch*")) + (should (cj/--buffer-undead-p "*Messages*")) + (should-not (cj/--buffer-undead-p "other")))) + +(ert-deftest test-undead-buffer-undead-p-regexp () + "Normal: a name matching a regexp is undead; the agent pattern is anchored." + (let ((cj/undead-buffer-list nil) + (cj/undead-buffer-regexps '("\\`agent \\["))) + (should (cj/--buffer-undead-p "agent [rulesets]")) + (should (cj/--buffer-undead-p "agent [.emacs.d]")) + (should-not (cj/--buffer-undead-p "not an agent")) + (should-not (cj/--buffer-undead-p "my agent [x]")))) ; anchored: must start with "agent [" + +(ert-deftest test-undead-buffer-undead-p-neither () + "Boundary/Error: a name in neither, an empty string, and a non-string are not undead." + (let ((cj/undead-buffer-list '("*scratch*")) + (cj/undead-buffer-regexps '("\\`agent \\["))) + (should-not (cj/--buffer-undead-p "random")) + (should-not (cj/--buffer-undead-p "")) + (should-not (cj/--buffer-undead-p nil)))) + +(ert-deftest test-undead-make-buffer-pattern-undead-adds-and-rejects () + "Normal/Error: registering a regexp makes matching names undead; a blank or +non-string regexp signals." + (let ((cj/undead-buffer-regexps nil)) + (cj/make-buffer-pattern-undead "\\`agent \\[") + (should (member "\\`agent \\[" cj/undead-buffer-regexps)) + (should (cj/--buffer-undead-p "agent [x]")) + (should-error (cj/make-buffer-pattern-undead "")) + (should-error (cj/make-buffer-pattern-undead 42)))) + +(provide 'test-undead-buffers--buffer-undead-p) +;;; test-undead-buffers--buffer-undead-p.el ends here diff --git a/tests/test-undead-buffers.el b/tests/test-undead-buffers.el index d08649b7c..cd2a4176e 100644 --- a/tests/test-undead-buffers.el +++ b/tests/test-undead-buffers.el @@ -1,4 +1,4 @@ -;;; test-undead-buffers.el --- -*- coding: utf-8; lexical-binding: t; -*- +;;; test-undead-buffers.el --- Tests for undead buffer kill/bury behavior -*- coding: utf-8; lexical-binding: t; -*- ;;; Commentary: ;; ERT tests for undead-buffers.el. diff --git a/tests/testutil-general.el b/tests/testutil-general.el index 52b8a8eae..81743cad8 100644 --- a/tests/testutil-general.el +++ b/tests/testutil-general.el @@ -1,4 +1,4 @@ -;;; testutil-general.el --- -*- coding: utf-8; lexical-binding: t; -*- +;;; testutil-general.el --- Shared filesystem helpers for ERT tests -*- coding: utf-8; lexical-binding: t; -*- ;; ;; Author: Craig Jennings <c@cjennings.net> ;; diff --git a/tests/testutil-ghostel-buffers.el b/tests/testutil-terminal-buffers.el index 3c8d75d00..c2a43a3c7 100644 --- a/tests/testutil-ghostel-buffers.el +++ b/tests/testutil-terminal-buffers.el @@ -1,10 +1,8 @@ -;;; testutil-ghostel-buffers.el --- Shared helpers for ghostel/agent buffer tests -*- lexical-binding: t; -*- +;;; testutil-terminal-buffers.el --- Shared helpers for terminal/agent buffer tests -*- lexical-binding: t; -*- ;;; Commentary: -;; Cleanup helpers and a fake-ghostel constructor used across the -;; ai-term and term-toggle test files. Replaces the older -;; testutil-vterm-buffers helpers when the terminal engine moved from -;; vterm to ghostel. +;; Cleanup helpers and fake-terminal-buffer constructors (eat, eshell) used +;; across the ai-term and term-toggle test files. ;;; Code: @@ -13,10 +11,10 @@ (defun cj/test--call-as-gui (fn) "Call FN, stubbing `env-terminal-p' to return nil (a GUI frame). -The terminal refuse-guard was dropped when ghostel replaced vterm (ghostel -renders in TTY frames too), so this no longer gates behavior; it is kept as a -thin passthrough so window-behavior tests written against the old guard keep -working unchanged." +The terminal refuse-guard was dropped when the terminal engine moved off vterm +(EAT and eshell render in TTY frames too), so this no longer gates behavior; it +is kept as a thin passthrough so window-behavior tests written against the old +guard keep working unchanged." (cl-letf (((symbol-function 'env-terminal-p) (lambda () nil))) (funcall fn))) @@ -34,17 +32,6 @@ working unchanged." "Kill all live buffers whose name starts with \"*test-term\"." (cj/test--kill-buffers-matching-prefix "*test-term")) -(defun cj/test--make-fake-ghostel-buffer (name) - "Return a buffer named NAME with `major-mode' set to `ghostel-mode'. - -Avoids actually launching a ghostel process by setting the mode -buffer-locally. Used by tests that need a buffer satisfying the -ghostel-mode predicate without the side-effects of `(ghostel)'." - (let ((buf (get-buffer-create name))) - (with-current-buffer buf - (setq-local major-mode 'ghostel-mode)) - buf)) - (defun cj/test--make-fake-eat-buffer (name) "Return a buffer named NAME with `major-mode' set to `eat-mode'. @@ -56,5 +43,15 @@ predicate without the side-effects of `(eat)'." (setq-local major-mode 'eat-mode)) buf)) -(provide 'testutil-ghostel-buffers) -;;; testutil-ghostel-buffers.el ends here +(defun cj/test--make-fake-eshell-buffer (name) + "Return a buffer named NAME with `major-mode' set to `eshell-mode'. + +Avoids starting a real eshell by setting the mode buffer-locally. Used by the +F12 toggle tests that need a buffer satisfying the eshell-mode predicate." + (let ((buf (get-buffer-create name))) + (with-current-buffer buf + (setq-local major-mode 'eshell-mode)) + buf)) + +(provide 'testutil-terminal-buffers) +;;; testutil-terminal-buffers.el ends here diff --git a/themes/WIP-theme.el b/themes/WIP-theme.el index bac8f5071..5bb25be8b 100644 --- a/themes/WIP-theme.el +++ b/themes/WIP-theme.el @@ -2,7 +2,7 @@ ;;; Commentary: ;; Generated from WIP.json by scripts/theme-studio/build-theme.el. -;; Do not hand-edit; re-run the converter. +;; Treat the JSON as authoritative; regenerate instead of hand-editing this file. ;;; Code: @@ -36,26 +36,26 @@ '(font-lock-delimiter-face ((t (:foreground "#dce0e3")))) '(font-lock-misc-punctuation-face ((t (:foreground "#dce0e3")))) '(cursor ((t (:foreground "#100f0f" :background "#bac1c8")))) - '(region ((t (:foreground "#100f0f" :background "#ab8d2e")))) + '(region ((t (:background "#424f5e")))) '(hl-line ((t (:inherit highlight :background "#222223")))) - '(highlight ((t (:foreground "#eddba7" :weight bold)))) + '(highlight ((t (:foreground "#dab53d" :background "#424f5e" :distant-foreground "#100f0f")))) '(mode-line ((t (:foreground "#cbd0d6" :background "#424f5e" :box (:line-width 1 :color "#a9b2bb"))))) '(mode-line-highlight ((t (:foreground "#e6ce88" :background "#424f5e")))) - '(mode-line-inactive ((t (:inherit mode-line :foreground "#100f0f" :background "#100f0f" :height 2 :box (:line-width 1 :color "#54677d"))))) - '(fringe ((t (:foreground "#f3e7c5" :background "#100f0f" :weight bold)))) - '(line-number ((t (:foreground "#54677d" :background "#100f0f")))) - '(line-number-current-line ((t (:foreground "#e6ce88" :background "#100f0f")))) - '(minibuffer-prompt ((t (:foreground "#899bb1" :background "#100f0f" :weight bold)))) + '(mode-line-inactive ((t (:inherit mode-line :foreground "#100f0f" :height 2 :box (:line-width 1 :color "#54677d"))))) + '(fringe ((t (:foreground "#f3e7c5" :weight bold)))) + '(line-number ((t (:foreground "#54677d")))) + '(line-number-current-line ((t (:foreground "#e6ce88")))) + '(minibuffer-prompt ((t (:foreground "#899bb1" :weight bold)))) '(isearch ((t (:background "#4a4b4f")))) '(lazy-highlight ((t (:background "#4a4b4f")))) - '(isearch-fail ((t (:foreground "#cb6b4d" :background "#100f0f" :weight bold)))) + '(isearch-fail ((t (:foreground "#cb6b4d" :weight bold)))) '(show-paren-match ((t (:foreground "#100f0f" :background "#74932f")))) '(show-paren-mismatch ((t (:foreground "#edeff1" :background "#cb6b4d")))) - '(link ((t (:foreground "#0000ee" :background "#100f0f" :underline t)))) - '(error ((t (:foreground "#cb6b4d" :background "#100f0f" :weight bold)))) - '(warning ((t (:foreground "#ab8d2e" :background "#100f0f" :weight bold)))) - '(success ((t (:foreground "#74932f" :background "#100f0f" :weight bold)))) - '(vertical-border ((t (:foreground "#4a4b4f" :background "#100f0f")))) + '(link ((t (:foreground "#5178db" :underline t)))) + '(error ((t (:foreground "#cb6b4d" :weight bold)))) + '(warning ((t (:foreground "#ab8d2e" :weight bold)))) + '(success ((t (:foreground "#74932f" :weight bold)))) + '(vertical-border ((t (:foreground "#4a4b4f")))) '(org-document-title ((t (:foreground "#ab8d2e" :background "#100f0f" :weight bold :height 1.2)))) '(org-document-info ((t (:foreground "#ab8d2e" :background "#100f0f" :height 1.15)))) '(org-document-info-keyword ((t (:foreground "#7c838a" :background "#100f0f")))) @@ -84,8 +84,8 @@ '(org-link ((t (:foreground "#899bb1" :background "#100f0f" :underline t)))) '(org-footnote ((t (:foreground "#788da6" :background "#100f0f" :slant italic)))) '(org-date ((t (:foreground "#bac1c8" :background "#100f0f")))) - '(org-block-begin-line ((t (:foreground "#8ea85e" :background "#100f0f")))) - '(org-block-end-line ((t (:foreground "#8ea85e" :background "#100f0f")))) + '(org-block-begin-line ((t (:foreground "#809c50" :background "#100f0f")))) + '(org-block-end-line ((t (:foreground "#809c50" :background "#100f0f")))) '(org-inline-src-block ((t (:foreground "#dab53d")))) '(org-quote ((t (:foreground "#74932f" :background "#100f0f" :slant italic)))) '(org-table ((t (:foreground "#bac1c8")))) @@ -168,23 +168,23 @@ '(magit-sequence-stop ((t (:foreground "#cb6b4d")))) '(magit-sequence-head ((t (:foreground "#e4eaf8")))) '(magit-sequence-done ((t (:foreground "#5e6770")))) - '(elfeed-search-date-face ((t (:foreground "#74932f" :slant italic)))) - '(elfeed-search-title-face ((t (:foreground "#7c838a" :slant italic)))) - '(elfeed-search-unread-title-face ((t (:foreground "#e6ce88")))) - '(elfeed-search-feed-face ((t (:foreground "#9f80c9")))) - '(elfeed-search-tag-face ((t (:foreground "#899bb1" :slant italic)))) - '(elfeed-search-unread-count-face ((t (:foreground "#ab8d2e" :slant italic)))) - '(elfeed-search-filter-face ((t (:foreground "#ab8d2e" :weight bold :slant italic)))) - '(elfeed-search-last-update-face ((t (:foreground "#ab8d2e" :slant italic)))) - '(elfeed-log-date-face ((t (:foreground "#74932f")))) - '(elfeed-log-error-level-face ((t (:foreground "#cb6b4d" :weight bold)))) - '(elfeed-log-warn-level-face ((t (:foreground "#dab53d")))) - '(elfeed-log-info-level-face ((t (:foreground "#74932f")))) - '(elfeed-log-debug-level-face ((t (:foreground "#a9b2bb")))) + '(elfeed-search-date-face ((t (:foreground "#606267" :slant italic)))) + '(elfeed-search-title-face ((t (:foreground "#606267" :slant italic)))) + '(elfeed-search-unread-title-face ((t (:foreground "#cbd0d6")))) + '(elfeed-search-feed-face ((t (:foreground "#7ba1c5")))) + '(elfeed-search-tag-face ((t (:foreground "#67809c" :slant italic)))) + '(elfeed-search-unread-count-face ((t (:foreground "#777980" :slant italic)))) + '(elfeed-search-filter-face ((t (:foreground "#777980" :weight bold :slant italic)))) + '(elfeed-search-last-update-face ((t (:foreground "#777980" :slant italic)))) + '(elfeed-log-date-face ((t (:foreground "#777980")))) + '(elfeed-log-error-level-face ((t (:foreground "#a85b42" :weight bold)))) + '(elfeed-log-warn-level-face ((t (:foreground "#ab8d2e")))) + '(elfeed-log-info-level-face ((t (:foreground "#627b2c")))) + '(elfeed-log-debug-level-face ((t (:foreground "#7c838a")))) '(mu4e-title-face ((t (:foreground "#dab53d")))) '(mu4e-context-face ((t (:foreground "#dab53d" :weight bold)))) '(mu4e-modeline-face ((t (:foreground "#8e919a")))) - '(mu4e-ok-face ((t (:foreground "#8ea85e")))) + '(mu4e-ok-face ((t (:foreground "#809c50")))) '(mu4e-warning-face ((t (:foreground "#cb6b4d")))) '(mu4e-header-title-face ((t (:foreground "#67809c")))) '(mu4e-header-key-face ((t (:foreground "#67809c" :weight bold)))) @@ -207,19 +207,19 @@ '(mu4e-region-code ((t (:foreground "#9f80c9")))) '(mu4e-system-face ((t (:foreground "#cb6b4d" :slant italic)))) '(mu4e-highlight-face ((t (:foreground "#dab53d" :weight bold)))) - '(mu4e-compose-separator-face ((t (:foreground "#100f0f" :background "#546c20" :weight bold)))) + '(mu4e-compose-separator-face ((t (:foreground "#100f0f" :background "#627b2c" :weight bold)))) '(gnus-header-name ((t (:foreground "#8e919a")))) '(gnus-header-from ((t (:foreground "#74932f")))) - '(gnus-header-subject ((t (:foreground "#8ea85e")))) + '(gnus-header-subject ((t (:foreground "#809c50")))) '(gnus-header-content ((t (:foreground "#dab53d")))) '(gnus-header-newsgroups ((t (:foreground "#8e919a")))) - '(org-faces-todo ((t (:foreground "#8ea85e")))) - '(org-faces-project ((t (:foreground "#8ea85e")))) - '(org-faces-doing ((t (:foreground "#8ea85e")))) + '(org-faces-todo ((t (:foreground "#809c50")))) + '(org-faces-project ((t (:foreground "#809c50")))) + '(org-faces-doing ((t (:foreground "#809c50")))) '(org-faces-waiting ((t (:foreground "#899bb1")))) '(org-faces-verify ((t (:foreground "#9ba8bb")))) '(org-faces-stalled ((t (:foreground "#dab53d")))) - '(org-faces-delegated ((t (:foreground "#8ea85e")))) + '(org-faces-delegated ((t (:foreground "#809c50")))) '(org-faces-failed ((t (:foreground "#777980" :strike-through t)))) '(org-faces-done ((t (:foreground "#777980" :background "#100f0f" :strike-through t)))) '(org-faces-cancelled ((t (:foreground "#777980" :strike-through t)))) @@ -227,13 +227,13 @@ '(org-faces-priority-b ((t (:foreground "#dab53d" :background "#100f0f" :weight bold)))) '(org-faces-priority-c ((t (:foreground "#ab8d2e" :background "#100f0f" :weight bold)))) '(org-faces-priority-d ((t (:foreground "#7e671f" :background "#100f0f" :weight bold)))) - '(org-faces-todo-dim ((t (:foreground "#546c20" :background "#100f0f")))) - '(org-faces-project-dim ((t (:foreground "#546c20" :background "#100f0f")))) - '(org-faces-doing-dim ((t (:foreground "#546c20" :background "#100f0f")))) + '(org-faces-todo-dim ((t (:foreground "#627b2c" :background "#100f0f")))) + '(org-faces-project-dim ((t (:foreground "#627b2c" :background "#100f0f")))) + '(org-faces-doing-dim ((t (:foreground "#627b2c" :background "#100f0f")))) '(org-faces-waiting-dim ((t (:foreground "#788da6" :background "#100f0f")))) '(org-faces-verify-dim ((t (:foreground "#788da6" :background "#100f0f")))) '(org-faces-stalled-dim ((t (:foreground "#7e671f" :background "#100f0f")))) - '(org-faces-delegated-dim ((t (:foreground "#546c20" :background "#100f0f")))) + '(org-faces-delegated-dim ((t (:foreground "#627b2c" :background "#100f0f")))) '(org-faces-failed-dim ((t (:foreground "#4a4b4f" :background "#100f0f" :strike-through t)))) '(org-faces-done-dim ((t (:foreground "#4a4b4f" :background "#100f0f" :strike-through t)))) '(org-faces-cancelled-dim ((t (:foreground "#4a4b4f" :background "#100f0f" :strike-through t)))) @@ -241,40 +241,46 @@ '(org-faces-priority-b-dim ((t (:foreground "#7e671f" :background "#100f0f" :weight bold)))) '(org-faces-priority-c-dim ((t (:foreground "#544412" :background "#100f0f" :weight bold)))) '(org-faces-priority-d-dim ((t (:foreground "#544412" :background "#100f0f" :weight bold)))) - '(ghostel-default ((t (:foreground "#edeff1")))) - '(ghostel-fake-cursor ((t (:foreground "#100f0f" :background "#a9b2bb")))) - '(ghostel-fake-cursor-box ((t (:foreground "#bac1c8")))) - '(ghostel-color-black ((t (:foreground "#8e919a")))) - '(ghostel-color-red ((t (:foreground "#cb6b4d")))) - '(ghostel-color-green ((t (:foreground "#8ea85e")))) - '(ghostel-color-yellow ((t (:foreground "#ab8d2e")))) - '(ghostel-color-blue ((t (:foreground "#899bb1")))) - '(ghostel-color-magenta ((t (:foreground "#9f80c9")))) - '(ghostel-color-cyan ((t (:foreground "#0096b0")))) - '(ghostel-color-white ((t (:foreground "#bac1c8")))) - '(ghostel-color-bright-black ((t (:foreground "#bfc4d0")))) - '(ghostel-color-bright-red ((t (:foreground "#cb8b7a")))) - '(ghostel-color-bright-green ((t (:foreground "#8ea85e")))) - '(ghostel-color-bright-yellow ((t (:foreground "#e6ce88")))) - '(ghostel-color-bright-blue ((t (:foreground "#adb6c6")))) - '(ghostel-color-bright-magenta ((t (:foreground "#bea9dc")))) - '(ghostel-color-bright-cyan ((t (:foreground "#6ba9bd")))) - '(ghostel-color-bright-white ((t (:foreground "#edeff1")))) - '(ansi-color-black ((t (:foreground "#100f0f" :background "#bfc4d0")))) + '(ansi-color-black ((t (:foreground "#222223" :background "#a9b2bb")))) '(ansi-color-red ((t (:foreground "#cb6b4d")))) - '(ansi-color-green ((t (:foreground "#8ea85e")))) - '(ansi-color-yellow ((t (:foreground "#e0c266")))) - '(ansi-color-blue ((t (:foreground "#899bb1")))) - '(ansi-color-magenta ((t (:foreground "#9f80c9")))) - '(ansi-color-cyan ((t (:foreground "#47a0b7")))) - '(ansi-color-bright-black ((t (:inherit ansi-color-black :foreground "#363638" :weight bold)))) - '(ansi-color-bright-red ((t (:inherit ansi-color-red :weight bold)))) - '(ansi-color-bright-green ((t (:inherit ansi-color-green :weight bold)))) - '(ansi-color-bright-yellow ((t (:inherit ansi-color-yellow :weight bold)))) - '(ansi-color-bright-blue ((t (:inherit ansi-color-blue :weight bold)))) - '(ansi-color-bright-magenta ((t (:inherit ansi-color-bright-magenta :weight bold)))) - '(ansi-color-bright-cyan ((t (:inherit ansi-color-cyan :weight bold)))) - '(ansi-color-bright-white ((t (:inherit ansi-color-bright-white :weight bold)))) + '(ansi-color-green ((t (:foreground "#627b2c")))) + '(ansi-color-yellow ((t (:foreground "#ab8d2e")))) + '(ansi-color-blue ((t (:foreground "#67809c")))) + '(ansi-color-magenta ((t (:foreground "#8255b5")))) + '(ansi-color-cyan ((t (:foreground "#18788c")))) + '(ansi-color-white ((t (:foreground "#bac1c8")))) + '(ansi-color-bright-black ((t (:inherit ansi-color-black :foreground "#100f0f")))) + '(ansi-color-bright-red ((t (:inherit ansi-color-red :foreground "#cb8b7a")))) + '(ansi-color-bright-green ((t (:inherit ansi-color-green :foreground "#809c50")))) + '(ansi-color-bright-yellow ((t (:inherit ansi-color-yellow :foreground "#e0c266")))) + '(ansi-color-bright-blue ((t (:inherit ansi-color-blue :foreground "#899bb1")))) + '(ansi-color-bright-magenta ((t (:inherit ansi-color-magenta :foreground "#bea9dc")))) + '(ansi-color-bright-cyan ((t (:inherit ansi-color-cyan :foreground "#47a0b7")))) + '(ansi-color-bright-white ((t (:inherit ansi-color-white :foreground "#dce0e3")))) + '(eat-term-color-black ((t (:foreground "#100f0f")))) + '(eat-term-color-red ((t (:foreground "#cb6b4d")))) + '(eat-term-color-green ((t (:foreground "#74932f")))) + '(eat-term-color-yellow ((t (:foreground "#e6ce88")))) + '(eat-term-color-blue ((t (:foreground "#67809c")))) + '(eat-term-color-magenta ((t (:foreground "#8255b5")))) + '(eat-term-color-cyan ((t (:foreground "#88b2c3")))) + '(eat-term-color-white ((t (:foreground "#bfc4d0")))) + '(eat-term-color-bright-black ((t (:foreground "#8e919a" :weight bold)))) + '(eat-term-color-bright-red ((t (:foreground "#cb6b4d" :weight bold)))) + '(eat-term-color-bright-green ((t (:foreground "#74932f" :weight bold)))) + '(eat-term-color-bright-yellow ((t (:foreground "#e6ce88" :weight bold)))) + '(eat-term-color-bright-blue ((t (:foreground "#899bb1" :weight bold)))) + '(eat-term-color-bright-magenta ((t (:foreground "#8255b5" :weight bold)))) + '(eat-term-color-bright-cyan ((t (:foreground "#6ba9bd" :weight bold)))) + '(eat-term-color-bright-white ((t (:foreground "#a9b2bb" :weight bold)))) + '(eat-term-bold ((t (:weight bold)))) + '(eat-term-faint ((t (:foreground "#777980")))) + '(eat-term-italic ((t (:slant italic)))) + '(eat-shell-prompt-annotation-success ((t (:foreground "#74932f")))) + '(eat-shell-prompt-annotation-running ((t (:foreground "#dab53d")))) + '(eat-shell-prompt-annotation-failure ((t (:foreground "#a85b42")))) + '(eat-term-color-22 ((t (:foreground "#002f00")))) + '(eat-term-color-52 ((t (:foreground "#2f0000")))) '(auto-dim-other-buffers ((t (:foreground "#777980")))) '(auto-dim-other-buffers-hide ((t (:foreground "#0a0c0d")))) '(dashboard-banner-logo-title ((t (:inherit default :foreground "#dab53d" :background "#100f0f" :weight bold :slant italic :height 1.25)))) @@ -325,7 +331,7 @@ '(flycheck-verify-select-checker ((t (:foreground "#dab53d")))) '(dired-header ((t (:foreground "#54677d" :weight bold)))) '(dired-directory ((t (:foreground "#aac9ea" :weight bold :slant italic)))) - '(dired-symlink ((t (:foreground "#8ea85e")))) + '(dired-symlink ((t (:foreground "#809c50")))) '(dired-broken-symlink ((t (:foreground "#cb7b64" :weight bold)))) '(dired-special ((t (:foreground "#777980")))) '(dired-set-id ((t (:foreground "#cb7b64" :weight bold :slant italic)))) @@ -335,11 +341,10 @@ '(dired-flagged ((t (:foreground "#cb6b4d" :weight bold)))) '(dired-ignored ((t (:foreground "#777980")))) '(dired-warning ((t (:foreground "#dab53d" :weight bold)))) - '(dirvish-inactive ((t (:foreground "#5e6770")))) - '(dirvish-free-space ((t (:foreground "#5d9b86")))) - '(dirvish-hl-line ((t (:background "#2f343a")))) - '(dirvish-hl-line-inactive ((t (:background "#1a1714")))) - '(dirvish-file-modes ((t (:foreground "#838d97")))) + '(dirvish-inactive ((t (:foreground "#606267")))) + '(dirvish-free-space ((t (:foreground "#8ca46c")))) + '(dirvish-hl-line ((t (:foreground "#a9b2bb" :background "#4a4b4f")))) + '(dirvish-file-modes ((t (:foreground "#777980")))) '(dirvish-file-link-number ((t (:foreground "#5e6770")))) '(dirvish-file-user-id ((t (:foreground "#e4eaf8")))) '(dirvish-file-group-id ((t (:foreground "#838d97")))) @@ -381,7 +386,7 @@ '(calibredb-search-header-highlight-face ((t (:foreground "#dab53d" :weight bold)))) '(calibredb-id-face ((t (:foreground "#606267")))) '(calibredb-title-face ((t (:foreground "#cbd0d6" :weight bold)))) - '(calibredb-author-face ((t (:foreground "#8ea85e")))) + '(calibredb-author-face ((t (:foreground "#809c50")))) '(calibredb-format-face ((t (:foreground "#7c838a")))) '(calibredb-size-face ((t (:foreground "#7c838a")))) '(calibredb-tag-face ((t (:foreground "#788da6")))) @@ -401,6 +406,13 @@ '(calibredb-mouse-face ((t (:background "#363638")))) '(calibredb-title-detailed-view-face ((t (:foreground "#dab53d" :weight bold)))) '(calibredb-edit-annotation-header-title-face ((t (:foreground "#bfc4d0" :weight bold)))) + '(cj/nov-reading-sepia ((t (:foreground "#ab8d2e")))) + '(cj/nov-reading-dark ((t (:foreground "#7c838a")))) + '(cj/nov-reading-light ((t (:foreground "#100f0f" :background "#7c838a")))) + '(cj/nov-reading-sepia-heading ((t (:inherit cj/nov-reading-sepia :foreground "#54677d" :height 1.2)))) + '(cj/nov-reading-sepia-link ((t (:foreground "#5178db" :underline t)))) + '(cj/nov-reading-dark-link ((t (:inherit cj/nov-reading-dark :foreground "#5178db" :underline t)))) + '(cj/nov-reading-light-link ((t (:foreground "#5178db" :underline t)))) '(erc-header-line ((t (:foreground "#e4eaf8" :background "#2f343a" :weight bold)))) '(erc-timestamp-face ((t (:foreground "#5e6770")))) '(erc-notice-face ((t (:foreground "#838d97")))) @@ -435,14 +447,14 @@ '(org-drill-hidden-cloze-face ((t (:foreground "#100f0f" :background "#67809c" :slant italic)))) '(org-drill-visible-cloze-face ((t (:foreground "#e0c266" :weight bold :slant italic)))) '(org-drill-visible-cloze-hint-face ((t (:foreground "#788da6" :slant italic)))) - '(org-noter-notes-exist-face ((t (:foreground "#8ea85e")))) + '(org-noter-notes-exist-face ((t (:foreground "#809c50")))) '(org-noter-no-notes-exist-face ((t (:foreground "#606267")))) '(signel-timestamp-face ((t (:foreground "#899bb1")))) - '(signel-my-msg-face ((t (:foreground "#8ea85e")))) + '(signel-my-msg-face ((t (:foreground "#809c50")))) '(signel-other-msg-face ((t (:foreground "#dab53d")))) '(signel-error-face ((t (:foreground "#cb6b4d")))) '(pearl-preamble-summary ((t (:foreground "#67809c" :weight bold :slant italic)))) - '(pearl-editable-comment ((t (:foreground "#dce0e3" :background "#374712")))) + '(pearl-editable-comment ((t (:foreground "#dce0e3" :background "#506328")))) '(pearl-readonly-comment ((t (:foreground "#edeff1" :background "#424f5e")))) '(pearl-modified-highlight ((t (:foreground "#dab53d" :slant italic)))) '(pearl-modified-local ((t (:foreground "#dab53d" :slant italic)))) @@ -601,8 +613,8 @@ '(shr-h4 ((t (:foreground "#8e919a" :weight bold)))) '(shr-h5 ((t (:foreground "#777980" :weight bold)))) '(shr-h6 ((t (:foreground "#606267" :weight bold)))) - '(shr-text ((t (:foreground "#bfc4d0")))) - '(shr-link ((t (:foreground "#5f8bf9" :underline t)))) + '(shr-text ((t (:foreground "#a9b2bb")))) + '(shr-link ((t (:foreground "#5178db" :underline t)))) '(shr-selected-link ((t (:foreground "#777980" :weight bold :underline t)))) '(shr-code ((t (:foreground "#cb6b4d")))) '(shr-mark ((t (:foreground "#100f0f" :background "#dab53d")))) @@ -610,48 +622,48 @@ '(shr-sup ((t (:foreground "#a6aab4")))) '(shr-abbreviation ((t (:foreground "#a6aab4" :slant italic)))) '(shr-sliced-image ((t (:foreground "#a6aab4")))) - '(nerd-icons-blue ((t (:foreground "#67809c")))) - '(nerd-icons-blue-alt ((t (:foreground "#788da6")))) - '(nerd-icons-cyan ((t (:foreground "#0096b0")))) - '(nerd-icons-cyan-alt ((t (:foreground "#47a0b7")))) - '(nerd-icons-dblue ((t (:foreground "#67809c")))) - '(nerd-icons-dcyan ((t (:foreground "#18788c")))) - '(nerd-icons-dgreen ((t (:foreground "#546c20")))) - '(nerd-icons-dmaroon ((t (:foreground "#a85b42")))) - '(nerd-icons-dorange ((t (:foreground "#cb8b7a")))) - '(nerd-icons-dpink ((t (:foreground "#c7a8a5")))) - '(nerd-icons-dpurple ((t (:foreground "#4a1876")))) - '(nerd-icons-dred ((t (:foreground "#a85b42")))) - '(nerd-icons-dsilver ((t (:foreground "#7c838a")))) - '(nerd-icons-dyellow ((t (:foreground "#e6ce88")))) - '(nerd-icons-green ((t (:foreground "#74932f")))) - '(nerd-icons-lblue ((t (:foreground "#aac9ea")))) - '(nerd-icons-lcyan ((t (:foreground "#88b2c3")))) - '(nerd-icons-lgreen ((t (:foreground "#a9be87")))) - '(nerd-icons-lmaroon ((t (:foreground "#a85b42")))) - '(nerd-icons-lorange ((t (:foreground "#cb8b7a")))) - '(nerd-icons-lpink ((t (:foreground "#ff505b")))) - '(nerd-icons-lpurple ((t (:foreground "#9f80c9")))) - '(nerd-icons-lred ((t (:foreground "#cb7b64")))) - '(nerd-icons-lsilver ((t (:foreground "#bac1c8")))) - '(nerd-icons-lyellow ((t (:foreground "#eddba7")))) - '(nerd-icons-maroon ((t (:foreground "#a85b42")))) - '(nerd-icons-orange ((t (:foreground "#cb7b64")))) - '(nerd-icons-pink ((t (:foreground "#c7a8a5")))) - '(nerd-icons-purple ((t (:foreground "#6624a0")))) - '(nerd-icons-purple-alt ((t (:foreground "#6624a0")))) - '(nerd-icons-red ((t (:foreground "#cb6b4d")))) - '(nerd-icons-red-alt ((t (:foreground "#cb6b4d")))) + '(nerd-icons-blue ((t (:foreground "#a9b2bb")))) + '(nerd-icons-blue-alt ((t (:foreground "#a9b2bb")))) + '(nerd-icons-cyan ((t (:foreground "#a9b2bb")))) + '(nerd-icons-cyan-alt ((t (:foreground "#a9b2bb")))) + '(nerd-icons-dblue ((t (:foreground "#a9b2bb")))) + '(nerd-icons-dcyan ((t (:foreground "#a9b2bb")))) + '(nerd-icons-dgreen ((t (:foreground "#a9b2bb")))) + '(nerd-icons-dmaroon ((t (:foreground "#a9b2bb")))) + '(nerd-icons-dorange ((t (:foreground "#a9b2bb")))) + '(nerd-icons-dpink ((t (:foreground "#a9b2bb")))) + '(nerd-icons-dpurple ((t (:foreground "#a9b2bb")))) + '(nerd-icons-dred ((t (:foreground "#a9b2bb")))) + '(nerd-icons-dsilver ((t (:foreground "#a9b2bb")))) + '(nerd-icons-dyellow ((t (:foreground "#a9b2bb")))) + '(nerd-icons-green ((t (:foreground "#a9b2bb")))) + '(nerd-icons-lblue ((t (:foreground "#a9b2bb")))) + '(nerd-icons-lcyan ((t (:foreground "#a9b2bb")))) + '(nerd-icons-lgreen ((t (:foreground "#a9b2bb")))) + '(nerd-icons-lmaroon ((t (:foreground "#a9b2bb")))) + '(nerd-icons-lorange ((t (:foreground "#a9b2bb")))) + '(nerd-icons-lpink ((t (:foreground "#a9b2bb")))) + '(nerd-icons-lpurple ((t (:foreground "#a9b2bb")))) + '(nerd-icons-lred ((t (:foreground "#a9b2bb")))) + '(nerd-icons-lsilver ((t (:foreground "#a9b2bb")))) + '(nerd-icons-lyellow ((t (:foreground "#a9b2bb")))) + '(nerd-icons-maroon ((t (:foreground "#a9b2bb")))) + '(nerd-icons-orange ((t (:foreground "#a9b2bb")))) + '(nerd-icons-pink ((t (:foreground "#a9b2bb")))) + '(nerd-icons-purple ((t (:foreground "#a9b2bb")))) + '(nerd-icons-purple-alt ((t (:foreground "#a9b2bb")))) + '(nerd-icons-red ((t (:foreground "#a9b2bb")))) + '(nerd-icons-red-alt ((t (:foreground "#a9b2bb")))) '(nerd-icons-silver ((t (:foreground "#a9b2bb")))) - '(nerd-icons-yellow ((t (:foreground "#e0c266")))) - '(twentyfortyeight-face-1024 ((t (:foreground "#a9be87")))) + '(nerd-icons-yellow ((t (:foreground "#a9b2bb")))) + '(twentyfortyeight-face-1024 ((t (:foreground "#8ca46c")))) '(twentyfortyeight-face-2 ((t (:foreground "#100f0f")))) '(twentyfortyeight-face-2048 ((t (:foreground "#dab53d" :weight bold :slant italic)))) '(twentyfortyeight-face-256 ((t (:foreground "#47a0b7")))) '(twentyfortyeight-face-512 ((t (:foreground "#9f80c9")))) '(alert-high-face ((t (:foreground "#dab53d" :weight bold)))) '(alert-low-face ((t (:foreground "#7ba1c5" :weight bold)))) - '(alert-moderate-face ((t (:foreground "#a9be87")))) + '(alert-moderate-face ((t (:foreground "#8ca46c")))) '(alert-normal-face ((t (:foreground "#bac1c8")))) '(alert-trivial-face ((t (:foreground "#9f80c9")))) '(alert-urgent-face ((t (:foreground "#cb6b4d")))) @@ -686,13 +698,32 @@ '(embark-verbose-indicator-documentation ((t (:inherit completions-annotations)))) '(embark-verbose-indicator-shadowed ((t (:inherit shadow)))) '(embark-verbose-indicator-title ((t (:weight bold :height 1.1)))) - '(emms-browser-album-face ((t (:foreground "#8ea85e")))) + '(emms-browser-album-face ((t (:foreground "#809c50")))) '(emms-browser-track-face ((t (:foreground "#788da6")))) '(emms-metaplaylist-mode-current-face ((t (:foreground "#cb8b7a")))) '(emms-metaplaylist-mode-face ((t (:foreground "#cb6b4d")))) '(emms-playlist-selected-face ((t (:foreground "#e6ce88" :weight bold)))) '(emms-playlist-track-face ((t (:foreground "#cbd0d6")))) '(flyspell-correct-highlight-face ((t (:inherit isearch :background "#363638")))) + '(ghostel-color-black ((t (:foreground "#8e919a")))) + '(ghostel-color-blue ((t (:foreground "#899bb1")))) + '(ghostel-color-bright-black ((t (:foreground "#bfc4d0")))) + '(ghostel-color-bright-blue ((t (:foreground "#adb6c6")))) + '(ghostel-color-bright-cyan ((t (:foreground "#6ba9bd")))) + '(ghostel-color-bright-green ((t (:foreground "#809c50")))) + '(ghostel-color-bright-magenta ((t (:foreground "#bea9dc")))) + '(ghostel-color-bright-red ((t (:foreground "#cb8b7a")))) + '(ghostel-color-bright-white ((t (:foreground "#edeff1")))) + '(ghostel-color-bright-yellow ((t (:foreground "#e6ce88")))) + '(ghostel-color-cyan ((t (:foreground "#0096b0")))) + '(ghostel-color-green ((t (:foreground "#809c50")))) + '(ghostel-color-magenta ((t (:foreground "#9f80c9")))) + '(ghostel-color-red ((t (:foreground "#cb6b4d")))) + '(ghostel-color-white ((t (:foreground "#bac1c8")))) + '(ghostel-color-yellow ((t (:foreground "#ab8d2e")))) + '(ghostel-default ((t (:foreground "#edeff1")))) + '(ghostel-fake-cursor ((t (:foreground "#100f0f" :background "#a9b2bb")))) + '(ghostel-fake-cursor-box ((t (:foreground "#bac1c8")))) '(json-mode-object-name-face ((t (:foreground "#e0c266")))) '(malyon-face-bold ((t (:inherit bold :foreground "#788da6" :weight bold)))) '(malyon-face-error ((t (:inherit error :foreground "#cb6b4d" :weight bold)))) @@ -771,8 +802,9 @@ '(markdown-reference-face ((t (:inherit markdown-markup-face)))) '(markdown-strike-through-face ((t (:strike-through t)))) '(markdown-url-face ((t (:inherit font-lock-string-face)))) + '(nerd-icons-completion-dir-face ((t (:foreground "#dab53d")))) '(orderless-match-face-0 ((t (:foreground "#e0c266" :weight bold :slant italic)))) - '(orderless-match-face-1 ((t (:foreground "#8ea85e" :weight bold :slant italic)))) + '(orderless-match-face-1 ((t (:foreground "#809c50" :weight bold :slant italic)))) '(orderless-match-face-2 ((t (:foreground "#8255b5" :weight bold :slant italic)))) '(orderless-match-face-3 ((t (:foreground "#0096b0" :weight bold :slant italic)))) '(org-superstar-first ((t (:inherit org-warning)))) @@ -782,7 +814,7 @@ '(rainbow-delimiters-base-face ((t (:inherit unspecified :foreground "#cbd0d6")))) '(rainbow-delimiters-depth-1-face ((t (:inherit rainbow-delimiters-base-face :foreground "#9f80c9")))) '(rainbow-delimiters-depth-2-face ((t (:inherit rainbow-delimiters-base-face :foreground "#788da6")))) - '(rainbow-delimiters-depth-3-face ((t (:inherit rainbow-delimiters-base-face :foreground "#a9be87")))) + '(rainbow-delimiters-depth-3-face ((t (:inherit rainbow-delimiters-base-face :foreground "#8ca46c")))) '(rainbow-delimiters-depth-4-face ((t (:inherit rainbow-delimiters-base-face :foreground "#e0c266")))) '(rainbow-delimiters-depth-5-face ((t (:inherit rainbow-delimiters-base-face :foreground "#0096b0")))) '(rainbow-delimiters-depth-6-face ((t (:inherit rainbow-delimiters-depth-1-face)))) diff --git a/todo.org b/todo.org deleted file mode 100644 index de5563e36..000000000 --- a/todo.org +++ /dev/null @@ -1,9126 +0,0 @@ -#+TITLE: Emacs Config -#+AUTHOR: Craig Jennings -#+ARCHIVE: %s::* Emacs Resolved - -* Emacs Priority Scheme - -Use priority to express impact and urgency, not task type. Bugs, refactors, -tests, chores, and features can all be high or low priority. - -- =[#A]= Urgent risk or current workflow blocker. Use for credential exposure, - security/privacy leaks, data loss, destructive behavior, startup breakage, - failing tests that block work, or a feature/refactor that unblocks a core - daily workflow. -- =[#B]= Important planned work. Use for concrete bugs, high-leverage - architecture cleanup, brittle load-order/test gaps, dependency failures, or - feature work with a clear design and expected near-term use. -- =[#C]= Useful but optional. Use for low-risk cleanup, ergonomics, smoke tests, - investigations with limited current impact, or feature work that would improve - the setup but is not yet a committed workflow. -- =[#D]= Someday/maybe or watchlist. Use for speculative features, tiny polish, - upstream/package tracking, optimizations without current pain, or deferred - ideas that should not compete with active maintenance. - -The task status (the TODO keyword) tracks where a task sits in its lifecycle. -The active keywords are: -- =TODO= — open, not started. -- =PROJECT= — a top-level task that groups several subtasks; the children are the real work, and the project closes when they do. PROJECT lives only at the top task level (a =**= heading under a section), never at the second level or below. A subtask that itself has children stays =TODO= / =DOING=; it does not become a nested PROJECT. -- =DOING= — actively in progress. -- =WAITING= — blocked on something external (a person, an upstream release). -- =VERIFY= — the code is done; only Craig's hands-on check or a pending answer remains. VERIFY tasks wait on Craig and are never auto-implemented. -- =STALLED= — blocked on an upstream issue outside our control. -- =DELEGATED= — handed to someone else to carry. -The done keywords (after the =|= in the sequence) are =DONE= (completed), =CANCELLED= (abandoned), and =FAILED= (attempted, could not be made to work). - -For =PROJECT= headings, use the highest priority of the meaningful child work -inside the project. If a project only contains exploration or review, assign the -priority by the expected decision value rather than the number of files touched. - -Use tags to describe the work shape. These six are the ONLY tags allowed on a -task. Do not invent topic, scope, or status tags — the heading and the parent -section already carry that context. -- =:bug:= means the current behavior is wrong or likely broken. -- =:feature:= means the task adds a new user-visible capability or workflow. -- =:refactor:= means the task changes structure/ownership without primarily - changing behavior. -- =:test:= means the task primarily adds or fixes test coverage. -- =:quick:= means the task appears low effort and localized. It is a planning - hint, not a promise; remove it if the task grows during implementation. -- =:solo:= means Claude can do the task end to end with no input from Craig: - bounded scope, no design or preference call, and verifiable in the local - setup (tests, byte-compile, launch). Tasks needing a policy/preference - decision or a live remote do not get =:solo:=. - -Tags are additive. For example, a small wrong-behavior fix can be -=:bug:quick:=, and a feature that requires internal restructuring can be -=:feature:refactor:=. -* Emacs Open Work -** PROJECT [#A] Manual testing and validation -Exercised once the phases above land. -*** VERIFY F12 toggles the EAT terminal (dock, hide, type, escape) -What we're verifying: F12 now opens and toggles a single EAT terminal (not ghostel), docked with the remembered geometry, and F12 + C-; reach Emacs from inside it. The wiring is verified live; this is the visual dock/toggle gesture only Craig can run. -- Press F12 in a normal frame. Expected: an EAT terminal docks (bottom or right per the column rule) with a real shell prompt, focus in it. -- Type a command (e.g. =ls=) and confirm it runs in the EAT terminal. -- Press F12 again from inside the terminal. Expected: the terminal window hides (toggles off). -- Press F12 again. Expected: the same EAT terminal returns at the remembered size. -- From inside the terminal, press =C-; b= (a window-family leaf). Expected: the global prefix works (reaches Emacs), not typed into the shell. -Expected: F12 docks / hides / redocks one EAT terminal with stable geometry; ghostel is no longer the F12 backend (ai-term on M-SPC is unaffected); F12 and C-; reach Emacs from inside EAT. -*** VERIFY ai-term next steps into and attaches a detached session -What we're verifying: =C-; a n= (or =M-SPC=) cycles into a detached ai-term (alive in tmux, no Emacs buffer) and attaches it, not just live buffers. The pure logic is unit-tested; this is the live attach-on-landing check only Craig can run. -- Start agents in two projects so two ai-terms exist, then leave one detached (kill its Emacs buffer while the tmux session stays alive, or after an Emacs restart that leaves =aiv-*= sessions running). -- Confirm one is attached (a live =agent [...]= buffer) and one is detached (its =aiv-= tmux session is alive but has no buffer). -- Press =C-; a n= repeatedly to cycle through the agents. -Expected: the rotation includes the detached agent; landing on it recreates its terminal buffer and reattaches the tmux session (its live output appears), instead of skipping it. Order is stable (by buffer name) and wraps after the last. -*** VERIFY Google Keep v1 live setup and first fetch -What we're verifying: read-only v1 fetches real Keep notes and renders =data/keep.org= once the one-time gkeepapi + master-token setup is done. The code and 27 tests (12 Python + 15 ERT) are green; this is the live-credential step only Craig can run. -- Install the client into the interpreter =cj/keep-python= uses: =pip install gkeepapi= (or pipx). -- Obtain a Google master token (one-time, via gkeepapi's current login/gpsoauth flow against your account). -- Set your email: -#+begin_src emacs-lisp -(setq cj/keep-email "you@gmail.com") -#+end_src -- Add the token to =~/.authinfo.gpg= (line: =machine google-keep login you@gmail.com password <master-token>=), then clear the auth cache so the daemon sees it: -#+begin_src emacs-lisp -(auth-source-forget-all-cached) -#+end_src -- Fetch (or press =C-c k r=): -#+begin_src emacs-lisp -(cj/keep-refresh) -#+end_src -- Open the result with =C-c k o=. -Expected: =data/keep.org= lists your Keep notes, pinned first, each a header with title/body, labels as org tags, a property drawer (=:KEEP_ID:= / =:UPDATED:= / ...), and an "open in Keep" link. A missing piece (gkeepapi / token / auth) shows a clear =*Warnings*= message naming it, not a crash. -*** TODO theme-studio preview-locate discoverability read -What we're verifying: the locate hover/flash actually feels discoverable in a live frame — the subjective read the deterministic gates can't make. -- Open theme-studio in Chrome (=make theme-studio-open=, or open theme-studio.html). -- Hover several preview elements across the UI mock and a package pane. -- Click an on-pane element, then click an off-pane element. -Expected: hovering updates the preview-label info line immediately with "section > face — value" (no wait on the native tooltip); an on-pane click scrolls to and flashes the right assignment row; off-pane elements don't respond and their title explains why. The flow reads like a legend you can interrogate. If it feels broken or unclear, note where and reopen the relevant phase. -*** TODO reconcile-open-repos includes dot-named repos -What we're verifying: M-P (reconcile open repos) now visits repos whose directory name has a dot (mcp.el, capture.el, etc.), which the old "^[^.]+$" filter silently skipped. Fix in modules/reconcile-open-repos.el, live in the daemon; live-daemon check already confirmed discovery, this is the through-the-command spot-check. -- Run M-P (or M-x cj/reconcile-open-repos) -- Watch the per-repo progress / final summary -Expected: dot-named repos under ~/code (mcp.el, gptel-mcp.el, capture.el, google-contacts.el, …) appear in the reconciliation pass, not just dot-free ones. -*** TODO Safe-lightness guidance reads clearly -What we're verifying: the L_max marker and unsafe-band shade are legible and land in the right place when editing a covered face. -- Open the picker in OKLCH mode on region (or hl-line), with syntax colors assigned -- Read the L_max marker and the shaded unsafe band on the lightness slider -- Drag lightness up toward and past the marker -Expected: the marker is visible and correctly placed, the band above it reads as "unsafe," and crossing it is obvious; an out-of-scope face shows no marker. -*** TODO Safe tint actually reads in real Emacs -What we're verifying: a background tint the tool calls safe really keeps every token readable behind real syntax-colored text — the whole point of the worst-case floor. -- In the tool, set a covered face (e.g. region) to a tint at or just below its L_max with the worst-case readout showing PASS -- Build the theme and load it in Emacs, open a code buffer with varied syntax, and select a region spanning many token colors -- Read every token through the region highlight, paying attention to the limiting foreground the tool named -Expected: every token stays readable over the tint, including the limiting one; a tint pushed just past L_max (readout FAIL) shows a visibly strained or unreadable token, confirming the floor matches reality. -*** TODO Regenerate-replace reads as deliberate -What we're verifying: the count control clearly signals it rewrites the whole family, so replacing hand-added same-hue colors isn't a surprise. -- Add two unrelated colors at a similar hue so they share a strip -- Set that strip's count to 2 -- Watch what happens to the two colors -Expected: the strip becomes a clean base±2 ramp, the two loose colors are gone, and the control made it obvious that's what it would do before you committed. -*** TODO Calibre curated ? menu and docked description -What we're verifying: the curated ? transient, the docked description, and the full dispatch all work in a live calibredb buffer. -- In a calibredb search buffer, press ? and confirm the curated menu (library / filter / sort / open / describe) appears. -- Press d or v to dock the selected book's description in a bottom-30% buffer; press q to dismiss it. -- Press H and confirm calibredb's full dispatch opens. -Expected: ? shows the curated menu, d/v dock the description (q dismisses), H opens the full calibredb dispatch. - -*** TODO Signel: real incoming message raises a toast through the notify script -What we're verifying: the full receive path (signal-cli → signel --handle-receive → cj/signel--notify → notify script) fires on a real message. -- Make sure you are NOT viewing the sender's chat buffer. -- Have a real message sent to you on Signal (or send one from your phone to a second device thread that lands here). -Expected: a transient info toast titled "Signal: <sender>" with the message text (one line, truncated if long), no sound. - -*** TODO Signel: actively-viewed chat stays quiet -What we're verifying: the suppression predicate gates the toast when you're reading that chat. -- Open the sender's chat buffer (=C-; M m=) and keep it the selected window in a focused frame. -- Have the same sender message you again. -Expected: the message renders in the buffer, but no desktop toast appears. - -*** DONE Project-aware capture files into the right todo.org -CLOSED: [2026-06-24 Wed 11:48] -What we're verifying: C-c c t and C-c c b file into the current projectile project's todo.org under its "<Project> Open Work" header, and fall back to the global inbox outside a project. -- Inside a projectile project that has a todo.org, run C-c c t (Task), capture a test entry, and confirm it lands under "<Project> Open Work". -- Run C-c c b (Bug) similarly and confirm it lands as "* TODO [#C] ..." under the same header. -- Run a capture from outside any project (or a project with no todo.org) and confirm the global-inbox fallback with a warning. -Expected: in-project captures land in that project's Open Work; out-of-project captures fall back to the global inbox with a warning. -*** VERIFY C-c ; reaches the custom command family in a real terminal frame -What we're verifying: the TTY mirror prefix C-c ; reaches the same cj/custom-keymap as the GUI C-; prefix, so the whole command family works in a terminal. The unit tests + a live daemon eval already confirm both prefixes resolve to the one keymap; this is the end-to-end in an actual TTY frame, which the batch harness can't drive. -- Open a terminal Emacs frame: emacsclient -nw (or emacs -nw, or Emacs inside vterm/tmux) -- Press C-c ; L (pearl), C-c ; a (AI), C-c ; g (calendar) — the same leaf keys you use under C-; in GUI -- Confirm which-key shows the custom prefix under C-c ; -Expected: each C-c ; <leaf> runs the same command its C-; <leaf> counterpart runs in GUI; which-key lists the family under C-c ;. C-; itself stays working in GUI frames (unchanged). -*** VERIFY org-faces color set in theme-studio reaches the agenda -What we're verifying: editing an org-faces-* row in theme-studio, exporting, and deploying lands the new color on the real agenda's keyword/priority. The build-theme -> deftheme half and the live org-todo-keyword-faces / org-priority-faces wiring are already verified mechanically; this confirms the visual end-to-end with a human eye. -- Open theme-studio in Chrome and pick "org-faces" from the application dropdown (it sits beside elfeed and mu4e) -- Confirm the preview shows the focused agenda block over the auto-dim block, and that the rows read "todo", "priority a", etc. -- Edit org-faces-todo to an obviously different color (e.g. bright magenta) and export the theme to WIP.json -#+begin_src sh :results output -make -C /home/cjennings/.emacs.d deploy-wip -#+end_src -- Open the org agenda (or any todo.org buffer) and look at a TODO keyword -Expected: the TODO keyword renders in the color just set; the priority cookies and other keywords keep their own colors; an unfocused window shows the dimmed variants. -*** VERIFY ERC fires one mention notification and lists real servers -What we're verifying: a mention pops a single desktop notification (not two), and cj/erc-connected-servers lists only live server connections. Fixed in modules/erc-config.el; takes effect after an Emacs restart (not reloaded into the live IRC session). -- Restart Emacs and reconnect ERC -- Have someone mention your nick in a channel (or trigger erc-text-matched-hook) -- Run M-x cj/erc-connected-servers with one server connected and a few channels open -Expected: exactly one desktop notification per mention; cj/erc-connected-servers reports just the connected server(s), not every channel/query buffer. -*** VERIFY dwim-shell zip/backup/menu-key behave -What we're verifying: single-file zip makes a valid <name>.zip, the dated backup gets a real timestamp, and the dwim-shell menu is reachable on M-D in plain dired. Fixed in modules/dwim-shell-config.el, reloaded into the daemon. -- In dired, mark a single file, run the dwim-shell menu (M-D), pick Zip -- Mark a file, run the menu, pick "Backup with date" -- Open a plain dired buffer (not dirvish) and press M-D -Expected: zip produces foo.zip (a valid archive, openable); backup produces foo.ext.YYYYMMDD_HHMMSS.bak with a real date; M-D opens the dwim-shell command menu in plain dired (before the fix it did nothing there). -*** VERIFY orderless matching works inside a vertico session -What we're verifying: vertico-prescient no longer overrides completion-styles, so orderless's space-separated, out-of-order matching is live in the minibuffer (prescient still sorts). Fixed in modules/selection-framework.el, applied live in the daemon. -- Run a command with a vertico minibuffer (e.g. M-x, or C-x b) -- Type two space-separated fragments out of order, e.g. "mode buf" to match "switch-to-buffer-other-... mode" style candidates -Expected: candidates match on both fragments regardless of order (orderless), and the ordering still reflects prescient frecency. Before the fix, space-separated out-of-order input would not match. -*** VERIFY face-name buttons open describe-face -What we're verifying: the face names in the Face Diagnosis report are live buttons. The button text properties (action + face data) are confirmed in the daemon; this is the click/RET confirmation. -- Put point on themed text and run =C-h F= (=cj/describe-face-at-point=). -- In the *Face Diagnosis* buffer, move onto a face name (e.g. in the face stack or provenance) and press RET; also try mouse-1. -Expected: RET or a click on a face name opens that face's =describe-face= help. Non-face entries (anonymous specs) stay plain text. If a name isn't clickable, note which group it's in and reopen. -*** VERIFY latexmk compiles from C-c C-c -What we're verifying: the two activation fixes make the latexmk workflow usable end to end. A live .tex buffer already reports =TeX-command-default= "latexmk" and "LatexMk" in =TeX-command-list=; this is the actual compile. -- Open a small .tex document. -- Press C-c C-c (it should default to LatexMk without prompting through the other commands first), then RET to run it. -- Press C-c C-v to view the PDF. -Expected: C-c C-c runs latexmk and produces a PDF; C-c C-v opens it in the selected viewer. If C-c C-c still defaults to LaTeX or latexmk is missing from the command list, capture it and reopen. -*** VERIFY mu4e trash and refile land in synced maildirs -What we're verifying: the cmail trash-folder + per-message refile fix (shipped 2026-06-13, applies on next mu4e open) actually moves mail into folders mbsync syncs, and the gmail/dmail fail-safe blocks instead of stranding mail. -- Open mu4e (restart it if it was running before the fix) and enter the cmail account. -- On a cmail message, press =d= (mark for trash), then =x= to execute; confirm it lands in cmail/Trash and survives a sync (not a phantom /trash). -- On a cmail message, press =r= (refile) then =x=; confirm it lands in cmail/Archive. -- On a gmail (or dmail) message, press =r=. -Expected: cmail trash → cmail/Trash, cmail refile → cmail/Archive, both real maildirs mbsync syncs. Refile on gmail/dmail signals a user-error (no move) rather than offering to create an unsynced phantom folder. If any move targets a folder mbsync doesn't sync, capture it and reopen. -*** STALLED markdown live preview renders in the browser -What we're verifying: F2 in a markdown buffer runs the custom cj/markdown-preview (not markdown-mode's own command) and the impatient-mode strapdown preview actually renders. Fixed in modules/markdown-config.el, reloaded into the daemon. -- Open a .md file with some markdown content -- M-x cj/markdown-preview-server-start (starts simple-httpd on :8080) -- Press F2 in the markdown buffer -Expected: a browser opens http://localhost:8080/imp showing the rendered markdown, and edits to the buffer update the preview live. -Pressing F2 before starting the server gives a user-error telling you to start it. - -#+begin_src cj: comment - we should simply have the server start if it's not already started. -#+end_src - -*** STALLED ai-term wrap-teardown + shutdown end-to-end -What we're verifying: the three headless functions drive the rulesets wrap-it-up workflow correctly, including the real tmux/shutdown side effects the ERT tests can't exercise. The .emacs.d functions are in and unit-verified; the rulesets half (workflow + Stop hook) is already built. Test the countdown with a stubbed shutdown command first — do not power off during the check. -#+begin_src emacs-lisp -;; temporarily stub the shutdown so the countdown can't power off: -(setq cj/ai-term-shutdown-command "echo SHUTDOWN-WOULD-FIRE") -#+end_src -- "wrap it up" in an agent: the valediction renders fully, then that agent's buffer + its =aiv-<proj>= session + the claude process are gone and the window layout is restored. -- "wrap it up with summary" / "and summarize": wrap completes but the buffer stays. -- "wrap it up and shutdown" with a second =aiv-*= session alive: it refuses, names the other session, does a normal wrap (no countdown). -- "wrap it up and shutdown" as the sole session: the echo area counts 10→1 one per second; press C-g mid-count and confirm "Shutdown cancelled."; then let one run to zero and confirm it would fire the (stubbed) command. -#+begin_src emacs-lisp -;; restore the real command when done: -(custom-reevaluate-setting 'cj/ai-term-shutdown-command) -#+end_src -Expected: teardown removes exactly the right session/buffer and restores layout; the with-summary variants keep the buffer; the multi-session shutdown refuses; the sole-session countdown renders, cancels on C-g, and fires only at zero. If any step misbehaves, capture it and reopen. Once the stubbed run looks right, a single real shutdown test confirms the live path. - -#+begin_src cj: comment - I would like to test this in separate steps naturally as I need them across sessions. please add one child task for each item to test above. -#+end_src - -*** 2026-06-15 Mon @ 12:10:06 -0500 org-capture popup single-Task into inbox verified -Craig confirmed: Super+Shift+N pops straight into a Task capture (no menu), single full-frame window, files under "Inbox" in ~/org/roam/inbox.org, and the frame closes cleanly. Passed. -*** 2026-06-11 Thu @ 18:29:39 -0500 Verified UI-face preview and contrast survive a ground bg change -Craig walked the repro: mode-line with its own fg/bg kept its preview bg and ratio through a ground change; ground-dependent rows re-rated; package-faces contrast column updated. Pass. Closed the [#A] contrast-cell and [#B] preview-bg parents. -*** 2026-06-11 Thu @ 18:29:39 -0500 Verified seeded package-face defaults, with steel tuning -Craig read org/magit/elfeed against the ground. Pass with tuning: steel reads a bit dark — flipped to steel+1 on magit (better), but org wanted darker; these are updated selections, NOT final — he expects to adjust many more before the theme ships. His export saved to scripts/theme-studio/theme.json (replaced the 2026-06-09 state, prior version in git at 4f2d00eb). Side find: the org preview's heading-three ↔ headline-todo flash linkage is cross-wired — filed as its own bug task. -*** 2026-06-11 Thu @ 18:29:39 -0500 Verified large face tables stay usable -Craig scrolled the org table, filtered on "agenda", reassigned a face — grouping, narrowing, and live preview update all behaved. Pass. -*** 2026-06-11 Thu @ 18:29:39 -0500 Verified perceptual readouts in the picker -Craig validated the readouts against computed reference values (default fg #f0fef0 on ground #000000: APCA Lc -104.7 / WCAG 20.14; keyword blue #67809c: Lc -33.7 / WCAG 5.14 — negative polarity correct for light-on-dark). Legible, uncrowded. Pass. Side find filed separately: the picker panel itself blends into the page background ([#C] picker-visibility task). -*** 2026-06-11 Thu @ 18:29:39 -0500 Verified ΔE warnings read clearly -Craig built a near-duplicate pair and a well-spread palette: the close pair was named with its ΔE, sorted closest-first with the cap behaving; no warning on the spread palette. Pass. -*** 2026-06-20 Sat @ 22:11:00 -0400 F9 agent toggle no longer shrinks after a C-; b pull-away -Craig confirmed in his live GUI frame: the agent window keeps its height across repeated F9 toggles after a C-; b pull-away, even under the WIP theme's near-zero mode-line-inactive. The total-height capture/replay fix holds (dbee95ae). -*** 2026-06-20 Sat @ 22:11:00 -0400 F9 toggle preserves all windows in a 3-window layout -Craig confirmed in his live GUI frame: toggling the agent off then on in a 3-window layout returns the same three windows — both working windows survive and the agent re-splits its own bottom strip. The reversible-toggle fix holds (64916462). -*** 2026-06-24 Wed @ 00:37:18 -0400 C-<up> copy-mode scroll verified in a real terminal -Craig confirmed in a live terminal: C-<up> enters copy-mode and scrolls up, repeated C-<up> keep scrolling without resetting, the other modified arrows are left alone (C-<left>/C-<right> still do readline word-motion at the prompt). The C-<up>-only fix + already-in-copy guard (commit 7696ff76) holds. -*** DONE theme-studio markdown preview reads like a real README -CLOSED: [2026-06-24 Wed 11:47] -What we're verifying: selecting markdown-mode in the view dropdown shows a realistic README (not the generic face-name list), and the markdown faces render legibly in context. #mdtest already confirms the wiring + that every element's face is real; this is the visual read. -- Reload theme-studio (or make theme-studio-open) -- Pick "markdown-mode" from the view dropdown -Expected: a README preview with headers, bold/italic, code, links, lists/checkboxes, blockquote, table, etc., each in its theme face. Clicking an element flashes its row in the faces table. -*** DONE C-s C-s repeats the last search -CLOSED: [2026-06-24 Wed 11:37] -What we're verifying: the second consecutive C-s repeats the previous consult-line search instead of erroring "No Vertico session". Fix in modules/selection-framework.el (vertico-repeat-save now on minibuffer-setup-hook), live in the daemon. -- Press C-s, type a search term, RET to dismiss (or just narrow then exit) -- Press C-s again, then C-s a second time without any command in between -Expected: the second C-s reopens the last search (vertico-repeat) rather than signalling "No Vertico session". -*** DONE Irreversible actions require a typed "yes" after a daemon restart -CLOSED: [2026-06-24 Wed 11:36] -What we're verifying: the strong-confirm tier is restored for irreversible actions. The global (fset 'yes-or-no-p 'y-or-n-p) was removed and those sites now call cj/confirm-strong, which forces a typed "yes"/"no". The fset is baked into the running daemon and can't be cleared from Lisp, so this only takes effect after a restart. Ordinary yes-or-no-p prompts stay single-key (use-short-answers t). -- Restart the Emacs daemon (clean state) -- Trigger an irreversible action, e.g. M-x cj/system-cmd-shutdown (then abort), or attempt to overwrite a file via the rename/move commands -Expected: the irreversible prompt requires typing the full word "yes" (not a single y); a benign yes-or-no-p prompt elsewhere still accepts a single keystroke. -*** DONE Calibre bookmark default name is "Author, Title" -CLOSED: [2026-06-24 Wed 10:56] -What we're verifying: a new nov bookmark takes the "Author, Title" form parsed from the filename, not the raw EPUB filename. -- Open an EPUB in Calibre (nov buffer). -- Hit m to set a bookmark. -Expected: the default bookmark name is "Author, Title" (underscores stripped, colon restored), e.g. "Agatha Christie, The A.B.C. Murders". - -*** DONE theme-studio gnus view package themes the article headers -CLOSED: [2026-06-24 Wed 11:29] -What we're verifying: gnus is now its own view package in theme-studio (it drives the mu4e article view), so the bright-green article headers can be themed and exported. #gnustest confirms the package is registered and its preview emits only real gnus faces; this is the visual read plus the live-green retirement. -- Reload theme-studio (or make theme-studio-open) -- Pick "gnus (mu4e article view)" from the view dropdown (sits among the g entries) -- Confirm the preview shows a header block, an emphasized body, an 11-level quoted reply chain, and a signature -- Theme a few gnus faces (e.g. gnus-header-name, gnus-header-from, gnus-cite-1) to obvious colors, export to WIP.json, then deploy -#+begin_src sh :results output -make -C /home/cjennings/.emacs.d deploy-wip -#+end_src -- Restart Emacs (or reload the theme), reopen a mu4e message -Expected: the studio preview renders each gnus face in its theme color; after export + deploy, the *mu4e-article* From/Subject/To/Date headers show the themed colors instead of the gnus green defaults. -*** DONE dashboard theming — banner gold, headings themed, items show per-filetype icons -CLOSED: [2026-06-24 Wed 11:29] -What we're verifying: with the dashboard out of global font-lock (Fix A) and file icons on (Fix C), the live dashboard shows the theme colors and icons. Eyeball it. -- Open the dashboard (F1) -Expected: the "Emacs:" banner title is gold, the "Projects:/Bookmarks:/Recent Files:" headings are themed blue, and the project/recent-file rows each show a colored per-filetype icon (org files greenish, dirs yellow; bookmarks a plain icon). -*** DONE info-mode open is non-destructive and cancels cleanly -CLOSED: [2026-06-24 Wed 11:41] -What we're verifying: opening a .info file no longer auto-kills the buffer, and the explicit cj/open-with-info-mode prompt cancels cleanly on decline. Fixed in modules/help-config.el; stale daemon state already cleared, so this also survives a fresh restart. -- find-file a .info file (e.g. one under elpa) — it should open as an ordinary buffer, not vanish into Info -- In that buffer, edit something, then M-x cj/open-with-info-mode; at the save prompt answer no -- Repeat M-x cj/open-with-info-mode on an unmodified .info buffer -Expected: find-file leaves the buffer intact (no auto-kill); declining the save prompt prints "Operation canceled" with no "No catch for tag" error; on an unmodified buffer it opens the file in Info. -*** DONE C-; b d diffs, C-; b D deletes -CLOSED: [2026-06-24 Wed 11:43] -What we're verifying: the buffer-and-file keymap now puts diff on the easy lowercase key and the destructive delete on the capital. Swapped in modules/custom-buffer-file.el and re-bound live in the daemon. -- Open a file buffer and edit it without saving -- Press C-; b d -- Press C-; b D, then cancel at the delete confirmation -Expected: C-; b d runs the diff (buffer vs saved file); C-; b D starts delete-buffer-and-file (offers to delete the file). Before the swap these were reversed. -*** DONE nerd-icons colors are theme-driven (legend + live icons) -CLOSED: [2026-06-24 Wed 11:35] -What we're verifying: the nerd-icons v1 feature reads right end to end. The Python/Node/browser gates pass; this is the visual confirmation the gates can't make — the legend pane and the real per-filetype icon colors after the tint removal. -- In theme-studio, open the nerd-icons pane: the legend should show each filetype's real nerd-font glyph in its mapped color (el purple, py dark-blue, dir yellow, …), with the 34 color faces editable on the left. -- Recolor a face (e.g. nerd-icons-purple) and confirm every legend row mapped to it repaints immediately. -- Restart Emacs (the running daemon still has the old darkgoldenrod tint baked into the faces until restart). -- In a fresh frame, look at icons in completing-read (find-file), dirvish, the dashboard, and ibuffer. -Expected: the legend renders glyphs in their assigned colors and recolor repaints live; after restart, file/dir/buffer icons show nerd-icons' per-filetype multicolor palette driven by the theme (not a uniform darkgoldenrod), and directory icons are yellow. If icons are still uniform or uncolored, capture it and reopen. -*** DONE ai-term keybindings land on C-; a + M-SPC -CLOSED: [2026-06-24 Wed 10:36] -What we're verifying: the relocated ai-term keys work in a live frame, including from inside an agent buffer, and the no-agent fallback launches the picker. -- Press M-SPC from a normal buffer with at least one agent open. -- Press M-SPC again from inside an agent buffer (ghostel). -- With no agent running, press M-SPC. -- Walk C-; a a, C-; a s, C-; a n, C-; a k (which-key should show the ai-term menu under C-; a). -- Press F9, C-F9, s-F9, M-F9. -Expected: M-SPC swaps to the next agent (rotating, wrapping) both from a normal buffer and from inside an agent. With no agent running, M-SPC opens the project picker rather than erroring. C-; a a toggles the most-recent agent, s opens the picker, n swaps, k closes. The F9 family does nothing (unbound). Note: the running daemon still has gptel in memory from before the archive, so a full Emacs restart is the clean confirmation that nothing regressed at startup. -*** DONE deferred game commands still work after a restart (load-graph Phase 4) -CLOSED: [2026-06-24 Wed 10:37] -What we're verifying: with games-config no longer eagerly required, malyon and 2048-game still launch from a fresh Emacs, and games-config loads on first use rather than at startup. Batch tests cover the autoload chain; this is the interactive confirmation the spec asks for after each deferral batch. -- Restart Emacs (daemon or standalone) so games-config is no longer pre-loaded from this session. -- Confirm it's not loaded at startup: -#+begin_src emacs-lisp -(featurep 'games-config) -#+end_src -- M-x malyon — it should load games-config and the malyon package, then start interactive fiction (stories under ~/sync/org/text.games/). -- M-x 2048-game — should start the 2048 puzzle. -- Re-check (featurep 'games-config) — now non-nil. -Expected: at startup (featurep 'games-config) is nil; both commands launch normally; after invoking one, games-config is loaded. If a command errors instead of launching, capture it and reopen the deferral as a TODO. -*** DONE native-comp + gcmh survive a daemon restart cleanly -CLOSED: [2026-06-24 Wed 10:37] -What we're verifying: re-enabling JIT native compilation and switching GC to gcmh holds up across a full daemon restart and a real work session. The fix is live in the current daemon and a throwaway daemon launched clean, but the already-loaded modules only get natively compiled on a fresh start (a background async burst), and the old "Selecting deleted buffer" race needs a real GUI session to rule out on 30.2. -- Restart the Emacs daemon (clean state): kill it and start fresh, or reboot. -- Use Emacs normally for a while — the first session after restart triggers background native compilation of ~100 modules. Watch for any "Selecting deleted buffer" errors or compilation crashes (check the *Async-native-compile-log* buffer and comp-warnings.log). -- After things settle, confirm the settings are live: -#+begin_src emacs-lisp -(list :jit native-comp-jit-compilation - :gcmh gcmh-mode - :gcmh-high gcmh-high-cons-threshold) -#+end_src -- Edit normally (completion, agenda, AI buffers) and notice whether the periodic GC jank is gone. -Expected: restart is clean (no backtrace); the background native-comp burst finishes without "Selecting deleted buffer" errors; the form returns (:jit t :gcmh t :gcmh-high 1073741824); editing feels smoother with no frequent GC pauses. If the async race recurs on 30.2, capture the error and reopen as a TODO — the fallback is an AOT sweep or going back to JIT-off. -*** DONE mu4e buffers are themed (headers, main, message view) -CLOSED: [2026-06-24 Wed 10:38] -What we're verifying: with the mu4e modes excluded from global font-lock, mu4e's manual face properties survive, so the buffers pick up the theme. The headers + main + view-headers are the ones global font-lock was stripping. -- Restart Emacs (cleanest), or kill and reopen the mu4e buffers -- Open mu4e, look at the headers list and the main menu -- Open a message and read the body -Expected: headers list shows unread/flagged/date/subject in their theme colors (mu4e-unread-face gold, mu4e-header-face green, etc.); the main menu and the message-view headers (From/To/Subject) are themed; the message body still renders correctly (gnus does the body, so it's unaffected). NOTE: a plain "g" refresh in an already-open *mu4e-headers* won't fix it on its own unless font-lock is off there; a restart is the reliable check. -*** DONE slack keys are safe before slack loads -CLOSED: [2026-06-24 Wed 10:44] -What we're verifying: the C-; S slack keys don't error before slack has started, and the prefix shows in which-key. Fixed in modules/slack-config.el; restart to apply (not reloaded into the live session). -- Restart Emacs but do NOT run cj/slack-start -- Press C-; S Q (close all), and C-; S w / @ / # (these previously void-function'd or void-variable'd before load) -- Press C-; S and check which-key shows the "slack" prefix -Expected: C-; S Q reports "Closed 0 Slack buffers" with no error; w/@/# either run or autoload slack cleanly (no void-function); the which-key popup lists the slack prefix. -*** DONE modeline still shows the git branch and state -CLOSED: [2026-06-24 Wed 10:45] -What we're verifying: the VC-cache simplification didn't change what the modeline shows on a normal repo. Fixed in modules/modeline-config.el (live in the daemon after reload). -- Open a file inside a git repo -- Glance at the mode-line VC segment -Expected: the branch name and state still render as before (e.g. "main" with the usual state face). The change only drops a per-render stat and guards against git errors; normal display is unchanged. - -*** DONE Lock screen actually locks on Wayland -CLOSED: [2026-06-24 Wed 10:45] -What we're verifying: C-; ! l locks the screen on Wayland. slock (X11-only) never worked here; the locker now runs loginctl lock-session, which logind turns into a Lock signal that hypridle handles by running hyprlock — the same path idle/sleep locking already uses. Fix in modules/system-commands.el, live in the daemon. -- Press C-; ! l (or run M-x cj/system-cmd-lock) -- The screen should lock with hyprlock -- Unlock with your password -Expected: the screen locks immediately and unlocks with your password. (Before the fix it printed "Running lockscreen-cmd..." and nothing happened.) -*** DONE OKLCH editor feels right -CLOSED: [2026-06-24 Wed 10:47] -What we're verifying: the OKLCH sliders / C×L plane edit cleanly and clamping is visible. -- Switch the picker to OKLCH mode and drag L, then C, then H -- Push chroma past the sRGB gamut, then toggle the AA/AAA mask -Expected: each axis moves independently; the C×L plane (once 4b lands) opens on the current color; "chroma clamped to sRGB" shows on clamp; toggling the mask does not reset OKLCH mode. -*** DONE Generated ramp harmonizes -CLOSED: [2026-06-24 Wed 10:47] -What we're verifying: a ramp generated from a base color reads as one family, not a grab-bag (the aesthetic the math is meant to produce). -- Open =scripts/theme-studio/theme-studio.html= in Chrome -- Pick a mid-lightness base swatch (e.g. a blue) and generate its ramp at the defaults -- Read the row of steps left to right, then try a near-black and a near-white base -Expected: the steps share an obvious hue and step evenly in lightness; the chroma-ease keeps the extreme steps from going muddy or garish; nothing looks like it belongs to a different color. -*** DONE Color families group the way the eye reads them -CLOSED: [2026-06-24 Wed 10:51] -What we're verifying: the OKLCH hue clustering (25° gap) splits and merges families the way you'd expect, and renaming never moves a color. -- Open =scripts/theme-studio/theme-studio.html= in Chrome and load a real theme (e.g. sterling) -- Read the strips top to bottom: are "the blues" one strip, "the greens" another, neutrals and ground pinned at the top -- Find a pair you'd consider one family that landed in two strips (or two you'd consider separate that merged) -- Rename any swatch to something absurd and confirm it stays in the same strip -Expected: families match your mental grouping; the few that don't are the cue to revisit the 25° gap; renaming never regroups. -*** DONE Removed-step references read clearly as "(gone)" -CLOSED: [2026-06-24 Wed 10:46] -What we're verifying: lowering a family's count leaves a referencing face visibly stale, not silently re-pointed. -- Assign a UI or syntax element to an outer step of a family (e.g. region = a blue+3) -- Lower that family's count to 2 so blue+3 disappears -- Read the assignment's dropdown -Expected: the dropdown shows "(gone)" for the removed step, never a silent jump to a different color; re-pointing it is a deliberate choice. -*** DONE Dirvish d duplicates, D force-deletes with a confirm -CLOSED: [2026-06-24 Wed 10:52] -What we're verifying: in dirvish, d now duplicates the file at point (delete-to-trash removed), and D force-deletes the marked files via sudo rm -rf after a yes-or-no-p naming the targets. The pure command builder is unit-tested; this is the live keypress plus the guarded destructive path. -- Open dirvish on a scratch directory holding a couple of throwaway files -- Put point on a file and press d — confirm a "<name>-copy.<ext>" appears (a duplicate, nothing deleted) -- Mark one or two throwaway files, press D, and read the "Force-delete (sudo rm -rf, NO undo): <names>?" prompt -- Answer no first (confirm nothing happens), then press D again and answer yes -- Note whether sudo prompts for a password and whether the file actually disappears -Expected: d duplicates; D names the exact targets and only deletes on yes; the files are gone with no trash copy. If sudo needs a password that shell-command can't supply, flag it — the delete may need to route through a tty instead. -** PROJECT [#A] Theme-Studio Open Work -Parent grouping the open theme-studio / theming issues; close each child independently. -*** TODO [#A] theme-studio: consistent assignment-view table columns :feature:studio:next: -All view-assignment tables should use one consistent column set and order, whatever view is selected: element name (sortable), lock, fg, bg, style, box (with a side expansion showing the selected color, as in UI faces), contrast, inheritance, size, preview text. No other columns at this design stage. When a view's elements can't take a given section, raise a signal and disable that section for that view; the disabled state is the visual cue. From the roam inbox 2026-06-16. -*** VERIFY [#A] theme-studio: deploy-wip button on the browser page :feature:studio:next: -Needs from Craig: a mechanism choice before I build it. The page is served from file://, so a button can't run make directly. Two options: (a) a tiny localhost helper the page POSTs to (it runs make deploy-wip), or (b) the page writes a watched trigger file that a small daemon/timer picks up. Pick (a) or (b) and I'll implement + test it. -Add a button on the theme-studio page that runs the make deploy-wip target locally (build WIP.json into the theme, live-reload the daemon). The page is served from file://, so the browser can't run make directly. Needs a local bridge: a tiny localhost helper the button POSTs to, or a watched trigger file the page writes. Pick the mechanism before building. From the roam inbox 2026-06-15. -*** VERIFY [#A] theme-studio: cannot reassign fg color :bug:studio:next: -Needs from Craig: the exact repro (palette JSON + click sequence, or a quick screen capture). I traced it and couldn't reproduce from the code: updateColor (the "update selected" path) already excludes the selected entry from its uniqueness check (j!==i), and the fg/bg chips are selectable — paletteChip wires d.onclick -> selectColor(i), with the lock only blocking removal, not selection. The "already exists" wording is addColor's message, which is only reached via applyEdit when selectedIdx is null (i.e. no chip selected). So the trigger is a state I can't see statically — selection getting lost before "update", or a second entry already named "fg". With the precise steps I can pin it; I won't guess-patch the palette-update path on an [#A] bug since a wrong fix there corrupts themes. -Selecting the fg tile, changing its value, and clicking update errors that an fg already exists instead of updating it. The update path treats a reassign as an add. From the roam inbox. -*** DOING [#B] Route hardcoded theme colors through the theme :refactor:studio: -Phase 1 DONE (2026-06-25, commit 439fb0e6): stripped every literal color from the config modules so nothing assigns a non-themeable value (0 hex + no named-color face values remain; validate-modules + org-faces/build-theme/face-diagnostic tests clean). The config now renders with default/theme faces, which surfaces where theming support is missing. *Restart Emacs to see the bare state* — the running daemon still holds some accumulated colored state (e.g. =hl-todo-keyword-faces=) that only clears on restart. - -Phase 2 — gaps to surface as themeable faces (exploration; work as we decide what to do): -- *hl-todo keyword colors* (=prog-general.el=): removed the literal FIXME/BUG/HACK/ISSUE/TASK/NOTE/WIP colors; it now falls to hl-todo's package defaults. Add themeable faces (or route FIXME/BUG/HACK -> =error=, ISSUE/TASK -> =warning=, NOTE -> =success=, and a new info-blue for WIP). -- *eshell prompt* (=eshell-config.el=): the timestamp/user/host/pwd were "gray" and the =%= was "white"; now the default face. Add themeable prompt faces (or route to =shadow= / =eshell-prompt=). -- *active-window bg tint* (=org-noter-config.el=, =music-config.el=): the =#1d1b19= tint is gone (the =face-remap-add-relative= is now a no-op); the active window uses the default bg. Needs a themeable "active-buffer tint" face if the distinction is wanted back — same shape as the removed =*scratch*= tint. -- *pdf reading colors* (=pdf-config.el=): =pdf-view-midnight-colors= removed; pdf-tools' own default applies. Needs themeable midnight fg/bg. -- *epub/nov reading color* (=calibredb-epub-config.el=): the =#E8DCC0= sepia removed; reading fg falls to the default. Needs a themeable reading face. -- *org-faces defface defaults* (=org-faces-config.el=): the ~28 literal defaults were stripped. The theme overrides these at runtime, so the focused faces stay themed — but confirm the theme covers the =-dim= variants (auto-dim's non-selected-window faces) too, else those render bare. -From the 2026-06-16 audit; exploration phase 2026-06-25. The nerd-icons "darkgoldenrod" tint from the original audit is already gone. -*** VERIFY [#B] theme-studio: sort newest colors near the top :feature:studio:next: -Deferred from the no-approvals batch (no blocker, needs a focused studio session). Plan: the palette + gallery order comes from columnsFromPalette / sortColumns / paletteOptionList; newest entries currently sort low. Add a recency signal (palette insertion order) and surface recent columns near the front. Risk: the column sort is pinned by several browser gates (#sorttest etc.), so it needs careful test updates — which is why I held it rather than rush it here. -Newly added colors currently land after the ground layer (bg/fg), low in the order. Surface them near the first entry instead, in both the palette color list and the gallery/dropdown, since the most recently added colors are usually the ones being worked on. From the roam inbox 2026-06-15. -*** 2026-06-25 Thu @ 13:58:07 -0400 theme-studio dashboard preview: icons render, items themeable -Both halves resolved. Icon/mojibake half: the decision (embed the nerd font) was made and shipped during the gallery work — a Symbols Nerd Font is @font-face'd into the studio page (=ThemeStudioNerd= in styles.css / previews.js), so the dashboard preview's navigator renders real glyphs instead of mojibake. Items half: =dashboard-items-face= is now an editable face (=face_data.py= DASHBOARD_FACES), and the preview's project/bookmark/recent rows are wrapped in =dashboard-items-face= (commit 1303d995), so editing it recolors them. It inherits =widget-button= (default) while unset, so the rows stay bare during the vanilla exploration until the face is themed. -*** TODO [#B] theme-studio import organization workflow needs a spec :feature:studio: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-13 -:END: -Design import handling for unstructured color sources such as Emacs themes, CSS palettes, screenshots, and generic palette files. Principles from the 2026-06-13 Theme Studio discussion: -- Preserve declared structure whenever an imported entry has a =columnId=. -- For unstructured legacy imports with no =columnId=, avoid silent hue clustering and avoid treating arbitrary =color-N= names as one long ramp; each =color-N= should become its own base column. -- Keep meaningful generated ramp-name inference for names like =blue-1= / =blue= / =blue+1=. -- Group external numeric color-name variants for compact display: =blue1= / =blue2= / =blue3= infer column =blue=; =grey80= / =grey81= infer column =grey=; =orchid3= infers =orchid=. This is display organization, not proof that the colors are an authored Theme Studio span. -- If a numeric external base is spanned later, generate from the actual base name, e.g. =blue1-1= / =blue1= / =blue1+1=, while keeping those generated tiles in the inferred =blue= column. -- Add explicit organization tools rather than hidden inference: group selected colors into a column, suggest hue groups as a preview/action, sort imported colors for inspection, and promote a color from an import bucket into a normal column. -- Consider a compact imported/captured bucket UI for large unstructured imports while preserving per-color column ids internally. - -*** VERIFY [#B] theme-studio: org-agenda app + agenda preview :feature:theme-studio: :studio:next: -Needs from Craig: this is a multi-phase feature, not a bug fix — it depends on the preview-locate feature (per the 2026-06-15 spec) and means breaking org-agenda-* / scheduling / deadline / calendar / clocking faces into their own theme-studio pane with a representative week-agenda preview. Too large to land inside this batch. Confirm you want it built now (and as its own focused session) and I'll start from the spec; otherwise it stays parked. -Break the org-agenda-* plus scheduling / deadline / calendar / clocking / filter faces out of the overloaded org-mode app into a dedicated org-agenda pane (org-mode-line-clock* stay in org-mode), with a representative week-agenda preview at natural item frequency. Keywords, priorities, and tags render live via org-faces / org-mode through the locate registry (hover-only there). Same five-file bespoke-app pattern as org-faces. Depends on the preview-locate feature. Partly subsumes the "break org-mode preview into grouped subsections" task. -*** TODO [#B] theme-studio UI face inheritance needs a spec :feature:studio: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-13 -:END: -Package faces model =inherit= explicitly, but UI faces currently expose only fg/bg/style fields in the table and generated theme output. Before implementing UI-face inheritance, write and review a small spec that defines: which UI faces get an inherit selector, how own defaults from =emacs-default-faces.json= appear versus effective inherited values, how export/import stores cleared vs inherited vs explicit values, how preview resolution follows UI inherit chains, and what browser gates prove the behavior. This touches the UI model, generated defaults, export format, preview rendering, and reset semantics, so it should not be slipped in as a refactor. - -*** 2026-06-25 Thu @ 15:29:51 -0400 Dashboard theming fixed: font-lock, file + heading icons, items themeable -All three causes resolved. Cause A (font-lock stripping faces) fixed 2026-06-16 (202cf430). Cause C: file icons fixed 2026-06-16 (1c97cba7), and section-heading icons now enabled too (=dashboard-set-heading-icons t=, 2026-06-25). Cause B (item color) unblocked — theme-studio now exposes =dashboard-items-face= (=face_data.py=) so the items are colored from the theme, not a hardcoded hex; setting that color is the studio's job now. Original diagnosis (2026-06-16, live daemon inspection) kept below. - -**** Cause A — banner + section headings render default ("Banner Text not gold") -=global-font-lock-mode= (enabled at startup, =early-init.el:311=) fontifies the =*dashboard*= buffer. Dashboard applies the banner title (=dashboard-banner-logo-title=) and section headings (=dashboard-heading=) via the =face= TEXT PROPERTY. font-lock owns the =face= property and strips manually-applied ones it didn't set via keywords, so those faces get cleared on render (every line carries =fontified t=, the jit-lock fingerprint). The theme is fine: =dashboard-banner-logo-title= computes to #dab53d gold and =dashboard-heading= to #67809c — they're stripped at render, not missing. This is a regression of the 2026-05-22 fix "Dashboard navigator icons and section titles uncolored" (7496), which worked before font-lock ran in this buffer. -FIX A — DONE 2026-06-16, commit =202cf430=: exclude dashboard-mode from global font-lock — =(setq font-lock-global-modes '(not dashboard-mode))= at top level in =dashboard-config.el= (top-level so it runs even though the use-package =:config= errors on a void nerd-icons symbol under the test harness). Banner is gold again and the headings pick up =dashboard-heading=. TDD test =tests/test-dashboard-config-font-lock.el=; full suite green; live in the daemon. Causes B and C still open below. - -**** Cause B — project/bookmark/recent items have no color -Items and the navigator are painted by a =dashboard-items-face= button OVERLAY (overlays survive font-lock, which is why Cause A didn't touch them). But in =WIP-theme.el= =dashboard-items-face= is just =(:inherit widget-button)= — unspecified foreground, so it renders in the default color. 7496 had colored it (steel+2) in the now-retired Dupre theme; that color never carried into WIP. Per 7496, the navigator and items share =dashboard-items-face=, so coloring it colors both (separating them is the open task "Color dashboard navigator independently of list items", 7740). -FIX B (per Craig 2026-06-16 — no hardcoded colors, theme it): the items already fall back to the default foreground (=dashboard-items-face= inherits =widget-button= -> unspecified -> default fg), which is the right default. To actually COLOR them, theme-studio must expose =dashboard-items-face= so the color comes from the theme, not a hardcoded hex in =WIP-theme.el=. That is the items half of task 2418. No config/theme change here; this routes to 2418. - -**** Cause C — no icons on items or section titles -=dashboard-set-file-icons= and =dashboard-set-heading-icons= are both nil in the live config (=dashboard-config.el= sets =dashboard-display-icons-p t= + =dashboard-icon-type 'nerd-icons= but never the two enable toggles), so dashboard renders no file/section icons. Only the custom navigator row has icons. -FIX C — file icons DONE 2026-06-16, commit =1c97cba7=: =(setq dashboard-set-file-icons t)= in =dashboard-config.el=. Items now show nerd-icons file icons colored per filetype (verified live: =todo.org= -> nerd-icons-lgreen, project dirs -> nerd-icons-yellow; bookmarks fall back to a generic uncolored icon, no filetype to map). Per Craig: per-filetype (the nerd-icons default). They render only because Fix A took the dashboard out of font-lock, which was stripping the icon faces too. OPEN (offered, not done): =dashboard-set-heading-icons t= would add icons to the section titles — left off pending Craig's call. - -**** Studio angle -To set the item color from theme-studio instead of hand-editing =WIP-theme.el=, the studio's dashboard app must expose =dashboard-items-face= as editable — the "list items unthemed" half of task 2418 (theme-studio: dashboard preview icons missing, list items unthemed). - -**** Next -Confirm Fix A to persist it; pick the item color (Fix B); decide the icon enable + color policy (Fix C). -*** TODO [#B] theme-studio semantic theme architecture :feature:theme-studio:spec: :spec:studio: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-14 -:END: -Spec draft: [[id:fe980b12-451a-4d8b-a550-d99f9ec49f45][theme-studio-semantic-theme-architecture-spec.org]]. - -Design a Modus-inspired layered Theme Studio output path: palette data, semantic role mappings, face templates, and a generated theme wrapper. Keep the current flat JSON-to-theme converter as the compatibility/default path while proving a layered, self-contained generated theme. Include advisory semantic rules as a possible validation layer, not v1 enforcement. - -**** TODO [#B] theme-studio palette generator source modes for base-only vs ground-aware palettes :feature: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-14 -:END: -Tentative follow-up from walking through the generator algorithms. Consider splitting the current =source: palette= behavior into two explicit source modes, names TBD: -- =base color palette= — current behavior; use non-ground base color columns only and ignore bg, fg, ground spans, and color spans. -- =ground and base palette= — use bg/fg plus non-ground base color columns as generator anchors, useful when colored ground endpoints should shape fill-gap or harmony choices. - -This may be cancelled if the extra distinction makes the generator harder to understand. Before implementing, decide final names and whether ground-aware source should include only bg/fg or also ground span steps. - -*** TODO [#B] theme-studio seeding engine :feature:studio: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-13 -:END: -Spec (Ready): [[id:b70b37f2-37df-4c8e-ac2f-1f20d12e33dd][spec]]. Role table → guide-correct defaults for syntax/UI/org; reseed dupre-revised.json to the compact mapping; opens seeded with an all-tier reseed button. Depends on the perceptual-metrics colormath.js core for OKLCH shade generation, so it runs after that feature's Phase 1. -**** TODO Seed model + seed() + #seedtest :solo: -Phase 1. Palette anchors + OKLCH shade generation (reusing colormath.js), the ROLES table, and the three face→role maps as data; pure seed(). Gate: #seedtest asserts representative syntax/UI/org faces resolve correctly (bi→blue-grey, fnd→gold+bold, region bg-only, link underlined, org-level-1 strongest, org-code literal lane) and a non-org bespoke package (magit) keeps its curated seed. -**** TODO Open-seeded + reseed + dupre-revised regen :solo: -Phase 2. Initial state from seed() plus seedPkgmap for the non-org packages; all-tier reseed button with a scope-named overwrite warning, resetting non-org to their APPS defaults; regenerate dupre-revised.json. Gate: #selftest PASS; default-on-open equals seed(); artifact round-trip (regenerated dupre-revised.json imports back to the same seeded state); Chrome eyeball. -**** TODO Seeding-engine test surface :solo:test: -Keep #seedtest, #selftest, the default-on-open check, the dupre-revised round-trip, node --check, and Chrome validation green. -*** TODO [#C] ansi-color dropdown plain, reuse info in the hover :feature:studio: -Drop the parenthetical from the "ansi color" assignment-view dropdown label so it reads plain, and move the explanation to the hover instead: name the packages that reuse these colors (vterm / eshell / compilation / ghostel) and verify they actually do before stating it. From the roam inbox 2026-06-24. -*** TODO [#C] theme-studio: custom view-assignment dropdown with lock indicators :feature:studio:next: -The view-assignment dropdown is a plain HTML menu. Make it a custom menu colored like the other custom menus, and have it indicate which assignment views have all their elements locked, so the user knows when a view's assignments are done. From the roam inbox 2026-06-16. -*** TODO [#C] theme-studio: calibre package doesn't color properly :bug:studio: -The calibre package preview has no elements to theme in the search list, and coloring switches to the string color on mismatched quotes. Investigate, then record a diagnosis and solution in this task before fixing. From the roam inbox 2026-06-15. -*** TODO [#C] theme-studio: break org-mode preview into grouped subsections :feature:studio: -Rather than cramming all org-mode preview into one pane, split into groups so each element is shown in a common, context-rich environment. From the roam inbox. -*** TODO [#C] theme-studio: elfeed ignores theme assignments :studio:studio: -The preview shows theme colors, but elfeed itself renders all-white with no variation. Note: this may be the shr-rendered entry/article view (elfeed-show), where color often comes from the document rather than the theme — confirm whether the symptom is in the search list or the article view. From the roam inbox. -*** VERIFY [#C] theme-studio face-consistency check :feature:studio:next: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-10 -:END: -Needs from Craig: this is an open-ended feature, not a bug — it needs a spec first (what "consistency" means: which faces are compared, what rule flags an inconsistency, how it's surfaced in the UI). Give me the check's definition (or say "brainstorm a spec") and I'll build it; parked until then. -Rule taxonomy captured in [[file:docs/design/theme-studio-face-rules.org][docs/design/theme-studio-face-rules.org]] (Design Rules vs Fidelity Rules). The two checks below map to those two rule kinds. Both surface structural-attribute (weight/slant/underline/box/overline/height) issues; color is the theme's design and out of scope. - -1. Theme cross-cutting consistency (primary, per Craig 2026-06-09): the theme has deliberate cross-cutting rules — e.g. headings/titles are bold, links are underlined, errors/warnings/success are bold. Flag where the theme BREAKS ITS OWN rule (a heading that isn't bold, a link that isn't underlined). The designer declares the rules; the check finds the violators. This is the "tell me where I broke the rule" guardrail. - -2. defface-baseline divergence (secondary): flag where a face's structural attrs differ from its package =defface= so each divergence is deliberate, not an accidental drop. Would have caught the dropped underline/bold defaults and the contradictions (shr-h3 bold-vs-italic, erc-action italic-vs-bold) from the package-face audit as they were introduced. - -Bake into the tool (a lint surfaced in the UI) or run as a build-time check (seeds vs live deffaces via emacsclient). - -*** TODO [#C] theme-studio: restrict the cursor row to its background :bug:studio: -The UI table gives the cursor face the full control set (fg, B/I/U/S, box), but Emacs only honors the cursor face's :background. Its shape is cursor-type, not a face attribute, so every other control on that row is a no-op once the theme loads. Restrict the cursor row to just its background swatch so the studio doesn't present controls Emacs drops. -*** TODO [#C] theme-studio terminal/ANSI colors :feature:studio: -theme-studio represents GUI faces only; terminal colors aren't surfaced at all. Scope decided 2026-06-09: GUI-first faces, NOT full per-face display-class fallback. Two pieces: - -1. ANSI-16 panel. Map the 16 ANSI slots (black/red/green/yellow/blue/magenta/cyan/white + bright variants) to palette colors, with a preview, and export them so =build-theme.el= emits the =ansi-color-*= / =term-color-*= faces. This matters even in pure-GUI Emacs: colored shell output, compilation buffers, eshell, and vterm/eat all draw from these. Signals must line up with their ANSI slot (error red→ansi red, success→green, warning→yellow, info/link→blue) so a signal reads the same in a terminal. - -2. Core-face 16-color fallback. Only the ~10 faces that decide console legibility get a =(((class color) (min-colors 16)) ...)= clause plus a =(t ...)= floor: default/fg, bg, keyword, string, comment, constant, error, warning, region, mode-line, line-number. Tune these for contrast — push it UP, legibility over fidelity, because the only 16-color target is the bare Linux virtual console (an occasional emergency context). The long tail stays GUI-first and auto-approximates. - -Why this scope: the GUI and the normal terminal (foot + tmux, truecolor / ≥256-color) both render the GUI hexes fine; GUI-first is correct there. Only the Linux VT is 16-color, and a low-contrast palette approximates badly down to 16 — so a few core faces get a deliberately higher-contrast 16-color fallback rather than every face carrying a multi-spec. Tool work: the ANSI-16 panel + a flag on the core faces to also capture a 16-color value; =build-theme.el= emits multi-spec only for those. Full per-face fallback is revisited only if console work becomes regular. -*** VERIFY [#C] Palette-columns spec review -SCHEDULED: <2026-06-12 Fri> -Read [[file:docs/theme-studio-palette-columns-spec.org][docs/theme-studio-palette-columns-spec.org]] (Draft, from the 2026-06-10 design discussion) and bless or amend. Decisions 9 and 10 are the two session calls awaiting your word: strips flip to lightest→darkest top→bottom to match the dropdown, and each dropdown column run places the base at its natural lightness position (vs bg/fg bases leading before any steps). On "spec's good": mark Ready, file the phase breakdown, cancel the [#C] hint-override task, start Phase 1. - -*** 2026-06-24 Wed @ 21:53:39 -0400 Editable face-list color grouping cancelled — subsumed by the gallery -The roam-inbox ask was to default-group the editable nerd-icons face table by color family. Craig's call (2026-06-24): the gallery preview already clusters the icons by hue, which covers the underlying "see colors grouped" need, so grouping the 34-row editable table too isn't worth it. Cancelled. -*** 2026-06-24 Wed @ 18:09:26 -0400 theme-studio tier-1 simplifications landed -Behavior-preserving simplifications from the four-agent refactor/simplify assessment, all test-verified (full suite green). Landed: syncMockHeight + syncPkgHeight merged into syncPaneHeight(tableId, paneId); the dead generatorHues "manual" branch deleted (identical to fallback); locateInfoLine removed (fn + export + test, orphaned this session); the redundant pkgbody guard dropped (buildPkgTable self-guards); displayHex/displayName closures inlined; paintUI now calls worstCellHtml; generate.py's two nerd-icons loaders share _load_nerd_icons_artifact (sentinel keeps the null-file edge exact); face_coverage.classify rewritten with named locals (with a new characterization test). Two agent findings were wrong and skipped on verification: LOCATE_REG is live (read by previewSpan), and normalizePaletteEntryCore doesn't exist (hallucinated). Skipped on judgment: a RELEASED_BOX constant (mutable-dict aliasing hazard, only ~10 sites) and inlining apply_hover_box_default (its why-docstring earns the named function). Open for Craig: previewFaceAttrs (app-core.js) is test-only with a stale "the gate calls it" docstring — confirm delete vs keep. -*** 2026-06-24 Wed @ 21:53:39 -0400 app.js split — controls.js extracted, remaining splits declined -The highest-value extraction landed (controls.js, see below). Craig's call (2026-06-24): stop there — the remaining clusters (picker, locate, io, tables) are diminishing navigability gain for more churn, so they're declined. The token-at-position pattern is proven and documented if any one is ever wanted. -**** 2026-06-24 Wed @ 19:16:47 -0400 Extracted the control factories to controls.js -Cut the contiguous dropdown / detail-editor / expander cluster (the custom color dropdown state + closeColorDropdown + mkColorDropdown through mkExpander, 205 lines) from app.js into controls.js, spliced back at a CONTROLS_J token via generate.py. app.js dropped 927 to 721 lines. The token sits at the exact extraction point, so the assembled page is byte-identical (just relocated source) — full suite green with no gate changes. mkBoxControl (a lone factory elsewhere in app.js) stayed put; it can join controls.js later. -*** TODO [#D] theme-studio: move the "clear palette" button :feature:studio: -Craig dislikes the current placement (it rides with the update-color and palette-generation controls and is too easy to hit by accident, then re-import the JSON to recover) but has no target placement in mind yet (2026-06-25). Parked until a placement idea lands — the earlier "left-align at the color-column level" was a guess, not a decision. When a target exists: layout/CSS change in the palette area (app.js / styles.css), visual, verify by eye. From the roam inbox 2026-06-16. -*** 2026-06-20 Sat @ 05:53:39 -0400 Tightened the elements-table horizontal layout -Reduced per-cell padding 12px to 8px across all three tables and shortened the redundant "mode-line-highlight (mode-line hover)" label to "(hover)". The weight/slant narrowing landed with the custom-widget task below. Commit 792e09b5. -*** 2026-06-20 Sat @ 05:53:39 -0400 Custom weight/slant dropdowns with previews -Replaced the native weight/slant selects with mkEnumDropdown, themed like the color dropdown. Values are spelled out (semibold not "semi"; unset reads "weight"/"slant"), each popup option previews its own weight or slant, and lock + popup behavior mirrors the color dropdown. Commit 055e0992. -*** 2026-06-20 Sat @ 05:53:39 -0400 Language dropdown sorted with nav arrows -Alphabetized the language list with Elisp pinned as the default, and added the ‹ › arrows that step the selection (clamped) reusing stepViewIndex. #langtest gate. Commit be62ae5b. -*** 2026-06-20 Sat @ 05:53:39 -0400 Moved the lock column to the leftmost position -Lock cell now sits first in all three tables, ahead of the element/face name; the name sort moved to column 1. From the roam inbox 2026-06-20. Commit 4f869aa1. -*** 2026-06-20 Sat @ 06:44:07 -0400 Explanatory hovers on the expander detail labels -Each label in the expander detail row carries a DETAIL_HOVERS tooltip, matching the table-header labels. From the roam inbox 2026-06-20. Commit 2caa4606. -*** 2026-06-20 Sat @ 06:44:07 -0400 View-dropdown lock indicator -The view dropdown prefixes a lock glyph on any view whose elements are all locked. Delivers the lock-indicator half of the custom-view-dropdown task; the custom-menu half is still open. From the roam inbox 2026-06-20. Commit 2caa4606. -*** 2026-06-20 Sat @ 06:44:07 -0400 Expand/collapse-all toggle with disclosure triangles -Per-row expander toggles show ▶/▼ disclosure triangles; a header-level expand-all/collapse-all button per table opens or closes every row at once. From the roam inbox 2026-06-20. Commit 2933a362. -*** 2026-06-20 Sat @ 06:44:07 -0400 Expander stays open across a table rebuild -A package edit rebuilds the table, which had collapsed an open expander mid-edit. An EXPANDED set keyed by element/face reopens the open rows on rebuild. From the roam inbox 2026-06-20. Commit 7382bf53. -*** 2026-06-20 Sat @ 06:44:07 -0400 Added 18 language previews -Tokenized samples.py previews for Racket, Scheme, Haskell, OCaml, Scala, Kotlin, Swift, Lua, Ruby, Perl, R, Erlang, SQL, PHP, Ada, Fortran, MATLAB, Assembly, wired into the language dropdown (28 languages total) with a guard test. From the roam inbox 2026-06-20. Commit 309b1e9a. -*** 2026-06-20 Sat @ 06:44:07 -0400 Moved the box column between style and contrast -Box now sits at column 5 in all three tables, after style and before contrast (reverses the earlier box-to-last). From the roam inbox 2026-06-20. Commit 2a34c3c7. -*** 2026-06-23 Tue @ 13:51:37 -0400 theme-studio preview locate v1 — implemented -Built the preview-element locate feature per the spec (all six phases). Hover any data-face preview element to see its section / face / effective value + source note via title, with the preview-label info line updating to "section > face — value" on mouseover; click an on-pane element to scroll + flash its assignment row; off-pane elements stay hover-only (default cursor). Pure helpers in app-core.js (Node-tested, test-locate.mjs), the stateful previewSpan adapter + cached registry + unified click dispatch in previews.js / app.js, all browser-gated. Verified end to end: run-tests.sh fully green — 262 Node tests, 48 browser gates, ERT + Python + spliced-script parse. Nothing committed yet. Implementation boundary recorded: previewSpan powers the package previews + cross-surface spans; the UI mock keeps its bespoke rendering (its own flashUi locate predates this), now routed through the same locateClick dispatcher (Phase 5). The org-agenda / completion previews become the organic showcase later. [[id:fbcf0e20-1328-42b4-aa36-3401509e7816][theme-studio-preview-locate-spec.org]] -**** 2026-06-23 Tue @ 13:20:39 -0400 Phase 0 — pure-helper extraction landed -Added the five pure locate helpers to app-core.js — buildLocateRegistry(apps,pkgmap,uimap,map), locateFaceMeta(owner,face,registry), formatLocateTitle(meta), previewFaceAttrs(owner,face,registry), isLocateOnPane(owner,currentApp) — all state passed in, returning data not HTML. Owner-qualified registry key (owner+face), effective fg/bg matching the rendered pixels (package inherit via the face's :inherit, UI inherit via UI_INHERIT), per-attribute source notes (direct / inherited-from-X / default / cleared). New test-locate.mjs: 15 pure-Node tests covering the owner-qualified collision, the source-note states, previewFaceAttrs validation, rebuild-after-edit, and the linear/ms perf budget. Verified: run-tests.sh fully green — generate.py inline + 260 Node tests + spliced-script parse + all browser gates + Python/ERT. -**** 2026-06-23 Tue @ 13:51:37 -0400 Phase 1 — face registry wired -LOCATE_REG: one cached module-level registry built by buildLocateRegistry(APPS,PKGMAP,UIMAP,MAP), rebuilt (rebuildLocateRegistry) at the top of the two preview renderers (buildPkgPreview, buildMockFrame) — the chokepoints every assignment / import / reset / view-switch funnels through before spans render, so it never goes stale and never rebuilds per hover/span. Built lazily, not at declaration, to dodge the inlined UI_INHERIT const's TDZ. locate-onpane recomputed at render via isLocateOnPane. Gate #locatetest: registry presence, owner-qualified keys, rebuild-after-edit. run-tests.sh green. -**** 2026-06-23 Tue @ 13:51:37 -0400 Phase 2a — previewSpan adapter + os delegation -previews.js: previewSpan(owner,face,text) reads the live globals, dispatches by surface, emits data-owner-app + data-face + the locate-onpane class (on-pane only), and os delegates to it. Text stays trusted preview HTML (callers pre-escape entities) — previewSpan does NOT re-escape it, preserving the old os() contract and avoiding double-escaping <. Gate #locatetest extended; all existing package-preview gates (mdtest/mupreviewtest/gnustest/previewlinktest/mocktest/autodimtest) still pass unchanged. -**** 2026-06-23 Tue @ 13:51:37 -0400 Phase 2b — owner-aware assertPreviewFaces -Rewrote the gate validator to resolve each element's owner from data-owner-app (defaulting to the preview's app for bare spans), validating package faces against APPS[owner].faces and @ui against UIMAP keys. Accepts intentional off-pane + @ui spans, rejects a bad owner. Existing same-app preview gates still pass. -**** 2026-06-23 Tue @ 13:51:37 -0400 Phase 2c — @ui rendering in previewSpan -Added ulocateCss(face) (effFg(resolveUiAttr) over UIMAP, matching the registry's effective value) as the @ui branch of previewSpan. Gate: a @ui face (minibuffer-prompt) renders its real color off a package preview and is off-pane. -**** 2026-06-23 Tue @ 13:51:37 -0400 Phase 2d — gate-only showcase fixture -#showcasetest: a synthetic host package-preview context with one package-owned off-pane span + one @ui (minibuffer-prompt) off-pane span — each renders in its owner's real color, is hover-only (no locate-onpane), and passes the owner-aware validator. No user-facing preview change. -**** 2026-06-23 Tue @ 13:51:37 -0400 Phase 3 — hover title + info line -previewSpan now carries the full locate title (formatLocateTitle, attribute-escaped) on every element; buildPkgPreview wires mouseover → the pkgprevlabel info line shows locateInfoLine "section > face — value" (title is the deterministic fallback), restored on mouseleave. New pure locateInfoLine in app-core.js (+2 Node tests). Gate #locatehovertest: exact title string, direct/cleared notes, the info line update + restore. -**** 2026-06-23 Tue @ 13:51:37 -0400 Phase 4 — click flash + cursor split -Added .locate-onpane{cursor:pointer} to styles.css (off-pane keeps the default cursor). Click routes through the unified locateClick dispatcher: on-pane flashes its assignment row (flashRow, no persistent selection), off-pane / unassigned inert. Gate #locateclicktest: on-pane flash, off-pane unflashed, the cursor/class split. -**** 2026-06-23 Tue @ 13:51:37 -0400 Phase 5 — locate-dispatch cleanup -One locateClick(e, defaultOwner) replaces both the buildPkgPreview and buildMockFrame face-click branches — owner from data-owner-app or the surface default, on-pane-only for owner-tagged spans, bare spans (generic / auto-dim / UI mock) stay clickable. The data-k syntax path stays separate. #mocktest still green (mock click unchanged); #locateclicktest covers the unified path on both surfaces. - -*** TODO [#D] theme-studio preview locate: reveal off-pane element in owning pane :feature:theme-studio: -vNext from the preview-locate spec: add a "reveal in pane" affordance for off-pane preview elements (switch to the owning pane and scroll to the row) if the hover-only model proves too manual. V1 deliberately keeps off-pane elements non-clickable. [[id:fbcf0e20-1328-42b4-aa36-3401509e7816][theme-studio-preview-locate-spec.org]] -*** TODO [#D] theme-studio preview locate: syntax/code tier into unified registry :feature:theme-studio: -vNext from the preview-locate spec: fold the data-k syntax/code tier into the locate registry. V1 leaves it on its existing cp.onclick -> flashAssign path. [[id:fbcf0e20-1328-42b4-aa36-3401509e7816][theme-studio-preview-locate-spec.org]] -*** TODO [#D] theme-studio preview locate: keyboard-focus info strip :feature:theme-studio: -vNext from the preview-locate spec: make preview spans focusable and drive a hover/focus info strip for keyboard-only wayfinding. V1 wayfinding is pointer-driven (recorded accessibility caveat). [[id:fbcf0e20-1328-42b4-aa36-3401509e7816][theme-studio-preview-locate-spec.org]] -*** 2026-06-24 Wed @ 22:30:00 -0400 converter :inherit on UI faces — verified already correct, not reproducible -The reported bug (build-theme.el's UI tier dropping :inherit for inherit-only UI faces) does not reproduce in the current code. uiFaceBlank carries an inherit field, exportObj dumps the full UIMAP (inherit included), and build-theme/--attrs reads it. Direct test: a theme.json with ui face {inherit: mode-line, fg: null, bg: null} fed to build-theme/--ui-face-specs emits ((mode-line-inactive ((t (:inherit mode-line))))) — the :inherit survives. Closed as already-fixed / stale. -*** TODO [#D] theme-studio CIEDE2000 DeltaE option :feature:studio: -Deferred from the perceptual color metrics spec (vNext). v1 uses DeltaE-OK on its native scale with a 0.02 threshold (decided); revisit CIEDE2000 only if the native OKLab scale proves too unfamiliar or poorly calibrated for palette distinguishability. Spec: [[id:15db8ae3-fc14-49f3-9ed5-d5ff59790904][spec]] (vNext candidates; review folded in 2026-06-08). -*** TODO [#D] theme-studio low-contrast preset/mask mode :feature:studio: -Deferred from the perceptual color metrics spec (vNext). After raw OKLCH/APCA/DeltaE readouts exist, decide whether to add a named low-contrast workflow: APCA Lc bands, a contrast ceiling/floor mask, or a "soft" sibling to the existing any/AA+/AAA picker mask. Spec: [[id:15db8ae3-fc14-49f3-9ed5-d5ff59790904][spec]] (vNext candidates; review folded in 2026-06-08). -*** TODO [#D] theme-studio per-tier reseed controls :feature:studio: -Deferred from the seeding-engine spec (vNext). V1 reseeds all three guide-owned tiers at once; later consider separate "reseed syntax", "reseed UI", and "reseed package/org" controls if all-at-once proves too blunt. Spec: [[id:b70b37f2-37df-4c8e-ac2f-1f20d12e33dd][spec]] (vNext; review folded in 2026-06-08). -*** TODO [#D] org-faces: dim variants and retire dupre-org-* :feature:theme-studio: -vNext from the org-faces spec: org-faces-*-dim variants wired into auto-dim so keywords stay legible in unfocused windows, and migrate or retire the legacy dupre-org-* set. [[id:35578114-8c29-43af-97a2-fdfea01a802e][org-faces-spec-implemented.org]] -*** TODO [#D] Face diagnostic popup — theme-studio bridge (vNext) :feature: -vNext for the face/font diagnostic tool: interactivity — "send this face to theme-studio", jump-to-theme-spec, any write path. Deferred per [[id:98f065cf-8bd5-46a0-ac24-da94d66855ad][the spec]]'s scope tiers. -*** 2026-06-16 Tue @ 05:10:55 -0500 Alphabetized the assignment-view package dropdown -The package-faces optgroup (below the @code/@ui editor entries) now lists apps alphabetically by display label. Root cause: =buildViewSel= iterated =for(const app in APPS)=, and =generate.py= builds APPS as bespoke apps first then inventory apps, so the combined list wasn't alphabetical. Fix is localized to the view-list build per the plan: added a pure =appViewKeysSorted(apps)= helper in =app-core.js= (sorts keys by label, case-insensitive, key fallback when a label is missing) and =buildViewSel= iterates it. TDD: 4 node tests in =test-app-core.mjs= (red->green); updated the #viewtest browser gate from asserting insertion order to asserting =appViewKeysSorted(APPS)=; full theme-studio suite green (Python + Node + all browser gates). Commit =afd2ddad=, pushed. Visual sign-off optional (gate already confirms the DOM order). -*** 2026-06-16 Tue @ 06:11:30 -0500 Contrast cell: dropped PASS/FAIL, verdict moved to the hover -Craig's call (option a + hover): the contrast cell now shows just the rating-colored number (green = passes AAA, grey = passes AA, red = fails AA), and the WCAG meaning lives in a hover. Added a pure =contrastTitle(r)= to =app-util.js= (4 node tests), changed =crHtml= (app.js) to drop the verdict word and set =title=, kept =verdictFor= for the covered-overlay worst-case readout (untouched, #contrasttest still green). New #crtest browser gate; full theme-studio suite green. Commit =9e99749d=, pushed. -** CANCELLED [#B] first f12 doesn't toggle the term window :bug:solo: -CLOSED: [2026-06-25 Thu] -Couldn't reproduce — neither could Craig (2026-06-25). The toggle code is clean (a single create-new -> ghostel on the first press, no second toggle), and the symptom pointed to an intermittent first-launch race, but with nobody able to reproduce it there's nothing to instrument. Cancelled; reopen with a live capture if it recurs. -** DONE [#B] F12 pops EAT instead of ghostel :feature:studio: -CLOSED: [2026-06-25 Thu] -Done 2026-06-25, design doc =docs/design/eat-f12-toggle.org=. Part A (commit fe7aa658): F12 toggles a single EAT terminal instead of ghostel, reusing the dock-and-remember geometry toggle; ghostel stays for ai-term (M-SPC); EAT runs a plain shell with no tmux; F12 and C-; are bound in EAT's keymaps so they reach Emacs from inside the terminal. Part B (commit 687b438f): EAT's faces are exposed in theme-studio (16 named palette + attribute + prompt-annotation faces) with a =renderEatPreview=, no colors set so it stays vanilla. term 223/223, ai-term 158/158, studio gates green; the toggle wiring (F12 reaches Emacs in EAT, =(eat)= creates the buffer, the predicate recognizes it) was verified live in the daemon. Accepted tradeoff: EAT needs a buffer reload to pick up a theme switch (ghostel auto-resyncs), taken for EAT's pure-elisp face control. The visual F12 dock/toggle check is a VERIFY under Manual testing and validation. -** TODO [#C] ai-term.el commentary names a stale F9 keybinding scheme :quick: -The header commentary (lines ~43-64) still documents an old =F9= / =C-F9= / =s-F9= / =M-F9= scheme for =cj/ai-term= and its family, but those bindings no longer exist — F9 is unbound in the daemon and the only live global binding is =M-SPC= -> =cj/ai-term-next= (=ai-term.el:1059=). The =M-<f9>= mention in the =cj/ai-term-shutdown= docstring (~996) is stale too. Rewrite the commentary and any stale docstrings to match the current keymap. Found 2026-06-25 while scoping the F12 -> EAT work. - -** TODO [#B] org-capture popup leaks f12 / f10 / f11 / ai-term keys :bug: -While the org-capture popup is open, the global F-keys (the =f12= term, =f10= / =f11=, the ai-term family) still fire and pop a terminal over the capture. Disable those keys for the duration of the capture popup if there's a clean way. Research first and report; if it's too invasive, defer or cancel rather than force it. From the roam inbox 2026-06-24. -** TODO [#B] theme-studio: package coverage for pearl, wttrin, chime :feature:studio: -Three projects shipped themeable faces and asked theme-studio to render accurate previews. Data lives in the PROCESSED handoff files. -*** TODO pearl — 6 faces + overlay-driven appearance -Six faces in the =pearl= customize group plus overlay-driven appearance a raw buffer read won't show. =inbox/PROCESSED-2026-06-23-2239-from-pearl-theme-studio-pearl-spec.org= + cover + =sample-pearl-buffer.org=. -*** TODO emacs-wttrin — 4 new faces -Was hardcoded "gray60"; now four customizable faces (branch =feature/themeable-faces=). =inbox/PROCESSED-2026-06-23-2253-from-emacs-wttrin-wttrin-faces-handoff.org= + rendered sample. -*** TODO chime — 4 themeable modeline faces -Four modeline faces shipped (081d76e). =inbox/PROCESSED-2026-06-23-2326-from-chime-chime-added-four-themeable-modeline.org=. -** TODO [#B] VAMP — extract music-config into a standalone player :feature:refactor: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-21 -:END: -Build VAMP ("VAMP Audio Music Player"), a standalone, publishable Emacs music player at =~/code/vamp= — derived from a maintained subset of EMMS, depending on the EMMS package not at all, with MPV and mpd behind a generalized adapter API. =.emacs.d= keeps thin glue (=vamp-config.el=: keybindings, paths, dashboard); archsetup owns OS wiring (Super+/ launcher, m3u MIME). Models the =linear-config= → =pearl= migration. - -Brainstorm complete 2026-06-22 — validated design at [[file:docs/design/vamp-music-player.org][docs/design/vamp-music-player.org]]. It builds on the prior EMMS-removal work ([[file:docs/specs/music-config-without-emms-spec.org][spec]] + [[file:docs/design/music-config-without-emms-review.org][2026-05-15 review]]), confirming its B1/B2/B4/S3 decisions and pivoting four things (publishable-now, two adapters + generalized API, VAMP name, desktop integration). - -Next: (1) revise the spec to the new direction; (2) spike the risky assumptions (mpd dumb-single-file-player contract; m3u =.desktop= on Hyprland); (3) =/start-work= against the revised spec — pure-helper extraction (review Migration Plan step 1) is the safe first phase. Priority [#C] is a placeholder pending Craig's call. - -** PROJECT [#B] Architecture review follow-up from 2026-05-03 :refactor: - -High-level pass over =init.el=, =early-init.el=, and all 104 files in -=modules/=. The main theme: the config works, but load order, startup side -effects, credentials, and test measurement are more implicit than they should -be. Use this project as the parent tracker; each child below should land as a -small, reviewable change. - -Review snapshot: -- =modules/= has 104 files and about 24k lines including =init.el= and - =early-init.el=. -- =init.el= eagerly =require=s nearly every module. -- =make coverage= passed when allowed to write the test scratch directory. -- Coverage report: =3240/4952= executable lines, =65.43%=, across 49 module - files. Caveat: 55 module files do not appear in the report at all, so the - real project confidence is lower than the raw percentage suggests. - -*** 2026-05-15 Fri Consolidate shared utility helpers :refactor: -CLOSED: [2026-05-15 Fri] - -Helpers are scattered across feature modules where they were first needed. -Some are duplicated, and some private helpers are generic enough to belong in a -shared foundation library. This is adjacent to the load-graph refactor because -central helper ownership reduces hidden inter-module dependencies, but it -should remain a sibling project so load-order batches stay small and -reviewable. - -Guidance: -- Do not extract a helper until at least two callers are clearly the same - shape. -- Prefer growing =system-lib.el= first; split into topic libraries only if it - becomes too broad or starts pulling coarse dependencies into foundation - startup. -- Keep one helper extraction per commit. -- Move unit tests with the helper. Consumers should keep behavior/integration - coverage. -- Do not add heavy package dependencies to foundation helpers. - -**** DONE [#B] Write full utility consolidation design spec :refactor: -CLOSED: [2026-05-04 Mon] - -Create a design document that inventories candidate helper extractions, -recommends grouping and naming, explains how the helpers fit into existing -library modules, defines migration phases, and identifies testing/rollback -rules. - -Spec: [[id:fc2e3926-b4a1-4b45-92eb-20841e13f655][docs/specs/utility-consolidation-spec-doing.org]] - -Verify 2026-05-04: -- Added [[id:fc2e3926-b4a1-4b45-92eb-20841e13f655][docs/specs/utility-consolidation-spec-doing.org]]. -- Spec includes framing questions, existing library fit, proposed grouping, - concrete pull/rename table, migration phases, test strategy, acceptance - criteria, risks, open questions, and recommended first commits. -- Parsed the spec and =todo.org= with =org-element=. -- Committed the tracked spec as =3ea4707=. -- Incorporated complete review feedback in =dd77ebd=, including API behavior - contracts, speculative-extraction rules, =system-lib= dependency budget, - inventory/audit artifacts, test relocation policy, commit type guidance, - =use-package :if= load-order policy, and Phase 5 cache-design addendum - requirement. - -**** DONE [#B] Inventory private helpers across modules :refactor: -CLOSED: [2026-05-10 Sun] - -Walk every module and tag private helpers as genuinely module-specific, -generic-but-trapped, or duplicated. Capture likely consumers and any dependency -cost before extracting. - -Candidate families: -- shell argument formatting, -- executable lookup with user-visible warnings, -- argv-based process runners, -- path containment/safe-base predicates, -- Org-safe heading/property/body text sanitizers, -- cache-with-TTL plus invalidation hooks, -- warning/message wrappers. - -Verify 2026-05-10: -- Added [[file:docs/design/utility-inventory.org][docs/design/utility-inventory.org]] covering the 30 entries in the spec's - Candidate Extraction Table grouped by family (executable discovery, shell - quoting, process runner, file/path, external-open, Org-safe text, cache, - logging, macros/debug, theme I/O, string). -- For each helper recorded: visibility, dependencies, side effects, callers - (production + test), test files, priority, decision (Migrate / Leave / Defer) - with rationale. -- Decisions Summary: 11 Migrate, 3 Leave, 13 Defer. -- Concrete next-action list groups Migrate items by Phase (2 = foundation - helpers, 3 = Org-safe text, 4 = external-open consolidation) for the order - the spec recommends. -- Discoveries: =cj/log-silently= has 10 production callers (more than the - spec's table suggested -- defer is the right call); =cj/--file-manager-program-for= - shipped today in =dirvish-config.el= is the new form of OS-dispatch - consolidation and should fold into =cj/external-open-command= during Phase 4. - -**** DONE [#B] Extract executable lookup with warning helper :refactor: -CLOSED: [2026-05-10 Sun] - -Create a generic helper such as =cj/find-executable-or-warn= from the useful -=mail-config= pattern. It should return the executable path or nil and produce -a clear warning when the executable is missing. - -Done 2026-05-10: -- Shipped as =cj/executable-find-or-warn= in =modules/system-lib.el= - (commit =c75e36f4=, extracted from =mail-config=). -- First consumer rewired in =12c2cb14= (=cj/set-wallpaper= in - =dirvish-config.el=). - -**** DONE [#B] Extract argv-based process runner helper :refactor: -CLOSED: [2026-05-10 Sun] - -Generalize the =coverage-core= process pattern into a dependency-light helper -that captures output and signals a clear =user-error= with command/status/output -on failure. Consider a small git wrapper only after the generic runner exists. - -Done 2026-05-10: -- Shipped =cj/process-output-or-error= plus the =cj/git-output-or-error= - wrapper in =modules/system-lib.el= (commit =57e558ce=, extracted from - =coverage-core=). - -**** DONE [#B] Extract Org-safe text sanitizers :refactor: -CLOSED: [2026-05-10 Sun] - -Move heading/property/body sanitization into a shared helper once at least one -non-calendar consumer is ready. Keep behavior explicit so external text cannot -accidentally create headings or malformed properties. - -Done 2026-05-10: -- Shipped =modules/cj-org-text-lib.el= (renamed to its final =-lib= form in - commit =0f9e3087=) with three sanitizers: =cj/org-sanitize-body-text=, - =cj/org-sanitize-property-value=, =cj/org-sanitize-heading=. - -*** 2026-05-15 Fri Make coverage reporting account for untracked modules :test: -CLOSED: [2026-05-15 Fri] - -The current coverage result is useful but easy to overread. =make coverage= -reported =65.43%= for files that undercover saw, but only 49 of 104 module -files appeared in =.coverage/simplecov.json=. - -Definition: in this task, "untracked modules" means repository-owned -=modules/*.el= files that should be part of the Emacs configuration coverage -universe but have no entry in =.coverage/simplecov.json= after =make coverage= -runs. These files may be missing because no test required them, because loading -was skipped due to package/environment guards, or because instrumentation did -not see them. They are distinct from tracked modules with 0% covered lines, -which already appear in SimpleCov and can be scored directly. - -Completed 2026-05-15: -- Both child tasks are done. -- =make coverage-summary= reports missing modules explicitly and also reports a - separate project-module score where missing modules count as 0%. -- Focused summary tests and byte-compilation of the summary helper passed. - -**** 2026-05-15 Fri Teach the coverage report to list modules missing from SimpleCov -CLOSED: [2026-05-15 Fri] - -Expected outcome: -- Compare =modules/*.el= against paths present in =.coverage/simplecov.json=. -- Show a separate "not in report" section. -- Do not silently fold those files into the percentage until we decide the - semantics. A visible missing-file count is enough for v1. - -Done 2026-05-15: -- =make coverage-summary= now compares direct =modules/*.el= files on disk - against the module paths present in =.coverage/simplecov.json=. -- The terminal report appends a =Not in SimpleCov report= section with a count - and the missing module paths. -- Missing modules are explicitly excluded from the displayed percentage for - now; the policy question below remains open. -- Added focused tests in =tests/test-coverage-summary.el= for missing-module - reporting and for ignoring =.elc= files and nested paths outside direct - =modules/*.el= ownership. - -**** 2026-05-15 Fri Decide whether unreported modules count as 0% coverage -CLOSED: [2026-05-15 Fri] - -This is a policy decision: -- Counting missing modules as 0% gives a more honest project-level number. -- Keeping the current number is useful for "instrumented executable lines only". - -Recommendation: display both: -- Instrumented coverage: current SimpleCov percentage. -- Project module coverage: includes unreported module files as 0% or reports - them separately with an explicit caveat. - -Decision 2026-05-15: -- Keep the existing SimpleCov percentage as the line-weighted - =instrumented coverage= number. It only covers modules that SimpleCov saw and - has real executable-line denominators for. -- Also display a separate module-weighted =project module coverage= score over - all direct =modules/*.el= files. Modules present in SimpleCov contribute their - per-file coverage percentage; modules absent from SimpleCov count as 0%. -- Do not pretend missing modules have known executable-line counts. Counting - them as 0% at the module level is honest about risk without inventing a line - denominator. - -Done 2026-05-15: -- =make coverage-summary= now prints both the existing line-weighted summary - and a separate =Project module coverage= line that includes missing modules - as 0%. -- The missing-module section now states that missing modules count as 0% in the - project-module score. -- Updated =tests/test-coverage-summary.el= to assert the policy and the - displayed project-module percentage. - -*** 2026-05-15 Fri Add a lightweight architecture smoke test for startup contracts :test: -CLOSED: [2026-05-15 Fri] - -After the above refactors start, add one or two smoke tests that protect the -architecture instead of individual functions. - -Candidate checks: -- All modules can be loaded directly with only =modules/= on =load-path=, or - skipped with a clear external package reason. -- No module other than =keybindings.el= binds =C-;= itself. -- Startup-only modules do not run timers in batch test mode. - -Keep this small. The goal is to catch accidental return to hidden load-order -coupling, not to build a full static analyzer. - -Done 2026-05-15: -- Added =tests/test-architecture-startup-contracts.el= with two source-level - smoke checks: - - only =keybindings.el= may globally own the exact =C-;= prefix; - - top-level timer scheduling forms must be guarded by =noninteractive= so - batch/test loads do not schedule startup timers. -- Gated existing startup timers in =org-agenda-config.el=, - =org-refile-config.el=, =quick-video-capture.el=, and =wrap-up.el=. -- Focused tests passed for the new architecture smoke file and the affected - agenda/refile helpers. - -*** TODO [#A] Un tangle the eager =init.el= load graph :refactor: - -=init.el= currently functions as the dependency graph by eagerly requiring -almost every module in a fixed order. That makes modules harder to test in -isolation and hides real dependencies behind "loaded earlier in init.el" -assumptions. - -Spec: [[id:e1fd137e-e164-42f4-a658-f4d32fbe3228][docs/specs/init-load-graph-spec-doing.org]] - -**** 2026-05-25 Mon @ 07:59:20 -0500 Wrote full design spec for the =init.el= load-graph refactor :refactor: - -Create a design document that defines the target architecture, module -categories, migration phases, test strategy, acceptance criteria, and risk -controls for untangling the eager =init.el= load graph. - -Review incorporation: -- Treat helper consolidation as adjacent architecture work, not a direct - acceptance criterion for the load-graph refactor. -- Mention utility extraction guardrails in the spec so Phase 2 dependency work - has a clear rule for duplicated helpers found along the way. - -Verify 2026-05-04: -- Added [[id:e1fd137e-e164-42f4-a658-f4d32fbe3228][docs/specs/init-load-graph-spec-doing.org]]. -- Incorporated review feedback by making utility consolidation an explicit - sibling project with guardrails and candidate helper families. -- Parsed the spec and =todo.org= with =org-element=. -- Committed the tracked spec as =0528475=. - -**** 2026-05-24 Sun @ 17:07:03 -0500 Classified modules by role and startup requirement -Built [[file:docs/design/module-inventory.org][docs/design/module-inventory.org]] across 9 batches: 101 of 102 init.el-required modules annotated with the load-graph header contract (Layer, Category, Load shape, Eager reason, Top-level side effects, Runtime requires, Direct test load) and tabulated in the inventory. Added =tests/test-init-module-headers.el= to enforce the contract on each classified module. Retired the three vague =init.el= comments (latex-config WIP, prog-shell "combine elsewhere", "Modules In Test" banner) into real tasks. Recorded seven hidden =cj/custom-keymap= / cross-module dependencies for the Phase 2 dependency pass. Tagged the span =load-graph-classify-start..load-graph-classify-end=. elfeed-config is the one module left, pulled to its own task below. - -**** 2026-05-25 Mon @ 08:35:33 -0500 Annotated elfeed-config load-graph header -Added the load-graph header to elfeed-config (Layer 4, O/D/P, current load shape eager with an eager reason, target command-loaded; runtime requires user-constants, system-lib, media-utils), added it to the header-contract allowlist in =tests/test-init-module-headers.el= (Batch 8), and moved it in =docs/design/module-inventory.org= from the Deferred/Pending sections into the Batch 8 table. Inventory now 102 of 102 classified. The header's "Load shape" records the current shape (eager, required in init.el) per the weather-config/games-config convention; "command-loaded" is the target, in the inventory's Target column. Shipped as a522e553. - -**** 2026-05-24 Sun @ 18:35:06 -0500 Made hidden module dependencies explicit -Fixed the seven hidden dependencies the classification surfaced: system-defaults now requires host-environment and user-constants at runtime (was eval-when-compile); custom-buffer-file, dev-fkeys, calendar-sync, and video-audio-recording require keybindings and drop their =(when (boundp 'cj/custom-keymap) ...)= shims; flycheck-config and mail-config require keybindings for their cj/custom-keymap bindings. Removed a dead =eval-when-compile (defvar cj/custom-keymap)= in transcription-config (the var was never used). - -No init.el load-order change — keybindings and the foundation modules already load before these, so the explicit requires are no-ops at startup and only fix standalone/test loading. - -Verified each fix with a fresh =emacs --batch (require 'X)=, then swept all ~100 modules standalone: every one loads or fails only with a clear missing-package message (the spec's Phase 2 exit bar). Full =make test=, =make validate-modules=, and an init smoke all pass. Module headers and the inventory's hidden-dependency section updated to mark the seven resolved. - -**** DOING [#A] Defer feature modules behind autoloads, hooks, and commands :refactor: - -Once dependencies are explicit, reduce the number of modules required at -startup. Start with lower-risk feature modules: -- Entertainment and optional integrations: =games-config=, =music-config=, - =weather-config=, =slack-config=, =erc-config=. -- Heavy document/media modules: =pdf-config=, =calibredb-epub-config=, - =video-audio-recording=, =transcription-config=. -- AI/rest tooling: =ai-config=, =restclient-config=, =ai-conversations=. - -Do this incrementally. After each batch: -- Restart Emacs interactively. -- Run =make test= or at least targeted tests. -- Check that keybindings still resolve and which-key labels still appear. - -***** 2026-06-21 Sun @ 01:53:55 -0400 Deferred games-config (batch 1, module 1) -Replaced =(require 'games-config)= in init.el with explicit autoloads for =malyon= and =2048-game= → games-config; the module now loads on first game-command use instead of at startup. games-config.el: =:defer 1= → =:defer t :commands=, header Load shape eager→command. package.el already autoloads both commands, so routing through games-config only preserves the one setting it owns (=malyon-stories-directory=), applied via use-package =:config= when malyon loads. Verified the autoload→module→package→config chain in batch. Test: =tests/test-init-defer-games.el= (commands resolve with the module unloaded; config applies on load). Inventory row eager→command; header-contract 4/4 (still allowlisted), full =make test= green. Shipped as 03d8b587. Daemon keeps it loaded until restart — interactive restart smoke pending (see Manual testing). - -**** 2026-05-24 Sun @ 19:59:01 -0500 Centralized custom keymap registration -Added cj/register-prefix-map and cj/register-command to keybindings.el (commit 47f222f6) with test-init-keymap-registration.el, then migrated all 31 cj/custom-keymap registration sites across 24 modules onto the API. Consumers no longer reference cj/custom-keymap directly — keybindings.el is the sole owner of the prefix, and modules require keybindings to reach the API. - -Verified behavior-preserving by dumping every C-; binding before and after: identical, 279 bindings, each resolving to the same command. Byte-compiled all 24 migrated files (no new free-variable warnings — the cj/custom-keymap coupling is gone), and full make test, validate-modules, and an init load all pass. which-key label blocks were left intact; they use string key descriptions and never assumed cj/custom-keymap existed. - -Related existing task: [#B] "Review and rebind M-S- keybindings". - -*** TODO [#A] Move package bootstrap out of =early-init.el= where possible :refactor: - -=early-init.el= currently handles package archives, package refresh, installing -=use-package=, and =use-package-always-ensure=. That is more than early startup -needs and can make startup network-sensitive. - -**** TODO [#A] Split early startup from package bootstrap :refactor: - -Keep =early-init.el= focused on things that must happen before package and UI -startup: -- GC/file-name-handler startup tuning. -- =load-prefer-newer=. -- frame/UI suppression. -- minimal debug behavior. - -Move package archive setup and =use-package= installation to a normal module or -bootstrap command, unless there is a specific reason it must run in -=early-init.el=. - -Acceptance criteria: -- Fresh install/bootstrap still works from a documented command or script. -- Normal startup does not refresh archives or install packages unexpectedly. -- Offline startup remains quiet and predictable. - -**** TODO [#A] Revisit package signature policy - -=package-check-signature= is disabled. Decide whether that is still necessary -for the localrepo/mirror workflow. - -Expected outcome: -- Prefer signatures on by default. -- If signatures must be disabled for local mirrors, scope that exception and - document why. -- Add a note to the local repository docs so future package failures do not - lead to permanent insecure defaults. - -** PROJECT [#B] F-key Completion :feature: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-02 -:END: - -The L546 ticket "Rework dev F-keys" landed roughly 75% as of the 2026-05-27 audit. F4 (compile+run dispatcher, project-type detection, clean-rebuild, projectile cache revert), F7 (coverage), and the format-key migration off F6 are all shipped with ERT coverage. F6 ships Phase 2a only — "All tests" and "Current file's tests" via plain F6 and C-F6. - -Phase 2b remains: per-language test discovery, the "Run a test..." menu entry, M-F6 fast path, buffer-local last-test memory, and the spec-mandated "No tests found for <buffer>" error. The =dev-fkeys.el= header (L35–46) already sketches the tree-sitter capture-then-filter pattern needed to work around Emacs bug #79687 on the emacs-30 branch. - -Two smaller cleanups also fall out: the header comment claims TS/JS is "punted for v1" while the cmd-builder at =dev-fkeys.el:384= actually emits a vitest/jest command, and the cmd-builder is a likely home for =cj/--tests-in-buffer= once it lands. - -Open: helper home — keep =cj/--tests-in-buffer= in =dev-fkeys.el= (per L546 spec) or push it into =test-runner.el= (per the parallel "Fix up test runner" thread). Elisp "Run a test..." — drill into individual =ert-deftest= names, or keep the current regex-aggregate (=make test-name TEST=^test-<stem>-=). - -*** TODO [#B] Per-language test discovery helper :feature:test: -Build =cj/--tests-in-buffer= returning a list of test names; tree-sitter capture-then-filter for python/go/ts/js per the bug #79687 workaround in =dev-fkeys.el= L35–46; sexp scan for elisp =ert-deftest= forms. - -*** TODO [#B] F6 Run-a-test menu entry :feature:test: -Add "Run a test..." to =cj/f6-test-runner= candidates; pre-select =cj/--last-test-run=; signal =user-error= "No tests found for <buffer>" when discovery returns nil. - -*** TODO [#B] M-F6 fast path :feature:test: -Bind =M-<f6>= to a thin wrapper that calls the same "Run a test..." path directly; release the reservation comment at =dev-fkeys.el:541=. - -*** TODO [#B] Buffer-local cj/--last-test-run :feature:test: -Add the buffer-local var, set it on each "Run a test..." selection, use it as the completing-read default so a bare RET re-runs the last test. - -*** TODO [#B] TS/JS coverage status sync -Update the =dev-fkeys.el= header comment (L33) — TS/JS is no longer punted; the cmd-builder at L384 emits vitest/jest. Document the prefer-vitest fallback. - -** PROJECT [#B] Module-by-module hardening -:PROPERTIES: -:LAST_REVIEWED: 2026-06-05 -:END: - -Review every file in =modules/= and capture concrete bugs, tests, refactors, -and design improvements as child tasks. This is intentionally separate from the -top-level architecture review: the architecture project tracks cross-cutting -load/startup/test structure, while this project tracks module-specific work. - -Audit reconciliation 2026-05-27: four sessions between 2026-05-23 and -2026-05-26 drained the umbrella significantly. Roughly 24 of the original -~89 sub-task findings remain open (TODO/DOING/VERIFY) across all six tracks. -Notable shipped work since the 2026-05-22 review: user-constants -filesystem-init split, system-defaults smoke tests, env-desktop-p doc fix, -popper-config removal, UI/navigation runtime smoke coverage, mu4e -org-contacts coverage, prog-lisp smoke coverage, Org export tool guards. -The six =***= track tasks are all still DOING (track status unchanged); -the change is mass of completed sub-work, not track status. - -Re-review pass 2026-05-15: -- Each of the six existing review tracks (foundation, custom editing, UI / - navigation, Org workflow, programming workflow, integrations and - applications) was re-walked as if it had not been reviewed before. -- 32 new sub-task findings filed across the tracks above (foundation 5, - custom editing 6, UI / navigation 9, Org workflow 3, programming 6, - integrations 2). Findings already covered by an existing sub-task were - dropped during consolidation. -- A separate =Review newly added modules= task lists the 24 modules that - were either added after the parent task was written (post-2026-04) or - fell outside the original scope lists. Each is routed to its target - track; module-specific findings are filed under the relevant track. - -Review protocol for each module: -- Read the module directly, not just the test names. -- Check runtime dependencies, top-level side effects, keybindings, timers, - external executable assumptions, secrets, host-specific paths, and user-data - writes. -- Check existing test coverage and whether tests protect the highest-risk - behavior. -- Promote larger findings into child =PROJECT= tasks with phases. Keep small - fixes as plain =TODO= tasks. - -Priority scheme: use the top-level =Priority Scheme= section in this file. - -Suggested review order: -1. Foundation: =system-lib=, =user-constants=, =host-environment=, - =system-defaults=, =keybindings=, =config-utilities=, =early-init=, - =init=. -2. Custom editing utilities: =custom-*=, =external-open=, =media-utils=. -3. UI and navigation: =ui-*=, =font-config=, =modeline-config=, - =selection-framework=, =mousetrap-mode=, =popper-config=. -4. Org workflow: =org-*=, =calendar-sync=, =hugo-config=, =gloss-config=. -5. Programming workflow: =prog-*=, =dev-fkeys=, =test-runner=, - =coverage-*=, =vc-config=. -6. Integrations and applications: mail, Slack, ERC, Elfeed, EWW, Dirvish, - PDF, Calibre, music, recording/transcription, AI/rest tooling. - -*** DOING [#B] Harden foundation modules - -Scope: -- =system-lib.el= -- =user-constants.el= -- =host-environment.el= -- =system-defaults.el= -- =keybindings.el= -- =config-utilities.el= -- =early-init.el= -- =init.el= - -Expected output: -- Add one child task for each actionable finding. -- Note "no action" only when the module has been reviewed and no task is - needed. -- Cross-reference existing architecture tasks instead of duplicating them. - -Review progress: -- =system-lib.el=: reviewed 2026-05-03. No immediate action beyond the existing - [#B] system-lib extraction task. -- =host-environment.el=: reviewed 2026-05-03. See child tasks below. -- =user-constants.el=: reviewed 2026-05-03. See child tasks below. -- =system-defaults.el=: reviewed 2026-05-03. See child tasks below. -- =keybindings.el=: reviewed during architecture pass. No new module-specific - action beyond the load-order/keymap architecture tasks. -- =config-utilities.el=: reviewed 2026-05-03. No new module-specific action; - profiling extraction is already tracked by [#B] "Build debug-profiling.el - module". -- =early-init.el=: reviewed 2026-05-10. See child tasks below and the existing - [#B] "Split early startup from package bootstrap" task. -- =init.el=: reviewed 2026-05-10. See child tasks below and the existing - eager load-graph architecture tasks. - -Completion review 2026-05-15: -- Re-read the parent =Module-by-module review and hardening= context and the - adjacent architecture follow-up so this review stays module-specific. -- Re-checked all scoped files against the review protocol. Existing child - tasks below still cover the actionable module findings for - =user-constants.el=, =host-environment.el=, =system-defaults.el=, and - =early-init.el=. -- =system-lib.el=, =keybindings.el=, =config-utilities.el=, and =init.el= do - not need additional module-specific child tasks from this pass; remaining - concerns are already tracked by the utility-consolidation, keymap - registration, debug-profiling, and eager-load-graph architecture tasks. - -**** 2026-05-25 Mon @ 19:12:02 -0500 Split path constants from filesystem init in user-constants.el - -=(require 'user-constants)= used to create ~8 directories and ~10 org/calendar -files at load — the source of the stray =sync/org/= tree that appeared in the -repo during test runs. Both load-time forms are gone now; the path defconsts -stay pure, and init.el calls =cj/initialize-user-directories-and-files= on real -startup (guarded by =(unless noninteractive)=) so a bare require is -side-effect-free. Verified end-to-end: a require creates nothing, and the -interactive guard creates the backbone dirs and files. Landed in two commits on -the =refactor/user-constants-defer-fs-init= branch. - -***** 2026-05-25 Mon @ 19:12:02 -0500 Extracted pure path definitions from startup writes - -Removed the top-level calendar =dolist= and the top-level initializer call, and -folded gcal/pcal/dcal into =cj/initialize-user-directories-and-files=. init.el -now calls it right after the require, guarded by =(unless noninteractive)=. -Added =tests/test-user-constants.el= (loading creates nothing; the initializer -creates the configured paths) and updated the module header — top-level side -effects are now none and it's safe to load in tests. - -***** 2026-05-25 Mon @ 19:12:02 -0500 Made initialization failures actionable - -=cj/verify-or-create-dir=/=-file= took an optional =required= flag routed -through =cj/--report-path-failure=: required failures raise a prominent -=display-warning=, optional ones are logged. The initializer groups paths by -that split — required: the sync/org/roam dirs and the gcal/pcal/dcal stubs; -optional: the secondary dirs and content files. Chose a warning over a -=user-error= so a directory hiccup surfaces loudly without aborting init. Added -error-path tests for the optional-logs and required-warns behavior. - -**** 2026-05-23 Sat @ 03:33:30 -0500 Fixed env-desktop-p doc and normalized the X predicates -Corrected =env-desktop-p='s docstring (it described a laptop; the function returns t for the desktop/no-battery case). Switched =env-x-p= from =(string= (window-system) "x")= to =(eq (window-system) 'x)= to match =env-x11-p='s style, and documented the difference: =env-x-p= is any X display incl. XWayland, =env-x11-p= is a real X11 session with no WAYLAND_DISPLAY. Behavior unchanged, existing display-predicate tests stay green. Fixed in 14ec32b2. - -Left =cj/match-localtime-to-zoneinfo= caching alone — it was a "consider if this runs during startup" note, not an acceptance item, and it doesn't run at startup. File a separate task if it ever shows up in a profile. - -**** 2026-05-25 Mon @ 16:59:37 -0500 Added system-defaults settings smoke tests - -Added =tests/test-system-defaults.el= with three settings assertions the -existing files didn't cover: custom-file is redirected to a temp trashbin -(not the repo), backups land under =user-emacs-directory/backups=, and the -minibuffer GC hooks are wired onto the minibuffer hooks. The module's -functions were already covered by =test-system-defaults-functions.el= and the -=vc-follow-symlinks= default by its own file, so this stayed narrow to the -settings gap. Extracted the shared sandbox loader into -=tests/testutil-system-defaults.el= so both the new file and the -vc-follow-symlinks test use one copy. The backups test clears -=cj/backup-directory= first because it's a defvar that only recomputes when -unbound. - -**** TODO [#B] Move package bootstrap policy out of =early-init.el= :refactor: - -=early-init.el= currently handles performance/debug setup, package archive -construction, archive refresh policy, =use-package= installation, package -signature policy, and Unicode defaults. That makes early startup do network- and -package-manager-adjacent work before the regular module system exists. - -This overlaps with the existing [#B] "Split early startup from package -bootstrap" task; keep the implementation there if that task is already active. -This foundation review finding is the module-level acceptance detail. - -Expected outcome: -- =early-init.el= keeps only settings that must happen before normal init: - startup GC/file-handler tuning, debug flag setup, native-comp workaround, - =load-prefer-newer=, site-start suppression, and package startup suppression. -- Package archive setup, refresh/install policy, and =use-package= bootstrap - live in a normal module or bootstrap helper that can be tested directly. -- Offline and missing-package states produce actionable errors without doing an - unexpected package refresh during early startup. -- Existing local repo and ELPA mirror behavior is preserved. - -Pitfalls: -- Do not break first-run bootstrap on a clean machine. -- Keep local repositories higher priority than online archives. -- Avoid prompting or refreshing archives during batch tests. - -**** TODO [#B] Decide and test package signature policy - -=early-init.el= sets =package-check-signature= to =nil= after package setup, with -an earlier commented emergency toggle for expired signatures. That may be -intentional for local mirrors, but it is security-sensitive enough to make the -policy explicit. - -Expected outcome: -- Document when signatures should be disabled, if ever. -- Prefer signatures on for online archives unless a local-mirror workflow - requires otherwise. -- If signatures stay disabled, add a clear comment explaining the trust model. -- Add a small test or validation helper around the computed package policy if - package bootstrap is extracted. - -**** 2026-05-16 Sat @ 02:34:22 -0500 Consolidated user-home-dir into early-init as canonical - -Canonical defconst in =early-init.el= kept (the package-archive paths -need it during package bootstrap, before normal modules load). -=modules/user-constants.el= switched to a `defvar` with the identical -=(getenv "HOME")= expression and a comment explaining the pattern: -defvar is a no-op at runtime (early-init's defconst wins, defvar -doesn't reassign a bound symbol), but it lets the module load / -byte-compile standalone when early-init hasn't run. Drift risk is -mitigated by both expressions being =(getenv "HOME")= literally; the -comment flags the requirement to keep them identical. - -**** 2026-05-16 Sat @ 02:34:22 -0500 Dropped redundant autoload alongside compile-time require in system-defaults.el - -Kept the =eval-when-compile= requires for =host-environment= and -=user-constants= (they silence free-variable / free-function warnings -during byte-compile in isolation) and dropped the -=(autoload 'env-bsd-p ...)= line — both modules are loaded earlier in -init.el at runtime, and the eval-when-compile already exposes -=env-bsd-p= to the byte-compiler. Added a comment documenting the -chosen boundary. - -**** 2026-05-16 Sat @ 02:34:22 -0500 Converted cj/debug-modules and cj/use-online-repos to defcustom - -Both toggles now live as =defcustom= with explicit =:type= and -=:group 'cj=. =cj/debug-modules='s type is the natural choice form: -either =t= (all modules) or a list of module symbols. -=cj/use-online-repos='s type is boolean. Added a top-level -=(defgroup cj ...)= in early-init.el so the group exists for both, -plus the package-priority constants below it. - -**** 2026-05-25 Mon @ 18:29:40 -0500 Made the Customize-save discard non-silent - -Took the display-warning option. =cj/--warn-customize-discarded= advises -=custom-save-all= (the chokepoint both =customize-save-variable= and the -Customize "Save for Future Sessions" button funnel through) with a one-shot -=:before= warning that explains the edit won't persist and points at the Elisp -init files. The advice removes itself after firing, so it warns once per -session, and the body never runs at load, so startup stays quiet. Kept the -throwaway =custom-file= as-is. Test added in =tests/test-system-defaults.el=. - -**** 2026-05-16 Sat @ 02:34:22 -0500 Named the package archive priorities in early-init.el - -Nine =defconst= entries replace the magic numbers: -=cj/package-priority-localrepo= (200) for the project-pinned repo, -four =cj/package-priority-mirror-*= entries for the local ELPA -mirrors (125 / 120 / 115 / 100), four =cj/package-priority-online-*= -entries for the online archives (25 / 20 / 15 / 5). A header comment -above the block explains the local-first ordering and the -gnu > nongnu > melpa > melpa-stable trust ranking within each tier. - -**** 2026-05-16 Sat @ 02:34:22 -0500 Deleted dead world-clock block in chrono-tools.el - -The 19-line commented-out =use-package time= block is gone. The -=time-zones= use-package directly above it is the active replacement; -git history preserves the old config if anyone needs to dig it back up. - -**** 2026-05-16 Sat @ 02:34:22 -0500 Added coverage for cj/tmr-select-sound-file with a pre-test refactor - -The prefix-arg branch now delegates to =cj/tmr-reset-sound-to-default= -directly (single source for the reset path). Extracted a pure helper -=cj/tmr--available-sound-files= so the directory scan is testable -without driving =completing-read=. =tests/test-chrono-tools-tmr-sound.el= -covers Normal / Boundary / Error: available-sounds against a populated -dir, empty dir, missing dir; reset path; select with prefix-arg -(delegates to reset, no prompt); select normal (picks a file); select -boundary paths for empty dir, missing dir, cancel (empty completion). -9 tests, all green. - -*** DOING [#B] Harden custom editing utility modules - -Scope: -- =custom-buffer-file.el= -- =custom-case.el= -- =custom-comments.el= -- =custom-datetime.el= -- =custom-line-paragraph.el= -- =custom-misc.el= -- =custom-ordering.el= -- =custom-text-enclose.el= -- =custom-whitespace.el= -- =external-open.el= -- =media-utils.el= - -Review progress: -- Core =custom-*= text modules reviewed 2026-05-03. They have unusually strong - direct ERT coverage compared with the rest of the config. -- =external-open.el= and =media-utils.el= reviewed 2026-05-03. See child tasks. -- =custom-buffer-file.el= reviewed 2026-05-03. See child tasks. - -Completion review 2026-05-15: -- Re-checked the scoped custom editing utility modules and their test files. -- The pure editing modules remain well covered by focused ERT tests. -- Remaining actionable issues are already logged below: process-launch - hardening and coverage for =external-open.el= / =media-utils.el=, - destructive buffer/file keybinding policy, and explicit cross-module - autoload/require boundaries. - -**** TODO [#B] Harden external process launching in =external-open.el= and =media-utils.el= :refactor: - -=external-open.el= and =media-utils.el= use shell command strings for launching -external applications: -- =cj/open-this-file-with= interpolates the user-supplied command into - =call-process-shell-command=. -- =cj/media-play-it= builds a shell command for players and optional =yt-dlp= - stream extraction. - -This is mostly controlled local input, but it is still brittle: command paths -with spaces can fail, arguments are hard to reason about, and future URL/source -changes could create shell quoting bugs. - -Expected outcome: -- Prefer =start-process= / =call-process= with argv lists where possible. -- If shell is required for command substitution, isolate and quote every - untrusted value. -- Add tests around command construction for: - - file paths with spaces and shell metacharacters, - - URL strings with shell metacharacters, - - configured player args, - - missing executable errors. - -Pitfalls: -- =cj/open-this-file-with= may intentionally accept "program plus args". If so, - split the command deliberately or introduce separate program/args prompts. -- Some media players need different URL handling; preserve the existing - =:needs-stream-url= behavior. - -**** 2026-05-23 Sat @ 03:41:00 -0500 Added media-utils coverage; external-open already covered -=external-open= already had three test files (=test-external-open-commands.el=, =test-external-open-lib-command.el=, =test-external-open-lib-launcher-p.el=). =media-utils.el= had none, so I added =test-media-utils.el= (8 cases): player availability from =cj/media-players=, the play command-builder (direct vs yt-dlp -g stream wrap), and the missing-tool error paths for the player, =yt-dlp=, and =tsp=. All process/exec boundaries mocked. Added in the test-media-utils commit. - -**** TODO [#B] Audit destructive buffer/file keybindings for confirmation policy - -=cj/buffer-and-file-map= includes destructive operations under =C-; b=, -including delete file, erase buffer, clear top, clear bottom, and revert. Some -are intentionally fast, but this module is high blast radius. - -Expected outcome: -- Decide which operations need confirmation when the buffer is modified or - visiting a file. -- At minimum, document the intended policy in =custom-buffer-file.el=. -- Consider safer wrappers for =erase-buffer= and =revert-buffer= under the - personal keymap. - -**** 2026-05-24 Sun @ 14:43:13 -0500 Declared cross-module commands bound in custom keymaps - -Byte-compiling =custom-ordering.el= and =custom-text-enclose.el= standalone warned "not known to be defined" for =cj/org-sort-by-todo-and-priority= (owned by org-config) and =change-inner=/=change-outer= (the change-inner package). Both work at runtime — org-config loads eagerly, and text-config autoloads change-inner via =use-package :commands= — so only the compiler needed telling; added =declare-function= for each (no autoload needed since the runtime autoload/eager-load already exists). =custom-buffer-file.el= byte-compiles clean already, so it needed no change. Commit =ad173a77=. - -**** 2026-05-24 Sun @ 07:26:31 -0500 Extracted shared region-or-buffer bounds helper - -The described docstring mismatch was already resolved: =custom-ordering.el='s =cj/--arrayify=/=cj/--unarrayify= now document an explicit =(start end)= contract accurately and are region-required by design. The remaining work was the enclose side, where append/prepend/indent/dedent each inlined the same region-or-buffer bounds block (four copies). Extracted =cj/--region-or-buffer-bounds= as the single source of that contract and routed all four through it (behavior unchanged; public-wrapper tests still pass). Each pair now has one clear, consistent, documented contract. New tests cover the helper (region / no-region / empty buffer). Commit =a7cc8948=. - -**** 2026-05-16 Sat @ 02:47:15 -0500 Preserved trailing newlines in custom-ordering output - -Both =cj/--arrayify= and =cj/--unarrayify= now detect a trailing -newline on the input region (via =string-suffix-p=) and re-append it -to the result. Matches the pattern =custom-text-enclose.el= already -uses. Docstrings updated to document the contract. - -**** 2026-05-16 Sat @ 02:47:15 -0500 Guarded cj/duplicate-line-or-region against modes without comment syntax - -=cj/duplicate-line-or-region= now signals a clear =user-error= when -=COMMENT= is non-nil but the current mode has no =comment-start= -(=fundamental-mode= and similar). Docstring updated to document the -error. Picks the "error out clearly" branch from the task body -- -restricting the binding per-mode would be a larger refactor that -isn't justified for the silent-malformed-output blast radius. - -**** 2026-05-16 Sat @ 02:47:15 -0500 Made external-open advice install explicit via cj/external-open-install-advice - -Factored the =advice-remove= / =advice-add= pair into -=cj/external-open-install-advice= and called it once at the bottom -of the module. Same idempotent shape (remove-then-add) but now the -intent is named. Re-running the module updates the advice rather -than stacking it; if a future caller wants to opt out, they can -=advice-remove= the helper or skip calling it altogether. - -**** 2026-05-16 Sat @ 02:47:15 -0500 Added cj/--validate-decoration-char across all six divider/border helpers - -New top-level validator =cj/--validate-decoration-char= rejects -anything that isn't a printable single-character string and signals -=user-error=. Wired into all six internal helpers: -=cj/--comment-inline-border=, =cj/--comment-simple-divider=, -=cj/--comment-padded-divider=, =cj/--comment-box=, -=cj/--comment-heavy-box=, =cj/--comment-block-banner=. The five -nil-decoration ERT tests updated from =:type 'wrong-type-argument= -(the old crash signal from =string-to-char= on nil) to -=:type 'user-error=, since the guard now produces a clear message -instead of a deep crash. - -**** 2026-05-23 Sat @ 03:38:30 -0500 Filled the remaining title-case edge gaps -=test-custom-case-title-case-region.el= already had 29 cases (empty region, unicode words, numbers, separators, colon resets, partial region). The named gaps that were missing — leading-quote and leading-paren handling, plus a caseless RTL first word — are now covered by three boundary tests (32 total). Added in 3841c59e. - -**** 2026-05-16 Sat @ 02:47:15 -0500 Extracted cj/--require-spell-checker - -Both =cj/flyspell-toggle= and =cj/flyspell-then-abbrev= now call -=cj/--require-spell-checker= instead of carrying their own copy of -the executable-find check. The checker list lives in the new -defconst =cj/--spell-checker-executables=, so adding nuspell (or any -other checker) is a one-line edit. Top-level =(require 'cl-lib)= -added since the new helper uses =cl-some=. - -**** 2026-05-23 Sat @ 03:44:50 -0500 Covered flyspell-and-abbrev testable seams -Added =test-flyspell-and-abbrev.el= (8 cases): =cj/--require-spell-checker= (PATH gate, mocked), =cj/find-previous-flyspell-overlay= against synthetic overlays (closest-previous match, non-flyspell skipped, nil when none), and =cj/flyspell-on-for-buffer-type= (prog-mode -> flyspell-prog-mode, text-mode -> flyspell-mode). Left =cj/flyspell-then-abbrev= to manual testing — pinning its flyspell-UI orchestration would mean mocking flyspell internals rather than our logic. Added in the test-flyspell-abbrev commit. - -*** 2026-06-12 Fri @ 07:14:11 -0500 Hardened UI and navigation modules - -Scope: -- =ui-config.el= -- =ui-navigation.el= -- =ui-theme.el= -- =font-config.el= -- =modeline-config.el= -- =selection-framework.el= -- =mousetrap-mode.el= -- =popper-config.el= - -Review progress: -- Reviewed 2026-05-03. -- =mousetrap-mode.el= has strong focused and integration tests. -- =modeline-config.el= has pure string-helper coverage, but not VC/runtime - segment behavior. -- =font-config.el=, =ui-theme.el=, =selection-framework.el=, =ui-navigation.el=, - and =popper-config.el= have little direct test coverage. - -Completion review 2026-05-15: -- Re-checked the scoped UI/navigation modules and current tests. -- =mousetrap-mode.el=, =ui-navigation.el=, =ui-theme.el=, - =selection-framework.el=, and selected modeline/UI helpers now have focused - tests, but the font/modeline/popper runtime policy remains under-tested. -- Existing cleanup below covers the disabled =popper-config.el= load-graph - issue; added a separate test-gap task for the remaining UI smoke coverage. - -**** 2026-05-25 Mon @ 17:05:00 -0500 Added UI/navigation runtime smoke coverage - -Added =tests/test-font-config.el= (4 tests): cj/font-installed-p returns t/nil -off find-font, and cj/apply-font-settings-to-frame is a no-op on a non-GUI -frame and applies the preset exactly once per frame (idempotent). find-font, -env-gui-p, and fontaine-set-preset are stubbed so the run stays headless, and -a skip-unless on the demanded packages keeps a bare checkout green. -font-config had zero direct coverage; this fills the gap the task named. - -modeline-config was already well covered (string-cut-middle, string-truncate-p, -vc-cache, vc-cache-key, the flycheck segment, the recording indicator), so it -needed no net-new smoke tests. popper-config's no-op smoke test is gated on the -"Decide whether popper-config.el should exist while disabled" task and was -deferred there, since whether to write it depends on that keep/remove call. - -Original scope: -- =font-config.el=: font fallback/daemon frame setup does not error when - optional fonts or emoji packages are absent. -- =modeline-config.el=: runtime segment assembly handles missing VC/project - data and does not signal in non-file buffers. -- =popper-config.el=: if the module remains in =init.el= while disabled, a - smoke test should prove requiring it is an intentional no-op. - -**** 2026-05-26 Tue @ 17:33:28 -0500 Removed popper-config.el (disabled no-op) -Deleted =modules/popper-config.el= and its =(require 'popper-config)= in =init.el= (commit 1cca84c5). It was =use-package :disabled t=, so use-package elided the whole form and it ran nothing while still sitting in the load graph. No test existed and none was needed. validate-modules passes and init loads clean. The config stays in git history if popper is ever wanted. - -***** 2026-05-26 Tue @ 15:15:43 -0500 Decided: remove popper-config.el -Craig's call: remove it (quick, solo). It has been a disabled no-op in the load graph. Remaining action: drop =(require 'popper-config)= from =init.el= and delete =modules/popper-config.el= (and any test), then close this task. - -**** 2026-05-16 Sat @ 02:55:14 -0500 Moved popper-mode activation from :init to :config - -=popper-mode +1= and =popper-echo-mode +1= now live in the -=:config= block of =modules/popper-config.el='s use-package form. -=:disabled t= now actually disables the mode (=:config= is skipped -when disabled; =:init= still runs but it only sets the reference- -buffer list and the display-buffer-alist entry, both of which are -harmless no-ops when popper itself never loads). Comment in the -module explains the split. - -**** 2026-05-16 Sat @ 02:55:14 -0500 Made cj/modeline-vc-fetch fall back when vc-git--symbolic-ref is missing - -The =require 'vc-git= now uses =nil 'noerror=, and the call to -=vc-git--symbolic-ref= is gated on =(fboundp ...)= so an Emacs -version that renames or removes the internal accessor just leaves -=branch= at =vc-working-revision='s output instead of crashing the -modeline render. Added =ignore-errors= around the call too in case -the internal accessor signals on unusual inputs. - -**** 2026-05-25 Mon @ 18:18:29 -0500 Theme-aware font label face in cj/display-available-fonts - -Replaced the hardcoded =((:foreground "Light Blue" :weight bold))= label -face in =modules/font-config.el= with =(font-lock-keyword-face (:weight -bold))= so the family header follows theme contrast instead of being -unreadable on light themes. The Regular/Bold/Italic sample lines stay as-is -(they render in each font family on purpose). - -=modules/font-config.el:266= hardcodes ="Light Blue"= and gray -foreground for font labels. Switching themes (especially light -themes) makes the labels nearly unreadable. Replace the literal -color with a face reference (=font-lock-keyword-face= or a face this -config owns) so the labels follow theme contrast. - -**** 2026-05-25 Mon @ 18:18:29 -0500 Routed emoji fontset through per-frame hook in daemon mode - -The emoji-fontset =(when (env-gui-p) (cond ...))= block in -=modules/font-config.el= ran once at load. In daemon mode =env-gui-p= is -nil at load (no GUI frame yet), so a later =emacsclient -c= frame inherited -no emoji fontset. Wrapped it in =cj/setup-emoji-fontset= (idempotent, GUI- -guarded) and, mirroring the fontaine pattern, added it to -=server-after-make-frame-hook= in daemon mode / ran it directly otherwise. -The all-the-icons install path already used the per-frame hook, so it was -left alone. Manual daemon TTY-then-GUI test added under "Manual testing and -validation" (batch can't drive it). - -**** 2026-05-25 Mon @ 18:05:56 -0500 Cached mousetrap keymaps per profile - -=mouse-trap--build-keymap= rebuilt the whole keymap on every major-mode hook. -Moved the build into =mouse-trap--build-keymap-1= and cached its result in -=mouse-trap--keymap-cache=, keyed on =(profile-name . allowed-categories)=, so -the same profile reuses the cached map and editing a profile's categories -changes the key and rebuilds. Sharing one keymap object across buffers is safe -since the map only binds disallowed events to =ignore= and is never mutated. -Added =mouse-trap--clear-keymap-cache=. Behavior is unchanged; 5 cache tests -plus the existing 66 mousetrap tests pass. Done by subagent, reviewed. - -**** 2026-05-24 Sun @ 07:26:31 -0500 Keyed VC modeline cache on resolved truename - -=cj/modeline-vc-cache-key= keyed on =(list file cj/modeline-vc-show-remote)=, so a symlink whose target moved (shared drives, CI workspaces) kept serving the old VC backend. Added =(file-truename file)= to the key — one stat per refresh, cheap next to the VC calls the cache avoids — so a re-pointed symlink produces a different key and refreshes. Tests cover truename inclusion, stability for an unchanged file, and a symlink whose target moves. Commit =9135298c=. - -**** 2026-05-24 Sun @ 04:01:02 -0500 Verified C-s already advances isearch — non-bug, no change - -The premise didn't hold on Emacs 30.2. Investigated in the live daemon: while isearch is active, =overriding-terminal-local-map= is =isearch-mode-map= and the effective =C-s= resolves to =isearch-repeat-forward=, not =cj/consult-line-or-repeat=. isearch installs its own map as an overriding map, so the global =C-s= binding can't shadow it during a search. =isearch-mode-map= already binds =C-s= to =isearch-repeat-forward= by default. Adding an explicit binding to the consult =:bind= block would only duplicate that default, so I left =selection-framework.el= unchanged. - -**** 2026-05-16 Sat @ 02:55:14 -0500 Guarded cursor-color hook behind display-graphic-p (with daemon-mode catch) - -Both the install (=add-hook= on =post-command-hook=) and the function -body now gate on =(display-graphic-p)=. Batch and TTY runs short- -circuit cleanly: no per-command overhead, no =set-cursor-color= calls -on frames that don't have a cursor color. A =server-after-make-frame-hook= -catches the daemon case where the first GUI frame is created after -=ui-config= loads -- it installs the hook lazily the first time a -GUI frame appears. - -The two cursor-color test files -(=test-ui-config--buffer-cursor-state.el=, -=test-ui-cursor-color-integration.el=) stub =display-graphic-p= to -return t so the work body still runs in batch. - -**** 2026-05-16 Sat @ 02:55:14 -0500 Deferred nerd-icons by dropping :demand t plus an after-load safety net - -=(use-package nerd-icons :demand t ...)= flipped to =:defer t=. The -=:config= block already wraps the advice + tint in lazy-on-load -semantics, so the advice now installs the first time nerd-icons -loads (typically when a feature module like =dashboard-icon-type= -or =dirvish-attributes= triggers a load). An additional -=(with-eval-after-load 'nerd-icons ...)= block at module bottom -catches the "already-loaded when this module re-evaluates" case -- -it checks =advice-member-p= so it doesn't stack the advice on every -re-eval. - -*** DOING [#B] Harden Org workflow modules - -Scope: -- =org-config.el= -- =org-agenda-config.el= -- =org-babel-config.el= -- =org-capture-config.el= -- =org-contacts-config.el= -- =org-drill-config.el= -- =org-export-config.el= -- =org-noter-config.el= -- =org-refile-config.el= -- =org-reveal-config.el= -- =org-roam-config.el= -- =org-webclipper.el= -- =calendar-sync.el= -- =hugo-config.el= -- =gloss-config.el= - -Review progress: -- Reviewed 2026-05-03 at high level. -- =calendar-sync.el= has substantial focused coverage for parsing, recurrence, - timezone conversion, event conversion, and regressions. The largest remaining - risks are configuration/secrets, startup side effects, and process/network - boundaries. -- =org-agenda-config.el= and =org-refile-config.el= now have useful cache tests, - but the cache lifecycle and startup idle timers still deserve a design pass. -- =org-noter-config.el= already has an older [#B] workflow VERIFY task. Do not - duplicate that work here. -- =hugo-config.el= and =org-reveal-config.el= have focused helper coverage. -- =gloss-config.el= is a thin package wrapper; no local unit-test target unless - custom glue is added. -- Deeper pass 2026-05-10 added follow-up tasks for org-roam done hooks, drill - file selection/package loading, Org export defaults, Babel templates, and - contact/Mu4e boundaries. - -Completion review 2026-05-15: -- Re-checked the scoped Org workflow modules and their test coverage. -- The broad parser/cache/helper areas now have useful focused tests, especially - =calendar-sync.el=, agenda/refile helpers, org-roam helpers, org-noter, Hugo, - reveal, and webclipper processing. -- Remaining issues are already logged below, including security-sensitive - calendar config and Babel evaluation policy, cache lifecycle/timer behavior, - org-roam destructive workflow guardrails, executable checks, capture-template - smoke tests, and Org workflow ownership documentation. - -**** 2026-05-23 Sat @ 04:18:44 -0500 Split personal calendar config out of calendar-sync.el -=calendar-sync.el= now defaults =calendar-sync-calendars= to nil and loads the real plists from =calendar-sync-private-config-file= (an ignored file), so the engine carries no private feed tokens in source. =calendar-sync-status= / =calendar-sync-start= report missing config without erroring, and agenda startup is unaffected (tests/test-calendar-sync-no-config-startup.el). Rotating the previously-committed feed URLs remains a manual credential action — tracked under the L2557 calendar-sync hardening finding. - -**** 2026-06-12 Fri @ 07:14:11 -0500 Normalized Org agenda/refile cache lifecycle - -All three children landed: shared cache helper extracted, idle timers gated, and directory-scan failures surfaced instead of hidden. - -***** 2026-05-23 Sat @ 04:18:44 -0500 Extracted a shared cache helper -=cj-cache-lib.el= now provides =cj/cache-valid-p=, =cj/cache-building-p=, and =cj/cache-value-or-rebuild=, consumed by both =org-agenda-config.el= and =org-refile-config.el=; the contract is documented in =docs/specs/cache-helper-design-spec-implemented.org=. The agenda and refile public commands are unchanged. - -***** 2026-05-24 Sun @ 07:26:31 -0500 Surfaced directory-scan failures instead of hiding/crashing - -The refile scan caught =permission-denied= and silently dropped the dir, and crashed outright on a missing root (only permission-denied was caught, so a missing =code-dir=/=projects-dir= raised =file-missing= and aborted the build); the agenda build had the same missing-dir crash via =directory-files=. Extracted =cj/--org-refile-scan-dir= (warns + returns nil for missing/unreadable/permission-denied so the scan continues) and guarded the agenda scan the same way. Also fixed a latent bug found here: =org-refile-targets= was never declared special, so under =make compile= =cj/org-refile-in-file= let-bound it lexically and the scoped targets never reached =org-refile= — added =(defvar org-refile-targets)=. Tests cover the helper + the agenda missing-dir guard. Commit =12fb0108=. - -***** 2026-05-23 Sat @ 04:18:44 -0500 Gated cache idle timers out of batch -Both cache builders' =run-with-idle-timer= calls are wrapped in =(unless noninteractive)= (=org-refile-config.el:105=, =org-agenda-config.el:203=), so requiring the modules in batch schedules nothing. =tests/test-architecture-startup-contracts.el= scans every module and asserts there are no unguarded top-level timer forms. - -**** 2026-05-23 Sat @ 19:48:00 -0500 Made org-confirm-babel-evaluate default to t with a toggle - -=org-babel-config.el= set =org-confirm-babel-evaluate= to nil globally, so every source block in every Org file (cloned repos, downloaded notes, web clips) ran without confirmation. Changed the default to =t= (confirm before running). Replaced the old =babel-confirm= command (which reported, and toggled only with a prefix arg) with =cj/org-babel-toggle-confirm=, a plain toggle bound to =C-; k= for flipping confirmation off in trusted files and back on. 3 ERT tests cover the toggle both directions plus the binding. - -**** TODO [#B] Rebind babel-confirm toggle off =C-; k= - -=cj/org-babel-toggle-confirm= landed on =C-; k= as a placeholder. Pick a permanent home — likely under an Org-specific prefix rather than the global =C-;= map. - -Triggered by: 2026-05-23 org-confirm-babel-evaluate hardening. - -**** 2026-05-24 Sun @ 14:43:13 -0500 Guarded move-branch-to-roam against data loss - -The command cut the subtree from the source before writing the new roam file, so any failure in demote/format/write/db-sync lost the subtree with no rollback. Reordered to write and verify the file on disk before =org-cut-subtree=, so a failed write aborts with the source intact. Added a no-clobber guard (refuse an existing target file) and a confirmation prompt for large subtrees (>= =cj/move-org-branch-confirm-lines=, 30) or buffers with unsaved changes. Decided: leave the source buffer modified and undoable rather than auto-saving, so the move stays reversible. New test drives the write-failure-preserves-source invariant via an unwritable roam dir. Commit =5c0fa15d=. - -**** 2026-05-25 Mon @ 18:29:40 -0500 Already done — clip URL/title scoped to dynamic bindings - -Found this already shipped in =6dfc41af= ("refactor(webclipper): scope clip -URL/title to dynamic bindings", 2026-05-24). The temp vars =cj/--webclip-url= / -=cj/--webclip-title= are now =let=-bound around the org-capture call instead of -=setq='d and manually cleared, so they unwind on every exit path including a -=C-g= abort — which covers the "aborted captures clear temp state" outcome more -completely than a finalize hook would. The bookmarklet/org-protocol workflow is -unchanged. =tests/test-org-webclipper-commands.el= already covers the -leaves-no-stale-state and aborted-capture-clears-state cases. No new work needed. - -**** 2026-05-25 Mon @ 17:51:17 -0500 Guarded external-tool assumptions in Org export/publishing - -Added command-time guards to four export/publishing commands so a missing tool -fails with a user-error that names it, instead of an opaque process error (or, -for reveal.js, a silently broken presentation): -- =org-export-config.el=: zathura check in my/org-pandoc-export-to-pdf-and-open. -- =hugo-config.el=: hugo binary check in cj/hugo-preview, and the platform - file-manager opener check in cj/hugo-open-blog-dir-external. -- =org-reveal-config.el=: extracted =cj/--reveal-ensure-root= (checks the local - reveal.js clone, points at scripts/setup-reveal.sh), called from - cj/reveal-export and cj/reveal-preview-start. -- =org-webclipper.el=: pandoc check in cj/org-protocol-webclip-handler, the - single path that shells out to pandoc via org-web-tools. - -All checks run at command time, not load, so startup stays quiet. Each guard -has a user-error test; existing happy-path tests now stub the lookups. Things -deliberately not guarded: hugo-publish (magit, internal), the preview filter -(browse-url, internal), hugo-export-post (ox-hugo, Elisp). Done with four -parallel implementation agents, reviewed individually; full suite green. - -**** 2026-05-16 Sat @ 03:44:45 -0500 Guarded org-roam completed-task hook with cj/--org-roam-should-copy-completed-task-p - -=org-roam-config.el= adds a global =org-after-todo-state-change-hook= that -copies newly completed tasks to today's org-roam journal. The hook assumes the -current Org buffer is visiting a file: - -- It calls =(buffer-file-name)= and passes the result to =string=. -- =cj/org-roam-copy-todo-to-today= later compares =file-truename= of the daily - file and the current buffer file. - -That can error in capture buffers, indirect buffers, temporary Org buffers, or -other fileless Org workflows. - -Expected outcome: -- Extract a predicate for "should copy this completed task to today's journal". -- Skip fileless buffers, calendar sync files, aborted capture buffers, and tasks - already in the target daily file. -- Keep the normal completed-task journal workflow unchanged. -- Add tests for fileless buffers, =gcal-file=, already-daily buffers, and a - normal project/todo buffer. - -**** 2026-05-24 Sun @ 04:30:14 -0500 Shared one validated drill-file selector - -org-capture-config.el and org-drill-config.el each scanned =drill-dir= with an inline =directory-files= call, so a missing/empty/unreadable dir surfaced as a low-level error or an empty =completing-read= depending on which command ran. Added =cj/--drill-files-or-error=, the single validated entry point: clear =user-error= when the dir is missing, unreadable, or has no drill files; otherwise the list. =cj/--drill-pick-file= and both drill capture templates route through it; the pure =cj/--drill-files-in= primitive and its tests are unchanged. Tests cover missing/empty/non-org/normal. Commit =49038c41=. - -**** 2026-05-24 Sun @ 14:43:13 -0500 Removed contradictory org-export-with-tasks default - -=org-export-config.el= set =org-export-with-tasks= twice (=("TODO")= then =nil=); the final =nil= won but the stale first line + comment contradicted it. Removed the leftover. =nil= (export no tasks) is the deliberate default — it was already winning, its comment matches, and it sits with the adjacent "without tags / section numbers by default" settings. Added a smoke test that fires the deferred =ox= :config and pins the value to =nil=. Commit =94ef5242=. - -**** 2026-05-23 Sat @ 03:48:50 -0500 Fixed java structure-template typo and pinned the aliases -=("java" . "src javas")= expanded to a bogus =#+begin_src javas=; corrected it to =src java=. Added =test-org-babel-config-structure-templates.el=, which requires the module then org-tempo (firing the deferred :config) and asserts =bash=, =zsh=, =el=, =py=, =json=, =yaml=, =java= each map to the intended src language. Fixed in the org-babel commit. - -**** TODO [#B] Make org-contacts/Mu4e boundaries explicit :refactor: - -=org-contacts-config.el= defines helpers that call Mu4e functions when the -current major mode is a Mu4e mode, and the =use-package org-contacts= block is -=:after (org mu4e)= while also requiring =mu4e= inside =:config=. This works in -the current eager setup, but the ownership boundary is unclear now that -=mu4e-org-contacts-integration.el= exists. - -Expected outcome: -- Decide whether contact capture-from-email behavior belongs in - =org-contacts-config.el= or the Mu4e integration modules. -- Add =declare-function= / autoloads or move Mu4e-specific code behind - =with-eval-after-load 'mu4e=. -- Keep plain Org contact commands usable on systems without Mu4e loaded. -- Add a smoke test for loading =org-contacts-config.el= without Mu4e stubs if - practical. - -**** TODO [#B] Add an Org workflow health check command :feature:solo: - -Several Org workflow modules depend on personal paths, optional external tools, -and local package checkouts. Failures currently show up at command time in -different ways, depending on which module hits the missing dependency first. - -Recommended improvement: -- Add a lightweight =cj/org-workflow-doctor= command that checks the main Org - workflow prerequisites without mutating user data. -- Report status for core files/directories: =org-dir=, =roam-dir=, =drill-dir=, - =contacts-file=, =webclipped-file=, =cj/hugo-content-org-dir=, and - =cj/reveal-root=. -- Report optional executable/package availability for Pandoc/org-web-tools, - Hugo, reveal.js, org-drill, org-roam, and org-noter. -- Keep startup quiet; run this only on demand. -- Make the checker return structured data so it can be unit-tested and displayed - either in Messages or a buffer. - -**** 2026-05-24 Sun @ 14:43:13 -0500 Added capture-template key + target smoke tests - -New =test-org-capture-templates-integrity.el= loads the cleanly-loadable capture modules (=org-capture-config=, =quick-video-capture=, =org-contacts-config=), applies their lazy additions, and asserts no two templates share a dispatch key and that every symbol-valued file target resolves to a non-empty path string. Literal-string targets (the video template's no-save =(file "")=) and lambda targets (drill file pickers) are excluded. Webclipper templates need org-web-tools at registration time, so they stay covered by their own test rather than this batch smoke test. Mutation-checked that the uniqueness assertion flags a duplicate key. Commit =2e3905c7=. - -**** TODO [#B] Document Org workflow module ownership and load boundaries :refactor:solo: - -The Org workflow is spread across many modules with overlapping responsibilities: -capture templates, keymaps, org-protocol handlers, refile/agenda target -construction, roam notes, publishing, and document annotation. The code is -usable, but future load-order work will be easier with explicit ownership notes. - -Recommended improvement: -- Add a short design note under =docs/design/= that maps each Org module to the - behavior it owns. -- Call out which modules may mutate global Org variables, capture templates, - keymaps, and protocol handlers. -- Define which modules should be safe to load in batch mode and which are - allowed to start timers or require interactive packages. -- Link this note from the Org workflow review task and the broader load-graph - refactor. - -**** 2026-05-16 Sat @ 03:44:45 -0500 Removed duplicate org-protocol-protocol-alist registration in cj/webclipper-ensure-initialized - -The =webclip= protocol handler is registered twice: -=modules/org-webclipper.el:72-76= inside =cj/webclipper-ensure-initialized= -(unconditional =add-to-list=) and =:207-214= inside a -=with-eval-after-load 'org-protocol= block (=unless (assoc ...)= guard). -=add-to-list= uses =equal= membership so the two are effectively -idempotent, but maintaining two registration paths invites drift if -the alist entry shape ever changes. Pick one site -- the -=with-eval-after-load= block is the more robust location -- and -remove the other. - -**** 2026-05-16 Sat @ 03:44:45 -0500 Validated :url and :title in cj/org-protocol-webclip before stashing - -=modules/org-webclipper.el:124-125= extracts =:url= and =:title= from -the incoming protocol plist with no type or nil check. An unexpected -plist shape silently sets the globals to nil, and downstream code -fails inside the capture handler with confusing messages. Guard with -=(unless (and (stringp url) (not (string-empty-p url))) (user-error ...))= -before stashing. - -**** 2026-05-24 Sun @ 07:26:31 -0500 Scoped webclip URL/title to dynamic bindings - -The protocol handler =setq= globals =cj/webclip-current-url= / =cj/webclip-current-title= that the "W" template and handler read (and cleared), so an aborted/erroring capture left stale state for the next clip. Renamed to =cj/--webclip-url= / =cj/--webclip-title= and =let=-bind them around the =org-capture= call: the template =%(identity ...)= forms and the handler run within that dynamic extent, and an abort/error unwinds the binding automatically — no stale state, no manual clear. Mirrors the quick-video-capture fix. Tests updated to the new contract (visible-during-capture, nothing-left-after, aborted-leaves-nothing). Commit =6dfc41af=. - -**** 2026-05-16 Sat @ 03:44:45 -0500 Declared cross-module free vars in mu4e-org-contacts-integration.el - -The module reads =contacts-file= (defined in =user-constants.el=) and -calls =cj/get-all-contact-emails= (defined in =org-contacts-config.el=) -without any forward declaration at the top of the file. Byte-compile -in isolation warns about both as free variables / unknown functions. -Add =(eval-when-compile (defvar contacts-file))= and -=(declare-function cj/get-all-contact-emails "org-contacts-config")= -near the existing requires so the compile is clean and the -cross-module dependency is explicit at the top of the file. - -**** 2026-05-25 Mon @ 17:10:47 -0500 Added mu4e org-contacts completion coverage - -Added =tests/test-mu4e-org-contacts-integration.el= (10 tests). The capf -(cj/org-contacts-completion-at-point) is checked for the header-field and -compose-mode gating both ways, the bounds/table it returns when contacts -exist, and the empty-contacts case. TAB (cj/mu4e-org-contacts-tab-complete) -is checked across all three branches: completion-at-point in a header, -org-cycle in the org-msg body, indent elsewhere. Comma completion and the -direct-insert no-op-outside-header path round it out. mail-abbrev-in-expansion-header-p, -the mode actions, and cj/get-all-contact-emails are stubbed, so the run is -headless with no mu4e/org-contacts dependency. - -*** DOING [#B] Harden programming workflow modules - -Scope: -- =prog-c.el= -- =prog-general.el= -- =prog-go.el= -- =prog-json.el= -- =prog-lisp.el= -- =prog-lsp.el= -- =prog-python.el= -- =prog-shell.el= -- =prog-training.el= -- =prog-webdev.el= -- =prog-yaml.el= -- =coverage-core.el= -- =coverage-elisp.el= -- =test-runner.el= -- =vc-config.el= -- =keyboard-compat.el= -- =dev-fkeys.el= - -Review progress: -- Reviewed 2026-05-03 at high level. -- =dev-fkeys.el= reviewed 2026-05-03 after local edits settled. The focused - dev-fkeys test set passed: 22 test files, 163 ERT tests. -- =coverage-core.el= / =coverage-elisp.el= have strong pure-helper tests. -- Language formatter wiring is covered for Python, Go, shell, webdev, JSON, and - YAML. -- =test-runner.el= has direct tests, but project-scoping is still a design gap. - -Completion review 2026-05-15: -- Re-checked the scoped programming workflow modules and current tests. -- =dev-fkeys.el=, coverage modules, formatter wiring, keyboard compatibility, - and test-runner helpers have meaningful focused coverage. -- Remaining issues are logged below: F4 project capability classification, - LSP ownership and smoke coverage, tree-sitter auto-install policy, Git clone - process handling, shell-script executable policy, and formatter process - boundaries. - -**** 2026-05-25 Mon @ 17:35:02 -0500 Added prog-lisp smoke coverage; assessed the other two - -Added =tests/test-prog-lisp.el= (4 tests) covering the config prog-lisp owns -directly: cj/elisp-setup and cj/common-lisp-setup are each registered on their -mode hook and apply the right buffer locals (4-space/no-tabs/fill-120 for -elisp, 2-space/fill-100 for Common Lisp). The module loads with use-package -stubbed to a no-op, so nothing installs or downloads in batch. - -=prog-training.el= got no test: it's entirely deferred use-package config with -no top-level surface, and its only owned settings (leetcode language/dir) live -in a deferred =:config= that would make the test package-dependent for no real -value. Forcing a test there would be coverage theater. - -=prog-general.el= is deferred: it's the one of the three that touches LSP and -tree-sitter, and the task itself says to wait for the LSP/tree-sitter policy -tasks to land before fixing its assertions. Its smoke coverage rides with those. - -**** TODO [#B] Revisit F4 project classification vs actual project capabilities - -=dev-fkeys.el= classifies a project as =interpreted= if it has -=pyproject.toml=, =requirements.txt=, =Pipfile=, or =package.json=, even when it -also has a =Makefile=. That intentionally keeps Python/Node projects on a -Run-only F4 menu, but it also hides useful Compile/Clean options for projects -where =Makefile=, =package.json= scripts, or Projectile cached commands provide -real build/test tasks. - -Expected outcome: -- Decide whether F4 should classify by language family or by available - capabilities. -- Consider deriving candidates from Projectile's known compile/run/test commands - first, then falling back to markers. -- Keep the current "interpreted markers win" behavior only if that remains the - intentional UX after trying it in mixed Python/Node projects. - -**** TODO [#B] Consolidate LSP ownership across programming modules :refactor: - -LSP setup is currently split across =prog-general.el=, =prog-lsp.el=, and each -language module. There are multiple =use-package lsp-mode= forms and some -conflicting defaults: -- =prog-general.el= enables snippets/UI doc/sideline behavior. -- =prog-lsp.el= disables snippets/UI doc/sideline-heavy behavior. -- Python, Go, shell, C, and webdev modules both call =lsp-deferred= from local - setup functions and add package hooks that call =lsp-deferred= again. - -This probably works because lsp-mode is defensive, but it makes the final -runtime policy hard to predict. - -***** TODO [#B] Make =prog-lsp.el= the single owner of generic LSP policy :refactor: - -Expected outcome: -- Move generic =lsp-mode= and =lsp-ui= defaults out of =prog-general.el=. -- Keep language-specific server variables in language modules. -- Keep one hook path per language for starting LSP. -- Preserve the remote-file guard. - -Pitfalls: -- =lsp-pyright= may still need a language-specific hook to load before LSP - starts. -- Do not accidentally re-enable UI/doc/sideline behavior that was explicitly - disabled for performance. - -***** 2026-06-25 Thu @ 01:53:48 -0400 Added the LSP config-resolution smoke test -=tests/test-prog-lsp.el= (5 ERT tests) pins prog-lsp's load-time invariants: =lsp-enable-remote= stays nil (no auto-start on TRAMP files), the file-watch-ignore defaults live in one idempotent helper (=cj/lsp--add-file-watch-ignored-extras=), the eldoc provider is stripped from the global hook, and no mode holds a duplicate =lsp-deferred= entry. Tests the top-level =:init= + helper surface rather than the =:config= defaults, which defer to lsp-mode's own load under =make test= (the no-package-initialize constraint). Hit and fixed the lexical-binding special-var trap on =lsp-file-watch-ignored-directories= in the test. - -**** TODO [#B] Gate tree-sitter grammar auto-install behind an explicit policy - -=prog-general.el= sets =treesit-auto-install= to =t=. That means opening a file -can trigger grammar download/build/install behavior. This is convenient on a -fresh machine, but it is a startup/network/build side effect in normal editing -and batch contexts. - -Expected outcome: -- Prefer ='prompt= or a custom command such as =cj/install-treesit-grammars=. -- Batch/test startup should never auto-install grammars. -- Document the intentional bootstrap path for a new machine. - -Originally meant to coordinate with the [#A] Python tree-sitter predicate -syntax issue. That one resolved upstream on 2026-05-14 (see =docs/python- -treesit-predicate-mismatch.txt= RESOLVED footer), so this task no longer -depends on it. - -**** 2026-05-24 Sun @ 04:30:14 -0500 Hardened clipboard git-clone process and path handling - -=cj/git-clone-clipboard-url= shelled out via =shell-command= and derived the dir with =file-name-nondirectory=, which mishandled scp-style SSH with no slash (=git@host:repo.git= → =git@host:repo=) and silently did nothing on a failed clone. Now clones as a direct =git= process (=call-process=, no shell) with =clone -- url dir= (so a =-=-leading URL can't be read as a flag); the destination comes from =cj/--git-clone-dir-name= (last component split on =/= and =:=, handling HTTPS, scp/ssh:// SSH, local paths); validates non-empty clipboard + writable target dir + non-existing destination; surfaces a non-zero git exit as a =user-error= with the =*git-clone*= output. Tests cover the deriver across schemes + empty-clipboard + clone-failure. Commit =35e4d701=. - -**** TODO [#B] Decide whether auto-executable shell scripts should be opt-in - -=prog-shell.el= adds a global =after-save-hook= that sets executable bits on any -saved file with a shebang. This is convenient, but it silently changes file -modes for every buffer in the session. - -Expected outcome: -- Decide whether this should remain global, be limited to shell/script modes, or - prompt the first time per file. -- Preserve the fast path for real scripts. -- Keep the existing =cj/make-script-executable= tests updated for the chosen - policy. - -**** 2026-05-25 Mon @ 18:05:56 -0500 Moved JSON/YAML/webdev formatters to argv process calls - -Replaced =shell-command-on-region= with =call-process-region= (explicit program -+ argv, no shell) in cj/json-format-buffer (jq), cj/yaml-format-buffer -(prettier), and cj/webdev-format-buffer (prettier). The webdev path dropped its -=shell-quote-argument= once the filename became a plain argv element. Point -preservation is unchanged. One deliberate, tested improvement: the old code -clobbered the buffer with the formatter's error text on a non-zero exit; the new -per-module =cj/--<lang>-format-region= helper captures output, checks the exit -code, replaces only on success, and otherwise raises a user-error with stderr. -Kept a small helper in each of the three modules rather than one shared one, -since they share no module short of system-lib. Added argv-invocation and -no-clobber tests per formatter; existing wiring tests stay green. Done by -subagent, reviewed. - -**** 2026-05-16 Sat @ 03:54:56 -0500 Added cj/executable-find-or-warn checks for prettier and pyright at load time - -=modules/prog-webdev.el:34-40= declares =prettier-path= and -=modules/prog-python.el:33-40= declares =pyright-path= as string -literals. No validation at module load means a missing executable -surfaces only at first use -- format-on-save fires, then errors -mid-edit, then the user has to discover why. Wrap with -=cj/executable-find-or-warn= (already in =system-lib.el=) at module -load time so the missing dependency is reported up front. - -**** 2026-05-16 Sat @ 03:54:56 -0500 Documented keyboard-compat hook idempotence (already correct) - -=modules/keyboard-compat.el:169-174= adds the frame-setup hook -unconditionally. If the module is required twice (e.g. via two -=eval-after-load= chains in different load orders), the hook runs -twice per new frame and installs duplicate =key-translation-map= -entries. Wrap the =add-hook= in a guard, or use a named function -and rely on =add-hook='s own duplicate-check. - -**** 2026-05-16 Sat @ 03:54:56 -0500 Wired F6 TypeScript clause to npx vitest|jest - -=modules/dev-fkeys.el:261-269= maps =tsx= to =typescript= in the -language detection table. =modules/dev-fkeys.el:347-349= -(=cj/--f6-test-runner-cmd-for=) has no clause for =typescript= -- -the catch-all =(_)= returns nil, so F6 errors instead of routing to -a real runner. Either add a =typescript= → =jest=/=vitest= clause -or remove the =tsx= mapping until the runner side is implemented. - -**** 2026-05-16 Sat @ 03:54:56 -0500 Fixed prog-lsp eldoc-provider removal to act on the global hook - -=modules/prog-lsp.el:51-54,76= attaches -=cj/lsp--remove-eldoc-provider= globally to =lsp-managed-mode-hook= -but the removal it performs uses =(remove-hook ... t)= -- a -buffer-local removal. The first LSP buffer activates the hook, -which removes the provider for that buffer. Subsequent LSP buffers -still inherit the global default because the hook itself never -re-fires the buffer-local removal in their context. Either make -the hook itself buffer-local-friendly (add it inside -=lsp-managed-mode-hook= per-buffer) or remove from the global -provider list once instead of per-buffer. - -**** 2026-05-16 Sat @ 03:54:56 -0500 Externalized LanguageTool script path via user-emacs-directory - -=modules/flycheck-config.el:69= hardcodes -=~/.emacs.d/scripts/languagetool-flycheck= as the LanguageTool wrapper. -Users running from a non-standard =user-emacs-directory= (or anyone -auditing the module against a future package) get a broken checker. -Replace with =(expand-file-name "scripts/languagetool-flycheck" -user-emacs-directory)= or a defcustom. - -**** 2026-05-16 Sat @ 03:54:56 -0500 Replaced hardcoded Zathura viewer with executable-find candidate list - -=modules/latex-config.el:28= sets the LaTeX viewer to =zathura= -unconditionally. macOS / Windows users and anyone who prefers a -different PDF viewer lose document review without explanation. -Resolve via =executable-find= over a candidate list (=zathura=, -=evince=, =okular=, =Preview.app= via =open=, =SumatraPDF.exe=) and -fall back to =pdf-tools=. - -**** 2026-05-15 Fri @ 18:49:24 -0500 Fixed abbrev-mode no-arg toggle in =cj/prose-helpers-on= - -Replaced the =(if (not (abbrev-mode)) (abbrev-mode))= shape with -=(unless (bound-and-true-p abbrev-mode) (abbrev-mode 1))= and the same -for =flycheck-mode= in =modules/flycheck-config.el:36-42=. Dropped -"flyspell" from the docstring (the commented-out -=cj/flyspell-on-for-buffer-type= line had been gone for a while; the -docstring was lying) and removed the stale comment marker. - -Added =tests/test-flycheck-config-prose-helpers-on.el= -- 4 tests -covering Normal (both modes off -> each enabled once with a positive -arg) and Boundary (both on -> no-op; each mixed state -> only the off -one enabled). The "both on -> no-op" assertion is the regression -guard for the no-arg toggle shape: it would record a =(nil)= call list -under the bug and a =()= call list under the fix. - -Test infra needed an explicit =(defvar abbrev-mode)= / -=(defvar flycheck-mode)= at the top of the test file: with -=lexical-binding: t= and flycheck loaded =:defer t=, =let= on the -flycheck-mode symbol creates a lexical-only binding the production -code's =bound-and-true-p= can't see; declaring both as special makes -=let= dynamic and the test stable. - -Full suite: =make test= exits 0; 468 lines of output with =ALL UNIT -TESTS PASSED= banner; no regressions. - -*** DOING [#B] Harden integrations and application modules - -Scope: -- AI/rest: =ai-config.el=, =ai-conversations.el=, =restclient-config.el= -- Mail/chat/social: =mail-config.el=, =mu4e-*.el=, =slack-config.el=, - =erc-config.el=, =elfeed-config.el=, =eww-config.el= -- File/media/apps: =dirvish-config.el=, =dwim-shell-config.el=, =pdf-config.el=, - =calibredb-epub-config.el=, =music-config.el=, =quick-video-capture.el=, - =video-audio-recording.el=, =transcription-config.el= -- Utilities/apps: =auth-config.el=, =browser-config.el=, =dashboard-config.el=, - =help-config.el=, =help-utils.el=, =jumper.el=, =keyboard-macros.el=, - =local-repository.el=, =lorem-optimum.el=, =reconcile-open-repos.el=, - =show-kill-ring.el=, =system-commands.el=, =system-utils.el=, - =tramp-config.el=, =undead-buffers.el=, =weather-config.el=, =wrap-up.el= - -Review progress: -- Reviewed 2026-05-03 at high level by direct reads plus risky-pattern search. -- Recording/transcription and music modules have much stronger coverage than - most application wrappers. -- Existing coverage audit already tracks =ai-conversations=, =quick-video-capture=, - =dashboard-config=, =mail-config=, =show-kill-ring=, =system-commands=, and - =wrap-up= as high-value test targets. - -Completion review 2026-05-15: -- Re-checked the scoped integration/application modules with risky-pattern and - test-coverage searches. -- Many integration modules now have focused tests, including AI config, - restclient, mail helpers, Slack commands, Dirvish helpers, music, - recording/transcription, system commands, browser/help/jumper/reconcile, and - undead buffer helpers. -- Remaining issues are already logged below, especially system command safety, - REST key persistence, mail privacy/lifecycle policy, quick-video timers and - temp state, shell-heavy dwim/recording command hardening, AI conversation - persistence coverage, calendar operational behavior, Dirvish dependency/path - hardening, EWW/Elfeed network helpers, and Slack which-key registration. - -**** 2026-05-24 Sun @ 04:15:36 -0500 Made Emacs restart and destructive confirms defensive - -Restart-Emacs scheduled an unconditional =kill-emacs= one second after firing the systemctl restart, so a missing or failed service killed the session with nothing to replace it. Restart now guards on =(daemonp)= and a present =emacs.service= (new =cj/system-cmd--emacs-service-available-p= via =systemctl --user cat=) before doing anything, and drops the separate =kill-emacs= — =systemctl restart= cycles the daemon itself, so a failed restart leaves the current Emacs alive. Shutdown and reboot moved to a strong =yes-or-no-p= confirm (a stray RET/space on the old quick prompt could power off the machine); logout and suspend keep the quick confirm since they are recoverable. Tests cover service detection, both restart guards, and the strong-confirm paths with system primitives stubbed. Commit =f1dbec16=. - -Not done: the detached restart+reconnect (=nohup sh -c '... && emacsclient -c'=) may still race systemd's cgroup teardown of =emacs.service= before =emacsclient -c= runs. Couldn't verify from here without cycling the live daemon — eyeball the reconnect on the next real restart. - -**** 2026-05-23 Sat @ 19:01:53 -0500 Removed SkyFi key-injection feature from restclient-config - -Resolved by removing the feature rather than hardening it. =cj/restclient-skyfi-buffer= opened =data/skyfi-api.rest= in a file-visiting buffer and rewrote the =:skyfi-key= line with the real key from authinfo, so an accidental save would persist the key to local disk (the file was gitignored and never tracked, so no repo/public-mirror exposure — local plaintext only). Deleted =cj/skyfi-api-key=, =cj/restclient--inject-skyfi-key=, =cj/restclient-skyfi-buffer=, the =C-; R s= binding, the two SkyFi test files, and the local =data/skyfi-api.rest= template. Generic restclient (=C-; R n=, =C-; R o=, restclient/restclient-jq) kept. - -**** TODO [#B] Reconcile mail image/privacy settings - -=mail-config.el= documents blocked remote images and sets -=gnus-blocked-images=, but later enables both =mu4e-show-images= and -=mu4e-view-show-images=. The interactive toggle changes =gnus-blocked-images= -buffer-locally, so the final privacy behavior is hard to reason about without -manual testing against real HTML messages. - -Expected outcome: -- Decide the default policy for embedded images versus remote HTTP images. -- Make the toggle report the effective state in the current mu4e view buffer. -- Add a short manual checklist or mocked test for the variables that control - remote image display. - -**** 2026-05-23 Sat @ 03:52:00 -0500 Set compose buffers to kill on exit, both composers -First clarified the ownership (dd671f8c): the org-msg comment "always kill buffers on exit" was backwards — org-msg set =nil= (keep), which won over mu4e's =t= because org-msg-mode runs in every compose buffer. Craig then chose to kill compose buffers on exit, so I set the org-msg value to =t= as well (82978c79). Both mu4e and org-msg now kill the buffer on send/exit, so HTML drafts don't linger. - -**** 2026-05-24 Sun @ 07:26:31 -0500 Dropped startup timers for lazy protocol init - -=quick-video-capture.el= scheduled an =after-init-hook= idle timer + a 2s fallback =run-with-timer= to call setup, which required org-protocol/capture and registered both the protocol handler and the capture template at every startup. Split the concerns like =org-webclipper.el=: the org-protocol handler registers in a =with-eval-after-load 'org-protocol= block (lightweight =add-to-list=, in place whenever org-protocol loads — org-config requires it at startup), and =cj/setup-video-download= now registers only the capture template lazily (first capture or first protocol call). Both timers gone. Tests pin that setup registers the template idempotently and no longer touches the protocol alist; verified in a live daemon that the protocol registers on load. Commit =bc965275=. - -**** 2026-05-24 Sun @ 04:30:14 -0500 Scoped video-capture URL to a dynamic binding - -The protocol handler =setq= a global =cj/video-download-current-url= and the capture handler read/cleared it, so an aborted or erroring capture left the stale URL for the next manual capture. Renamed to =cj/--video-download-url= and =let=-bind it around the =org-capture= call instead of mutating a global: the binding lives only for the capture's dynamic extent, so the handler sees the URL while the capture runs and an abort/error unwinds it automatically — no stale state, no manual clear. Manual invocation still prompts. Tests cover bound-URL download, manual prompt, empty-URL error, URL-visible-during-capture, and aborted-capture-leaves-nothing. Commit =b26b74cb=. - -Note: the sibling =org-webclipper.el= still uses the same global-mutation pattern (=cj/webclip-current-url= / =title=); a separate =:solo:= task tracks that. - -**** 2026-06-12 Fri @ 07:14:11 -0500 Audited shell-command-heavy recording and dwim-shell workflows - -=video-audio-recording.el= and =dwim-shell-config.el= are intentionally close to -the shell: pactl/ffmpeg/qpdf/7z/tesseract/media conversion commands are the -point. They also have the highest process and quoting surface in the config. - -Expected outcome: -- Keep the current workflows, but catalog which commands accept filenames, - URLs, passwords, or free-form user input. -- Prefer argv process APIs for commands that do not require a shell. -- For commands that must use shell templates, document which placeholders are - safely quoted by =dwim-shell-command= and add focused tests around password - temp-file cleanup. - -***** 2026-05-23 Sat @ 19:11:30 -0500 Fixed async password temp-file lifetime in dwim-shell - -The four password commands (PDF protect/unprotect, remove-zip-encryption, create-encrypted-zip) deleted the password temp file in =unwind-protect= the instant the async command launched, so =qpdf=/=7z= could start after the file was gone. Extracted =cj/dwim-shell--run-with-password-file= + =cj/dwim-shell--password-cleanup-callback=: the temp file (mode 600) is now deleted from an =:on-completion= callback that fires after the process exits (success or failure), with the synchronous =unwind-protect= kept only as a pre-launch-failure backstop. Rewrote all four commands onto the helper. 5 ERT tests cover the cleanup callback (success/error/missing-file) and the runner (writes 600 file + defers cleanup; cleans up on launch failure). qpdf already passes the password via =--password-file= (out of argv); the 7z argv exposure is split into its own follow-up below. - -***** 2026-05-24 Sun @ 04:20:31 -0500 Accepted the brief 7z password-on-argv exposure, documented it - -Investigated whether 7z could take the password off argv. It can't: 7-Zip 26.01 reads the password only from its controlling TTY, not stdin or a file. Verified empirically — =printf pw | 7z a -p ...= silently created an archive with an *empty* password (the piped value never reaches it), and a round-trip with the same password failed. So the password must go on argv via =$(cat tempfile)= and is briefly visible in the process list while 7z runs. - -Craig's call (2026-05-24): accept the exposure rather than switch off the .7z format. On a single-user workstation, for a short-lived process, with the password already kept out of shell history by the mode-600 temp file, the residual exposure is acceptable. The gpg-wrapped-tar alternative would close it but change the archive format and decrypt workflow. Recorded the tradeoff in both function docstrings in =dwim-shell-config.el= so the decision is visible at the call site, not just here. - -***** 2026-05-23 Sat @ 19:18:00 -0500 Quoted/validated user-controlled dwim-shell inputs - -Closed the four injection-quoting cases. git-clone-clipboard-url now validates the clipboard with =cj/dwim-shell--valid-git-url-p= and passes the URL via =shell-quote-argument= instead of the raw =<<cb>>= substitution. GPG recipient and the 7z archive name go through =shell-quote-argument= instead of hand-written single quotes. The ffmpeg thumbnail timestamp is validated with =cj/dwim-shell--valid-ffmpeg-timestamp-p= (digits/colons/dot only) before it reaches =-ss=. The sequential-rename prefix is validated filename-safe with =cj/dwim-shell--safe-rename-prefix-p=. 7 ERT tests cover the three validators (Normal/Boundary/Error); the two =shell-quote-argument= swaps trust the builtin. The fifth case — video concatenation's echo/tr/sed filelist — is a redesign rather than a quoting fix and is split out below. - -***** 2026-05-23 Sat @ 19:58:00 -0500 Rebuilt video-concat filelist in Elisp - -=cj/dwim-shell-commands-concatenate-videos= built the ffmpeg concat list with =echo '<<*>>' | tr ' ' '\n' | sed 's/^/file /'=, which split on spaces and broke on quotes. Extracted =cj/dwim-shell--build-concat-filelist=, which renders each path as an escaped =file '...'= line (single quotes escaped as ='\''=), writes it to a temp file in Elisp, and runs =ffmpeg -f concat -i <quoted-listfile>= with a trailing =; rm -f= to clean up after the process exits. =<<*>>= stays only as an inert trailing shell comment so dwim-shell still runs one command over all marked files. 3 ERT tests cover plain paths, spaces, and an embedded quote. - -***** 2026-05-23 Sat @ 20:17:00 -0500 Clarified broad/misleading file-operation commands - -=remove-empty-directories= ran =find . -type d -empty -delete= from the ambient current directory. Now it prompts for an explicit root (via =read-directory-name=), names that root in the confirmation, and runs =find <quoted-root> ...= built by =cj/dwim-shell--empty-dirs-command= (2 ERT tests cover the command shape + space quoting). =secure-delete= called =shred= without =-u=, overwriting file contents but leaving the file in place despite the name and the "permanently destroy" prompt; added =-u= (=shred -vfzu=) so it actually unlinks. Both use the inert =<<*>>= comment trick for single-execution. - -***** 2026-05-24 Sun @ 04:10:20 -0500 Shell-quoted X11 and audio recording command paths - -The Wayland =wf-recorder= path already quoted its args, but the X11 =ffmpeg= path and the audio-only =ffmpeg= path interpolated mic device, system device, and output filename raw — breaking on directories with spaces or unusual device names. Wrapped all three in =shell-quote-argument= on both paths. Extracted =cj/recording--build-audio-command= (mirroring =cj/recording--build-video-command=) so the audio command is unit-testable, then quoted there. Tests cover device names and filenames with spaces on both builders. Commit =39795e85=. - -***** 2026-05-24 Sun @ 04:10:20 -0500 Scoped wf-recorder stop signal to our own process - -Stop ran =pkill -INT wf-recorder=, signalling every wf-recorder on the system including an unrelated screen capture. Added =cj/recording--interrupt-child-wf-recorder=, which scopes the producer-first interrupt to the wf-recorder child of our own recording shell via =pkill -P <shell-pid>=. Producer-first ordering preserved (ffmpeg still sees a clean pipe EOF). The orphan-cleanup at recording start stays a broad by-name kill on purpose — those leftovers come from crashed sessions whose shells are already dead, so there is no live PID to scope to. Tests cover the scoped call, the nil-PID no-op, and that the bare system-wide form is never used. Commit =556f48a2=. - -***** 2026-05-24 Sun @ 04:10:20 -0500 Created the selected recording directory, not its parent - -The toggles ran =(file-name-directory location)= before =make-directory=, which returns the *parent* for a path without a trailing slash — so the selected directory went uncreated and ffmpeg failed to write into it. Both toggles now route the destination through =cj/recording--normalize-recording-dir= (expand + =file-name-as-directory=) and =make-directory= that, creating the selected directory itself (including names with spaces). Tests cover trailing-slash normalization, idempotence, spaces, and relative-to-absolute expansion. Commit =dc033c75=. - -**** TODO [#B] Make AI conversation persistence path-safe and project-aware :refactor: - -=ai-conversations.el= has good pure helper seams but is currently untested in -this repo. The path slugging is simple and the save/load/delete commands operate -directly in a single global directory. - -Expected outcome: -- Add tests for candidate sorting, topic slug collisions, autosave path setup, - and delete confirmation behavior. -- Consider whether conversations should remain global or support project-scoped - subdirectories. -- Confirm autosave never writes partial prompt/response state to an unexpected - file after loading a different conversation. - -**** TODO [#B] Harden calendar sync operational behavior around the parser :refactor: - -=calendar-sync.el= has broad parser/recurrence coverage, but the operational -path around it still has startup, persistence, and fetch risks. - -Expected outcome: -- Move private calendar URLs out of source and rotate the exposed feed URLs - before doing further cleanup. -- Avoid immediate network fetches at module load unless explicitly enabled for - interactive sessions. -- Add a per-calendar in-flight guard so a timer tick cannot launch overlapping - syncs for the same calendar. -- Use =curl --fail= or equivalent status handling so HTTP error pages are not - treated as successful ICS downloads. -- Write generated Org files atomically via a temp file and rename. -- Read the local state file with =read-eval= disabled. - -**** 2026-05-23 Sat @ 04:18:44 -0500 AI conversation persistence coverage already in place -Premise was stale. =tests/test-ai-conversations.el= (47 cases) already covers slug generation, timestamp parsing, candidate sorting (newest/oldest), latest-file selection, save/load header stripping against a temp dir, autosave path/timer, and delete confirmation — with GPTel stubbed throughout. Acceptance list satisfied; no new file needed. - -**** 2026-05-23 Sat @ 03:31:12 -0500 Dirvish helper coverage already in place -The task premise was stale: =dirvish-config.el= now has 14 focused test files (=test-dirvish-config-*.el=, ~100 cases) covering duplicate-naming, resolve-display-path (project/home/absolute/org-link), ediff-pair, html/printable predicates, playlist filtering/sanitizing, wallpaper-program mapping, and the public wrappers. The remaining gaps (playlist name-safety, set-wallpaper nil-file) were filled by the L2668 hardening commit 8fc6432d. No new file needed. - -**** 2026-05-23 Sat @ 03:21:12 -0500 Declared dirvish-config runtime deps with plain require -Switched =user-constants= and =system-utils= from =eval-when-compile= to plain =require= in =dirvish-config.el=, matching the three sibling requires below. The module builds =dirvish-quick-access-entries= from =code-dir=/=music-dir=/=pix-dir= at load and binds keys to =cj/xdg-open=/=cj/open-file-with-command=, so the deps are genuine runtime inputs. Added =tests/test-dirvish-config-runtime-requires.el= as a dependency-contract smoke test. Fixed in b63c4f83. - -**** 2026-05-23 Sat @ 03:31:12 -0500 Hardened dirvish wallpaper + playlist path helpers -=cj/set-wallpaper= passed =(dired-file-name-at-point)= straight into =expand-file-name=, so no-file-at-point raised a bare wrong-type-argument; added a nil guard that signals a clear user-error. =cj/dired-create-playlist-from-marked= expanded a raw name under =music-dir= with no check; added =cj/--playlist-name-safe-p= to reject any name carrying a directory separator (=../=, absolute, nested) before the path is built. Regression tests went into =test-dirvish-config-wrappers.el= and =test-dirvish-config-playlist.el=. The duplicate/copy-path helpers already guarded nil, so they were left alone. Fixed in 8fc6432d. - -**** 2026-05-23 Sat @ 03:38:30 -0500 Coverage already in place for mail + system-commands -The task premise was stale. =mail-config.el= has =test-mail-config-helpers.el= (4), =test-mail-config-transport.el= (7), and =test-mail-config.el= (1) covering executable discovery and transport command assignment. =system-commands.el= has =test-system-commands-keymap.el= (2, keymap shape + candidates) and =test-system-commands-resolve-and-run.el= (13, confirmation routing + command-string construction with shell-command stubbed). Both acceptance lists are satisfied; no new tests needed. - -**** 2026-05-24 Sun @ 14:43:13 -0500 Bounded the elfeed YouTube fetch + locked EWW UA scoping - -=cj/youtube-to-elfeed-feed-format= called =url-retrieve-synchronously= with no timeout (a hung request blocks Emacs) and only killed the temp URL buffer when an ID was extracted, leaking it on the parse-failure path. Passed =cj/elfeed-url-fetch-timeout= (10s) and moved fetch+parse into an =unwind-protect= that always kills the buffer. The EWW user-agent advice (=eww-config.el=) was already correctly scoped — it injects the UA only from eww-mode buffers, so package.el and other non-EWW url callers pass through untouched — so no code change there, just tests pinning that scoping and the replace-not-duplicate header behavior. Commit =c097b5b4=. - -**** 2026-05-16 Sat @ 04:00:00 -0500 Moved Slack which-key registration behind with-eval-after-load - -=slack-config.el= calls =which-key-add-keymap-based-replacements= at top level, -while most modules defer which-key registration. If which-key is not loaded or -autoloaded as expected, Slack config can fail during require. - -Expected outcome: -- Wrap the registration in =with-eval-after-load 'which-key=. -- Add a module-load smoke test or byte-compile check if easy. - -**** 2026-05-16 Sat @ 04:00:00 -0500 Removed httpd-start side effect from markdown-preview - -=modules/markdown-config.el:37-51= starts =simple-httpd= inside an -interactive command, then opens a browser at -=http://localhost:8080/imp=. Starting a network listener as a side -effect of a "preview" command surprises users; once started, the -server keeps running until Emacs exits. Either gate the start -behind an explicit confirmation, document the listener clearly, or -move the server start into a separate =cj/markdown-preview-server-start= -command so =markdown-preview= just opens the URL once the server is -known to be running. - -**** 2026-05-25 Mon @ 18:29:40 -0500 Moved eshell SSH hosts into a defcustom - -Replaced the three inline =eshell/alias= SSH-jump lines with a -=cj/eshell-ssh-hosts= defcustom (an alias→remote-path alist defaulting to the -current gocj/gosb/gowolf entries) that a per-machine config can override or set -to nil. The aliases are now built by iterating it via -=cj/--eshell-define-ssh-aliases=; the pure =cj/--eshell-ssh-alias-commands= -helper makes the construction testable without a live eshell. Tests added in -=tests/test-eshell-config-ssh-aliases.el=. - -**** 2026-05-16 Sat @ 04:00:00 -0500 Fixed https→http in markdown-preview + extracted server start - -=modules/markdown-config.el:45= opens -=https://localhost:8080/imp= via =browse-url-generic=, but the -=simple-httpd= listener bound in =httpd-config.el= serves plain -HTTP on port 8080. The =https= scheme causes the browser to -attempt a TLS handshake against a plaintext listener -- the request -fails before any preview content reaches the page, so the entire -feature is broken end-to-end. Change the URL to -=http://localhost:8080/imp= (and consider switching the launch to -=browse-url= so the user's default protocol handler is respected). - -**** TODO [#B] Document or vendor strapdown.js CDN dependency in =markdown-preview= :solo: - -=cj/markdown-html= (=modules/markdown-config.el:48-51=) embeds a -=<script src="http://ndossougbe.github.io/strapdown/dist/strapdown.js">= -in every rendered page. The preview silently fails when offline, -when the GitHub Pages host is unreachable, or if the upstream project -disappears. Document the dependency in the module commentary at -minimum; better, vendor a copy of =strapdown.js= under -=assets/= and serve it from the local =simple-httpd= root. - -**** 2026-05-16 Sat @ 04:00:00 -0500 Scoped TERM=xterm-256color to eshell buffers via process-environment - -=modules/eshell-config.el:131= calls =(setenv "TERM" "xterm-256color")= -at config time inside the =xterm-color= use-package block. That -changes =TERM= for the entire Emacs process, so every subsequent -=start-process= / =call-process= inherits =xterm-256color= rather -than the terminal's actual emulator. Most subprocesses treat it as -truthful and emit ANSI escapes, which surface as raw =\e[31m= bytes -in shells that aren't interpreting them. Move the setenv into the -eshell entry hook (=eshell-mode-hook= or =eshell-before-prompt-hook=) -so it scopes to eshell processes only. - -**** 2026-05-16 Sat @ 04:00:00 -0500 Quoted agent command in cj/--ai-vterm-launch-command via shell-quote-argument - -=modules/ai-vterm.el:236-240= builds the tmux launch command by -wrapping =(concat cj/ai-vterm-agent-command "; exec bash")= in -literal single quotes. The default value carries embedded double -quotes (=claude "Read .ai/protocols.org and follow all -instructions."=) which survives that wrap, but a user-customized -=cj/ai-vterm-agent-command= containing a single quote breaks the -shell parse silently. Run the inner command through -=shell-quote-argument= (or pass the command as a separate tmux -=new-session= positional argument) so any user-customized agent -command launches safely. - -*** 2026-05-15 Fri @ 18:14:26 -0500 Reviewed newly added modules - -Fresh end-to-end re-read of the 24 modules listed for this review, -applying the parent's protocol (runtime deps, top-level side effects, -keybindings, timers, external-executable assumptions, secrets, -host-specific paths, user-data writes, and test coverage). - -The 24 modules in scope: - -- Post-2026-04 additions (11): =telega-config.el=, - =mu4e-attachments.el=, =vterm-config.el=, =external-open-lib.el=, - =eshell-config.el=, =cj-window-toggle-lib.el=, - =cj-window-geometry-lib.el=, =cj-org-text-lib.el=, - =cj-cache-lib.el=, =nerd-icons-config.el=, =ai-vterm.el=. -- Pre-existing modules outside the original scope (13): - =text-config.el=, =markdown-config.el=, =latex-config.el=, - =flycheck-config.el=, =flyspell-and-abbrev.el=, =ledger-config.el=, - =httpd-config.el=, =chrono-tools.el=, =diff-config.el=, - =games-config.el=, =mu4e-org-contacts-setup.el=, - =mu4e-org-contacts-integration.el=, =org-agenda-config-debug.el=. - -Confirmed the 5 findings from the 2026-05-15 re-review pass are -filed and visible under their target Harden tracks: -=markdown-config= httpd start (UI/integrations track), =flycheck-config= -LanguageTool path (programming track), =latex-config= Zathura -(programming), =eshell-config= SSH hostnames (integrations), and -=nerd-icons-config= advice-timing / =:demand t= (UI/navigation). - -Filed 11 new sub-tasks across the Harden tracks this pass: - -- Foundation: dead world-clock block in =chrono-tools.el=, and - coverage for the TMR sound-selection helpers (with a refactor to - collapse the prefix-arg duplication). -- Custom editing: de-duplicate the spell-checker availability guard - in =flyspell-and-abbrev.el=, and add coverage for - =cj/flyspell-then-abbrev= + helpers. -- Org workflow: declare cross-module free variables in - =mu4e-org-contacts-integration.el=, and add coverage for the - completion-at-point / TAB / comma logic there. -- Programming workflow: fix the =cj/prose-helpers-on= toggle bug in - =flycheck-config.el= (=(if (not (abbrev-mode)) (abbrev-mode))= - flips the mode twice; needs =bound-and-true-p= + explicit enable). -- Integrations: fix the =https= vs =http= scheme mismatch in - =markdown-preview=, document/vendor its strapdown.js CDN - dependency, narrow the global =TERM=xterm-256color= setenv in - =eshell-config= so it doesn't leak into every subprocess, and - shell-quote the user-customized agent command in - =cj/--ai-vterm-launch-command=. - -The remaining 13 of the 24 modules had no concrete findings worth -filing -- they are either pure libraries with strong test coverage -(=cj-window-toggle-lib=, =cj-window-geometry-lib=, =cj-org-text-lib=, -=cj-cache-lib=, =external-open-lib=) or thin declarative -configuration (=text-config=, =diff-config=, =ledger-config=, -=games-config=, =mu4e-org-contacts-setup=, =telega-config=, -=httpd-config=, =org-agenda-config-debug=). - -** PROJECT [#B] theme-studio guide-support features :feature:studio: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-13 -:END: -From the color-assignment guide work (2026-06-08): make the tool support the guide without mandating it — everything a seed, an advisory, or a view, never a gate. Two specs to write, both deriving from the rewritten guide and its seed table ([[file:scripts/theme-studio/theme-coloring-guide.org][theme-coloring-guide.org]]). -*** 2026-06-08 Mon @ 19:08:00 -0500 Seeding-engine spec written and Ready -[[id:b70b37f2-37df-4c8e-ac2f-1f20d12e33dd][theme-studio-seeding-engine-spec-doing.org]] — role table + face→role maps for syntax/UI/org, OKLCH shade generation, reseed dupre-revised to the compact mapping. Codex-reviewed, Ready. Implementation tracked under the seeding-engine parent below. -*** TODO Guide-support views and advisories spec -Five optional surfaces, all dismissible and non-blocking, in one collapsible panel where they advise: (1) CVD-simulation toggle on previews (deuteranopia/protanopia/tritanopia); (2) squint/blur preview toggle; (3) lightness-ramp view + palette advisories (accent count over 6-8, roles separated only by red/green) — depends on the OKLCH/ΔE core; (4) definition-vs-call / weight advisories; (5) state-over-syntax preview (region/search/diff tint over real syntax-colored text). Sequence: rewritten guide reviewed → seeding-engine spec → this. Advisories (3, 4) layer on the perceptual-metrics feature. -** DONE [#B] calendar-sync robustness: atomic writes, curl --fail, zero-event false errors :bug:solo:next: -CLOSED: [2026-06-25 Thu] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-20 -:END: -All three landed (commit 11049db5) and verified against the live feed — gcal/pcal/dcal all fetched and wrote cleanly. (1) =calendar-sync--write-file= and =--save-state= write a temp file in the same directory then =rename-file= it into place, so a mid-write reader never sees a partial calendar. (2) Both curl fetches got =--fail=, so an HTTP 404/500 page exits non-zero instead of flowing its HTML into conversion. (3) =--parse-ics= now distinguishes a healthy zero-event calendar (real =BEGIN:VCALENDAR=, no in-window events -> header) from garbage (no VCALENDAR -> nil), so near-empty calendars no longer report "parse failed". New robustness tests + the empty-calendar boundary test corrected; calendar-sync suite 575/575. - -** DONE [#B] org-roam :config triggers the 15-20s refile scan synchronously at first idle :bug:solo:next: -CLOSED: [2026-06-25 Thu] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-20 -:END: -Fixed (commit 4e48432c): removed the redundant =cj/build-org-refile-targets= call from org-roam's :config (=org-roam-config.el=). org-roam is =:defer 1=, so that call ran the multi-file refile scan synchronously at the 1s idle on a cold cache, freezing Emacs at first idle; =org-refile-config.el= already schedules the same build on a 5s idle timer, so it was a duplicate. The first-idle freeze is gone. This removed the *duplicate* early scan, not the scan's cost — making the scan itself faster stays the separate =[#B] Optimize org-capture target building performance= task (profile-first). - -** VERIFY [#B] transcription: stderr never reaches the log :bug:solo:next: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-25 -:END: -The "/tmp" half is DONE (commit 3d9a650d): video transcripts now land beside the source video (=talk.mp4= -> =talk.txt=), via an =output-base= threaded through =cj/--start-transcription-process= so the outputs derive from the video, not the temp mp3. TDD regression test; full transcription suite green. -Remaining (the stderr half — needs a live transcription run to verify): =transcription-config.el= =make-process :stderr= with a file PATH creates a BUFFER named like the path, not a file, so the "Errored. Logs in <file>" notification points at a log with no error text, and the hidden stderr buffer leaks per transcription. Fix: route stderr into the process buffer (or a real temp file) and write the captured text out in the sentinel, then drop the leaked buffer. Code-fixable now; held because verifying it needs a real (failing) transcription run. From the 2026-06 config audit. - -** DONE [#B] eww User-Agent advice may not inject under Emacs 30 :bug: -CLOSED: [2026-06-25 Thu] -Root cause was NOT =derived-mode-p= (that works in both batch and the daemon — my initial guess was wrong). It was the lexical-binding special-var trap: =eww-config.el= is =lexical-binding: t= and the advice =my-eww--inject-user-agent= let-binds url.el's =url-request-extra-headers=, but the file never declared that var special. The byte-compiler bound it lexically, so the injected User-Agent never reached =url-retrieve= and the desktop UA silently dropped in compiled production (eww still worked, just with the default UA). Verified: the byte-compiled advice returned nil before, =t= after. Fix (commit 6131da8e): a top-level =(defvar url-request-extra-headers)= so the compiler treats it as dynamic and the binding propagates. All 3 advice tests pass; live-reloaded. Same class as the json-object-type and the LSP-test special-var traps — a foreign special var let-bound in a lexical file always needs a compile-time defvar/require. -** DONE [#B] calendar-sync: a declined single occurrence keeps :STATUS: accepted :bug:solo: -CLOSED: [2026-06-25 Thu] -A recurring event declined for just one occurrence synced out with =:STATUS: accepted= (chime then faithfully showed it). Root cause (diagnosed by a chime session, 2026-06-24): =calendar-sync--apply-single-exception= merged the override's =:attendees= but never re-derived =:status=, so the occurrence kept the series master's accepted status, and =calendar-sync--filter-declined= (which keys off =:status=) didn't drop it. Fix (TDD): in =apply-single-exception=, when overriding =:attendees=, re-derive =:status= via =calendar-sync--find-user-status= against =calendar-sync-user-emails=. Four new tests in =test-calendar-sync--apply-single-exception.el= (declined → "declined"; no-attendee override → inherited intact; accepted override → accepted; override without the user → inherited intact); recurrence + find-user-status + integration suites unchanged. Live-reloaded; a manual re-sync ran clean. The specific 2026-06-24 Arusyak occurrence is past now (its RECURRENCE-ID override aged out of the feed), so the live confirmation lands on the next single-occurrence decline. -** TODO [#C] Unified popup and messenger UX — placement, dismissal, one library :feature: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-20 -:END: -Merged 2026-06-20 from the config-wide popup-policy task and the messenger-unification -task — they're the same policy at two scopes (the messenger windows are the first -concrete application of the general popup rules). Two parts: - -(A) Config-wide popup policy. All transient popups follow one set of principles. -Placement: when the Emacs frame is wider than tall, the popup rises from the right; -when square or taller, from the bottom — settle the aspect-ratio threshold and the -pop-out percentage. Dismissal: C-c C-c when there's an accept action, C-c C-k when -there's a cancel, otherwise =q= closes the window. Generalizes ai-term adaptive -placement (the aspect-ratio docking) and the messenger window/key rules below into -one config-wide policy. From the roam inbox. - -(B) Messenger unification (first application of the policy above). -Spec: [[file:docs/specs/messenger-unification-spec.org][messenger-unification-spec.org]] ([[id:4bfc2011-8ffc-4765-8886-91df12141171][by id]], Draft, 2026-06-11; keybinding-alphabet section + smoke-first parity added 2026-06-16). One library (=cj-messenger-lib.el=) gives every messenger the same shape: chat windows rise from the bottom (the signel rule, generalized), C-c C-c confirms, C-c C-k cancels, C-c C-a attaches — dispatched per backend through a registry + minor mode. Signel already conforms (reference backend); telega and slack join in phases 2-3; ERC later. All eight decisions settled 2026-06-11 (cancel closes an idle window; telega's filter-cancel shadow accepted; slack rooms join the bottom rule). Spec held open — Craig has more ideas to fold in before it's marked Ready. - -** TODO [#C] Auto-dim: org headings, links, and tags do not dim in unfocused windows :bug: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-20 -:END: -auto-dim-other-buffers-affected-faces (auto-dim-config.el) remaps font-lock and a few org faces to the flat dim face, but not org-level-1..8, org-link, or org-tag, so headings, links (seen in daily-prep.org), and tags like :solo: stay lit when the window loses focus. Decide the dim approach: a flat-dim remap like font-lock (quick) versus dedicated -dim variants surfaced through org-faces / theme-studio (richer, matches the keyword work; Craig flagged org-tags may want the org-faces treatment). Consolidates three roam-inbox captures. -** TODO [#C] "? = curated help menu" convention across modes :feature: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-20 -:END: -From the calibredb keybindings work 2026-06-06. The pattern that worked: in a modal/major-mode buffer (calibredb), bind =?= to a curated transient of the frequent workflows, and move the package's own full dispatch to =H=. It fixes the "I can't discover the keys" problem that which-key can't help with (which-key only pops up after a prefix, not for top-level single keys in a mode-map). - -Task: survey the modes/modules Craig works in and identify where a =?= -> curated-help-menu (transient) makes sense. Candidates: any major-mode buffer with single-key bindings and no good discovery affordance -- calibredb (done), nov, dirvish, mu4e, ghostel/term, signel, pearl/linear, ELFeed, etc. For each, note whether =?= is free or already a help dispatch, and whether a curated menu (vs the package's own) adds value. Establish it as a convention (and maybe a small helper/macro to define a curated =?= menu consistently). - -** TODO [#C] Dupre diff-changed / diff-refine-changed legibility :bug: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-21 -:END: -Surfaced 2026-06-07 from a pearl session designing its modified-ticket indicator (pearl marks a changed field by inheriting =diff-changed=). dupre's =diff-refine-changed= is bright gold (#ffd700) under near-white text (#f0fef0) -- WCAG contrast ~1.35, unreadable as a plain background. It only looks fine inside diff-mode because diff-mode overlays its own dark foreground. =diff-changed= (#875f00 amber) is ~5.49, readable but off the modus model. Every modus variant keeps both faces legible (contrast 9-16) by pairing a dark low-saturation background with a hue-matched foreground. - -Ask: -1. Rework dupre's =diff-changed= and =diff-refine-changed= on modus lines: dark low-saturation background, legible foreground (plain default fg for simplicity, or hue-tinted per modus -- decide), and keep refine slightly stronger than changed (refine is the word-level emphasis inside a changed region; modus keeps them distinct). -2. While there, audit dupre's broader diff/palette faces against modus conventions (background/foreground tinting, contrast targets) and flag where it diverges. - -Reference values -- modus-vivendi: refine-changed bg #4a4a00 fg #efef80, changed bg #363300 fg #efef80. modus-operandi: refine-changed bg #fac090 fg #553d00, changed bg #ffdfa9 fg #553d00. - -Side-by-side legibility render: [[file:assets/2026-06-07-dupre-diff-face-legibility-compare.png][assets/2026-06-07-dupre-diff-face-legibility-compare.png]]. -** TODO [#C] Fix up test runner :feature:refactor: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-21 -:END: -*** 2026-05-16 Sat @ 11:15:51 -0500 Ideas -**** Current State -=modules/test-runner.el= is a solid first pass for an Emacs-config-specific ERT -workflow: -- project-scoped focus lists -- run all vs focused mode -- run ERT test at point -- load all test files -- clear ERT tests from other project roots -- keybindings under =C-; t= - -The universal test-running direction is currently split across modules: -- =test-runner.el= owns ERT focus/state/UI. -- =dev-fkeys.el= owns F6 language detection and command generation for Elisp, - Python, Go, and partial TypeScript. - -That split is the biggest architectural pressure point. The test runner should -eventually own runner discovery, scopes, command construction, result handling, -and UI. F6 should become a thin entry point into the runner. - -**** Critical Design Issues -***** Too ERT-specific at the core -The current state model is named generically, but most operations assume: -- test files live in =test/= or =tests/= -- files match =test-*.el= -- tests are ERT forms -- individual tests can be selected by ERT selector regex -- loading tests into the current Emacs process is acceptable - -This makes the module hard to extend cleanly to pytest, Jest, Vitest, Go, Rust, -or shell test runners. The common abstraction should be "test run request" and -"test runner adapter", not "ERT file list". - -***** In-process ERT causes state contamination -=cj/test-load-all= and focused runs load test files into the current Emacs -session. This is fast and ergonomic, but it can leak: -- global variables -- advice -- loaded features -- overridden functions -- ERT test definitions -- load-path mutations - -The runner should support two ERT execution modes: -- =interactive= / in-process for fast local TDD -- =isolated= / batch Emacs for reliable verification - -The isolated path should be preferred for "before commit", CI parity, and -agent-driven verification. - -***** Test discovery is regex-based and fragile -=cj/test--extract-test-names= scans files with a regex for =ert-deftest=. -That misses or mishandles: -- macro-generated tests -- commented forms in unusual shapes -- multiline or reader-conditional forms -- non-ERT Elisp tests such as Buttercup -- stale ERT tests already loaded in the session - -Better approach: -- for ERT in isolated mode, let ERT discover tests after loading files -- for source navigation, use syntax-aware forms where possible -- store discovered tests as structured records with file, line, name, framework, - tags, and runner - -***** Path containment has at least one suspicious edge -=cj/test--do-focus-add-file= checks: - -#+begin_src elisp -(string-prefix-p (file-truename testdir) (file-truename filepath)) -#+end_src - -That should use =cj/test--file-in-directory-p= or ensure the directory has a -trailing slash. Otherwise sibling paths with a shared prefix are a recurring -class of bug. - -***** Runner commands are shell strings too early -=cj/--f6-test-runner-cmd-for= returns shell command strings. That makes it -harder to: -- inspect command parts -- safely quote arguments -- offer command editing -- run via =make-process= / =compilation-start= without shell ambiguity -- attach metadata -- rerun exact invocations -- convert commands into UI labels - -Prefer a structured command object: - -#+begin_src elisp -(:program "pytest" - :args ("tests/test_foo.py" "-q") - :default-directory "/project/" - :env (("PYTHONPATH" . "...")) - :runner pytest - :scope file) -#+end_src - -Render to a shell string only at the final compilation boundary. - -***** F6 and =C-; t= workflows duplicate the same domain -F6 already handles "all tests" and "current file's tests" for multiple -languages. =C-; t= handles ERT-only focus and run state. These should converge -on one runner service: -- F6: quick entry point -- =C-; t=: full runner menu -- both call the same scope/adapter engine - -***** Test directory discovery is too narrow -Current discovery prefers =test/= then =tests/=, with a global fallback. Real -projects often need: -- Python: =tests/=, package-local =test_*.py=, =pytest.ini=, =pyproject.toml= -- JS/TS: =package.json= scripts, =vitest.config.*=, =jest.config.*=, - =*.test.ts=, =*.spec.ts= -- Go: package directories, =go.mod= -- Rust: =Cargo.toml=, integration tests under =tests/= -- Elisp packages: =Makefile=, =Eask=, =ert-runner=, Buttercup, =tests/= - -Discovery should be adapter-specific and project-config-aware. - -***** No structured result model -=cj/test-last-results= exists but is not meaningfully populated. A powerful -runner needs a normalized result model: -- run id -- started/finished timestamps -- status: passed/failed/errored/cancelled/skipped/xfail/xpass -- command -- runner adapter -- scope -- exit code -- duration -- failed test records -- file/line locations -- raw output buffer -- coverage artifact paths - -This enables last-failed, failures-first, summaries, dashboards, and AI-assisted -failure explanation. - -***** No failure parser / navigation layer -Compilation buffers are useful, but the runner should parse common failure -formats and provide: -- next/previous failure -- jump to source line -- failure summary buffer -- copy failure context -- rerun failed test at point -- annotate failing tests in source buffers - -Adapters can provide regexes/parsers for ERT, pytest, Jest/Vitest, Go, Rust, -and shell. - -***** Missing watch/rerun modes -Modern test runners optimize the feedback loop: -- pytest supports selecting tests, markers, last-failed, failures-first, - stepwise, fixtures, xfail/skip, plugins, and cache state. -- Jest/Vitest support watch workflows, changed-file selection, coverage, - snapshots, and rich interactive filtering. Vitest also defaults to watch in - development and run mode in CI. -- Go and Rust runners commonly support package-level runs, regex selection, - race/coverage flags, and cached test behavior. - -The Emacs runner should expose the subset that maps well to editor workflows: -- current test -- current file -- related test file -- focused set -- last failed -- failed first -- changed since git base -- watch current scope -- full project -- coverage for current scope - -**** Proposed Architecture -***** Core Types -Use plain plists initially; promote to =cl-defstruct= only if helpful. - -#+begin_src elisp -;; Test runner adapter -(:id pytest - :name "pytest" - :languages (python) - :detect cj/test-pytest-detect - :discover cj/test-pytest-discover - :build-command cj/test-pytest-build-command - :parse-results cj/test-pytest-parse-results - :capabilities (:current-test :file :project :last-failed :coverage :watch)) - -;; Test run request -(:project-root "/repo/" - :language python - :framework pytest - :scope file - :file "/repo/tests/test_api.py" - :test-name "test_create_user" - :extra-args ("-q") - :profile default) - -;; Test run result -(:run-id "..." - :status failed - :exit-code 1 - :duration 2.14 - :failures (...) - :output-buffer "*test pytest*" - :artifacts (...)) -#+end_src - -***** Adapter Registry -Create a registry like: - -#+begin_src elisp -(defvar cj/test-runner-adapters nil) -(cj/test-register-adapter 'pytest ...) -(cj/test-register-adapter 'ert ...) -(cj/test-register-adapter 'vitest ...) -#+end_src - -Runner selection should consider: -- buffer file extension -- project files -- explicit user override -- available executables -- package manager scripts -- existing Makefile targets - -***** Scope Model -Make scopes explicit and shared across languages: -- =test-at-point= -- =current-file= -- =related-file= -- =focused-files= -- =last-failed= -- =changed= -- =package/module= -- =project= -- =coverage= -- =watch= - -Each adapter can say which scopes it supports. Unsupported scopes should produce -clear user-errors with suggestions. - -***** Command Builder Pipeline -1. Detect project. -2. Detect language/framework candidates. -3. Resolve user-requested scope. -4. Build structured command object. -5. Optionally let user edit command. -6. Run via =compilation-start= or =make-process=. -7. Parse output/result artifacts. -8. Store normalized result. -9. Update UI/modeline/messages/failure buffer. - -***** Keep Makefile Support But Do Not Require It -For this Emacs config, =make test-file= and =make test-name= are useful and -should remain the default Elisp isolated path. But adapter detection should -support: -- direct =emacs --batch= ERT invocation -- =make test= -- =make test-file= -- =make test-name= -- Eask -- Buttercup - -**** Elisp-Specific Improvements -***** Add isolated ERT runs -Support batch commands for: -- all project tests -- one test file -- one test name -- focused files -- last failed, once result parsing exists - -Use the same Makefile targets in this repo, but design the adapter so other -Elisp projects can run without this Makefile. - -***** Support Buttercup/Eask Later -Buttercup uses BDD-style =describe= / =it= suites and is common in Elisp -package testing. Eask is often used to run package tests. Add adapter slots -for these instead of hard-coding ERT forever. - -***** Avoid unnecessary global ERT deletion -=cj/ert-clear-tests= is a pragmatic fix for project contamination, but the -stronger long-term answer is isolated runs plus project-scoped discovery. Keep -the cleanup command, but do not make correctness depend on deleting global ERT -state. - -**** Python / pytest Ideas -- Detect pytest by =pyproject.toml=, =pytest.ini=, =tox.ini=, =setup.cfg=, or - presence of =tests/=. -- Build commands for: - - project: =pytest= - - file: =pytest path/to/test_file.py= - - test at point: =pytest path/to/test_file.py::test_name= - - class method: =pytest path::TestClass::test_method= - - marker: =pytest -m marker= - - last failed: =pytest --lf= - - failed first: =pytest --ff= - - stop after first: =pytest -x= - - coverage: =pytest --cov=...= -- Parse output for failing node ids and =file:line= references. -- Read pytest cache for last-failed where useful. -- Offer marker completion by parsing =pytest --markers= or config files. -- Surface xfail/skip separately from hard failures. - -**** TypeScript / JavaScript Ideas -***** Detection -Detect runner by project files and scripts: -- =vitest.config.ts/js/mts/mjs= -- =jest.config.ts/js/mjs/cjs= -- =package.json= scripts: =test=, =test:watch=, =vitest=, =jest= -- lockfile/package manager: =pnpm-lock.yaml=, =yarn.lock=, =package-lock.json=, - =bun.lockb= - -Prefer project scripts over raw =npx= when present: -- =pnpm test -- path= -- =npm test -- path= -- =yarn test path= -- =bun test path= - -***** Scopes -- current file: =vitest run path= or =jest path= -- test at point: use nearest =it= / =test= / =describe= string and pass =-t= -- watch current file -- changed tests where runner supports it -- coverage current file/project -- update snapshots - -***** Result Parsing -Parse: -- failing test names -- file paths and line numbers -- snapshot failures -- coverage summary - -Treat snapshot updates as an explicit command, not an automatic side effect. - -**** Go Ideas -- Detect =go.mod=. -- Current file/source: run package =go test ./pkg=. -- Test at point: nearest =func TestXxx= and run =go test ./pkg -run '^TestXxx$'=. -- Bench at point: nearest =BenchmarkXxx= and run =go test -bench '^BenchmarkXxx$'=. -- Add toggles for =-race=, =-cover=, =-count=1=, =-v=. -- Parse =file.go:line:= output and package failure summaries. - -**** Rust Ideas -- Detect =Cargo.toml=. -- Use =cargo test= by default, optionally =cargo nextest run= when available. -- Current test at point: nearest =#[test]= function. -- Current file/module where possible. -- Integration test file: =cargo test --test name=. -- Support =-- --nocapture= toggle. -- Parse compiler/test failures and =file:line= links. - -**** Shell / Generic Ideas -- Adapter for Makefile targets: - - detect =make test=, =make check=, =make coverage= - - expose project-level commands even when language-specific detection fails -- Adapter for arbitrary project command configured in dir-locals or a project - config plist. -- Let users register custom command templates per project: - -#+begin_src elisp -((:name "unit" - :command ("npm" "run" "test:unit" "--" "{file}")) - (:name "integration" - :command ("pytest" "tests/integration" "-q"))) -#+end_src - -**** UI Ideas -***** Transient Menu -Replace or complement the raw keymap with a =transient= menu: -- scope: current test/file/focused/last failed/project -- runner: auto/ert/pytest/vitest/jest/go/cargo/make -- toggles: watch, coverage, debug, fail-fast, verbose, update snapshots -- actions: run, rerun, edit command, show failures, open report - -***** Result Buffer -Create a normalized =*Test Results*= buffer: -- latest status per project -- command and duration -- pass/fail/skip counts -- failure list with clickable =file:line= -- actions to rerun failed/current/all -- links to coverage artifacts - -***** Modeline / Headerline Signal -Show the last run status for the current project: -- green passed -- red failed -- yellow running -- gray no run - -Keep it quiet and optional. - -***** History -Store recent run requests per project: -- rerun last -- rerun last failed -- choose previous command -- compare duration/status against previous run - -**** Configuration Ideas -- =cj/test-runner-default-scope= -- =cj/test-runner-prefer-isolated-elisp= -- =cj/test-runner-project-overrides= -- =cj/test-runner-known-adapters= -- =cj/test-runner-enable-watch= -- =cj/test-runner-result-retention= -- per-project override through =.dir-locals.el= - -Example: - -#+begin_src elisp -((nil . ((cj/test-runner-project-overrides - . (:adapter pytest - :default-args ("-q") - :coverage-args ("--cov=src")))))) -#+end_src - -**** Safety And Robustness -- Use structured commands until the final boundary. -- Quote only at render time. -- Avoid shell when =make-process= / =process-file= is sufficient. -- Keep command preview/editing available for surprising cases. -- Detect missing executables before running. -- Add timeouts/cancel commands for long-running or hung tests. -- Do not silently fall back from a missing runner to a different runner unless - the fallback is visible in the command preview. -- Avoid mutating global =load-path= permanently. -- Keep remote/TRAMP behavior explicit; do not accidentally run local commands - for remote projects. - -**** Coverage Integration -Tie this into the existing coverage work: -- run coverage for current file/scope -- open latest coverage report -- summarize uncovered lines for current file -- support Elisp SimpleCov/Undercover, pytest-cov, Vitest coverage, Go cover, - and Rust coverage later -- store coverage artifact paths in the normalized run result - -**** AI-Assisted Debugging Ideas -- Summarize failing tests from the parsed failure records and raw output. -- Include command, changed files, failure snippets, and relevant source/test - locations. -- Redact env vars, tokens, Authorization headers, and secrets before sending to - =gptel=. -- Add commands: - - =cj/test-runner-explain-failure= - - =cj/test-runner-suggest-related-tests= - - =cj/test-runner-summarize-coverage-gap= - -**** Migration Plan -***** Phase 1: Internal cleanup -- Fix the task typo and rename current ERT-specific functions or wrap them under - an ERT adapter. -- Move F6 language detection/command construction from =dev-fkeys.el= into - =test-runner.el= or a new =test-runner-core.el=. -- Replace shell-string command builders with structured command plists. -- Fix path containment in =cj/test--do-focus-add-file=. -- Make =cj/test-last-results= real for ERT runs. - -***** Phase 2: ERT adapter -- Implement adapter registry. -- Add ERT adapter with in-process and isolated modes. -- Preserve all current keybindings by routing them through the adapter. -- Add failure/result normalization for ERT. -- Add "rerun last" and "rerun failed" for ERT. - -***** Phase 3: Python and JS/TS adapters -- Add pytest adapter. -- Add Vitest/Jest adapter with package-manager/script detection. -- Support current file and test-at-point for both. -- Add parser/navigation for common failures. - -***** Phase 4: UI and watch modes -- Add transient menu. -- Add result buffer. -- Add cancellation and rerun history. -- Add watch commands where supported. - -***** Phase 5: Coverage and AI -- Connect coverage commands to adapter capabilities. -- Add failure summarization with redaction. -- Add coverage-gap summarization. - -**** Acceptance Criteria For First Fix-Up Pass -- Existing ERT workflow still works. -- F6 and =C-; t= use the same underlying runner API. -- Current-file test command generation is covered for Elisp, Python, Go, - TypeScript, and JavaScript. -- At least one isolated ERT command path exists. -- Path containment checks are robust against sibling-prefix paths and symlinks. -- Runner requests and results are represented as data, not only messages. -- Missing runner/tool errors are clear and actionable. -- Tests cover adapter detection, command building, scope resolution, result - storage, and key interactive paths. - -** TODO [#C] Keymap consolidation — resolve decisions, run Phase 1-2 :feature:refactor:solo: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-13 -:END: -Spec: [[id:540bf06b-16b8-46c6-b459-c40d1b9c795d][keybinding-console-safety-spec-doing.org]]. Phase 0 (revert 4a1ecf64) is done and pushed. Decisions D1-D5 are open TODOs in the spec; D2/D4/D5 gate the primary work (Phase 1 prune via Appendix D, Phase 2 consolidate + retire the translation block), while D1/D3 (the console-safe prefix) gate only the optional Phase 3 and can stay open indefinitely. Resolve D2/D4/D5, then run Phase 1-2. Appendix D is the keybinding pruning checklist. Add a =#+TODO: TODO | DONE SUPERSEDED CANCELLED= header line to the spec if adopting those decision keywords (rulesets convention update, 2026-06-12). - -** TODO [#C] ledger-config is orphaned — ledger-mode never configured :bug:quick: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-21 -:END: -Nothing requires =modules/ledger-config.el= (verified by grep), so .dat/.ledger/.journal open without ledger-mode, reports, or flycheck-ledger. The module looks finished, not staged (unlike duet-config, which documents its pre-alpha orphaning). Decide: wire into init.el (+ =cj/executable-find-or-warn= for the ledger binary) or delete. From the 2026-06 config audit. - -** TODO [#C] ai-term multi-LLM support — Claude / Codex / ollama :feature: -Allow creating an ai-term that launches any of Claude, Codex, or a local LLM via ollama, switchable at session start. From rulesets/Craig via the roam inbox. Spec note: =inbox/PROCESSED-2026-06-23-2123-from-rulesets-ai-term-multi-llm-support-from-craig.org=. -** TODO [#C] ai-term: multi-backend (Claude / Codex / local ollama) :feature: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-22 -:END: -Allow creating an ai-term backed by any of Claude, Codex, or a local LLM via ollama, with the backend chosen seamlessly at the start of the session. ai-term currently assumes Claude; generalize the launch path so the agent backend is a selectable parameter and switching between them at session start is frictionless. Routed here from the rulesets roam-inbox item "multiple agent source improvements" (its bullet 3 asked to send emacs this note); the item's other bullets — naming the agent so non-Claude agents aren't called "Claude", and tightening workflow wording for Codex's more literal reading — stay with rulesets. - -** TODO [#C] Migrate tests off mocking primitives (native-comp robustness) :test:refactor: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-21 -:END: -Long-term test-quality work surfaced by re-enabling native-comp (2026-06-20). When a test redefines a C primitive or a native-compiled function (=cl-letf=/=fset=/=advice-add=), native-comp routes native callers through a trampoline, which interacts badly with mocks in three ways: trampoline-build failure under =--batch=, silent mock-bypass (native callers ignore the redefinition), and arity mismatch (the trampoline calls the mock with the primitive's max arity). - -Done 2026-06-21 (the immediate fix): swept every arity-narrow subr mock to =(lambda (&rest _) ...)= (188 sites) and added =tests/test-meta-subr-mock-arity.el=, which fails =make test= on any arity-narrow subr mock. That kills the arity mode (the only one we've hit) and enforces it going forward. - -This task is the durable fix the ecosystem and =elisp-testing.md= point to: restructure tests so they don't redefine primitives at all — inject dependencies, drive real state (temp-file fixtures, real buffers), or test pure helpers. That closes the two latent modes (build-failure, silent-bypass) the variadic sweep leaves open. Big, incremental, low-urgency. - -Full mechanism, the three failure modes, the research (Emacs bug#51140, bug#61880, buttercup #230, Debian #1021842, the emacs-29 redefine-primitive warning, the manual on =native-comp-enable-subr-trampolines=), and the decision: [[file:docs/native-comp-subr-mocking.org][docs/native-comp-subr-mocking.org]]. - -** TODO [#C] buffer-differs save prompt: 4-way yes/no/diff/cancel :feature:next: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-21 -:END: -The "buffer differs from file" confirmation currently gives only yes/no. Craig wants a 4-way choice with explicit consequences: yes (be explicit it overwrites), no (be explicit it discards this action and continues), diff (show a graphical difftastic diff, then return to this prompt), cancel (stop the action, leave the buffer untouched). Needs the exact prompt identified first (which save/overwrite path raises "buffer differs") and a design for the diff-then-return loop. difftastic + cj/diff-buffer-with-file infrastructure already exist. From the roam inbox 2026-06-16. -** TODO [#C] emacs: tag tasks by module name for sorting :refactor:studio: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-21 -:END: -Replace topic tagging with single-word module tags: :studio: for everything under scripts/theme-studio/, module-named tags elsewhere, :multi: for cross-area work. Drop bug/enhancement-style tags since work should be chosen on other bases. This changes the current six-tag convention, so update the priority-scheme section to document it, rewrite the task-audit workflow to reconcile tasks against the module scheme, then run the audit. Queue for end of session. From the roam inbox. -** TODO [#C] Build debug-profiling.el module :feature:solo: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-21 -:END: - -Reusable profiling infrastructure for targeted slow-command investigation. Consolidates scattered profiler bindings (currently in =modules/config-utilities.el=) and adds two pure-helper-backed entry points: "profile next command" and "time region or sexp." Designed via =/brainstorm= 2026-04-26. - -Design: [[id:c713b431-ae14-498d-aba9-b84d52f981b6][docs/specs/debug-profiling-spec.org]] - -Implement via =/start-work= against the design — branch =feat/debug-profiling=, commits decomposed along the test-first split-for-testability boundary. Once shipped, use it as the v1 exercise on the queued [#B] org-capture target-building investigation. - -** TODO [#C] Evaluate jamescherti essential-emacs-packages list :quick:solo: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-21 -:END: -Review [[https://www.jamescherti.com/essential-emacs-packages/][James Cherti's essential Emacs packages]] for anything worth installing. Cross-check each candidate against what is already in the config (=modules/= + =init.el=), skip the ones already present, and shortlist the genuinely new ones with a one-line rationale. Future-installation research, not a commitment to install. - -** TODO [#C] Extend F2 "preview" convention across modes :feature: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-21 -:END: - -F2 is the universal preview key. Currently bound only in markdown-mode (markdown-preview, in =modules/markdown-config.el=). Org-reveal lives on =C-; o R= via =cj/org-map=, not F2. Extend F2 to other modes where a "preview" action is natural: - -- Hugo blog (hugo-config.el) — preview the post in browser -- HTML / web-mode — open in browser -- Reveal presentations - preview in browser -- Any other mode with a natural "preview this" action - -Keep the binding mode-local so F2 stays available as a global candidate where no preview makes sense. - -** TODO [#C] Gold text in auto-dimmed buffers :bug: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-21 -:END: -Some auto-dimmed document buffers render text in gold; source unknown. Likely a face-remapping or overlay interaction with the theme. Blocked on the face/font diagnostic tool above for diagnosis. From the roam inbox. -** TODO [#C] Google Contacts ↔ org-contacts sync investigation :feature: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-21 -:END: -From the 2026-06-11 brainstorm. Goal: keep [[file:~/sync/org/contacts.org][contacts.org]] (real org-contacts: PROPERTIES drawers, mu4e completion, org-roam links) in sync with Google Contacts. Google side is solid — official People API (OAuth2, incremental syncToken) or CardDAV; no ToS risk. The hard parts are local: (1) identity — entries have no UID, so two-way needs a GOOGLE_ID property per entry plus a one-time fuzzy reconciliation of the two populated datasets (name/email/phone matching); (2) field mapping — space-separated multi-email in one property, free-text body notes, inconsistent phone formats (normalization decision); (3) conflict policy. First decision gates the rest: one-way Google→org read model (simple) vs true two-way. Candidate architectures: vdirsyncer (proven two-way engine w/ Google support; build only the vCard↔org translation, evaluate org-vcard fidelity) vs a direct People API script with sync state in org properties. Output: recommendation doc in docs/design/ naming direction + the normalization/conflict decisions for Craig. Not :solo: — the one-way-vs-two-way call and normalization policy are Craig's. - -** TODO [#C] Google Voice in Emacs — SMS + dialer investigation :feature: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-21 -:END: -From the 2026-06-11 messenger-unification brainstorm. Google Voice has no official API; the viable routes ride the Matrix bridge ecosystem's reverse engineering (mautrix-gvoice). Research pass to establish the 2026 state of play: (1) is mautrix-gvoice healthy and what does its auth flow look like now; (2) any better-maintained alternative (CLI/daemon) for the signel-pattern architecture (external daemon + JSON-RPC + thin Emacs chat client); (3) does call initiation (ring-linked-phone-then-connect, Emacs as dialer) survive in the current protocol — two-way audio in Emacs is out of scope (WebRTC); (4) ToS/account-flag risk assessment for Craig's account. Output: a recommendation doc in docs/design/ naming the architecture (signel-pattern daemon vs Matrix bridge + ement.el) or a no-go with reasons. If go, GV becomes a registered backend under the messenger-unification convention (see the [#B] task below). - -** TODO [#C] Org-noter custom workflow — fix and finish :feature:bug: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-21 -:END: - -Continue debugging and testing the custom org-noter workflow from 2025-11-21 session. -This is partially implemented but has known issues that need fixing before it's usable. - -*Last worked on:* 2025-11-21 -*Current status:* Implementation complete but has bugs, needs testing - -*Known issues to fix:* - -1. /Double notes buffer appearing when pressing 'i' to insert note/ - - When user presses 'i' in document to insert a note, two notes buffers appear - - Expected: single notes buffer appears - - Need to debug why the insert-note function is creating duplicate buffers - -2. /Toggle behavior refinement needed/ - - The toggle between document and notes needs refinement - - May have edge cases with window management - - Need to test various scenarios - -*Testing needed:* - -1. /EPUB files/ - Test with EPUB documents (primary use case) -2. /Reopening existing notes/ - Verify it works when notes file already exists -3. /Starting from notes file/ - Test opening document from an existing notes file -4. /PDF files/ - Verify compatibility with PDF workflow -5. /Edge cases:/ - - Multiple windows open - - Splitting behavior - - Window focus after operations - -*Implementation files:* -- =modules/org-noter-config.el= - Custom workflow implementation -- Contains custom functions for document/notes toggling and insertion - -*Context:* -This custom workflow is designed to make org-noter more ergonomic for Craig's reading/annotation -workflow. It simplifies the toggle between document and notes, and streamlines note insertion. -The core functionality is implemented but needs debugging before it's production-ready. - -**Next Steps:** -1. Debug the double buffer issue when pressing 'i' -2. Test all scenarios listed above -3. Refine toggle behavior based on testing -4. Document the final keybindings and workflow - -** TODO [#C] Pick and wire a debug backend for F5 :feature: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-21 -:END: - -#+begin_src emacs-lisp - Give me an idea of the amount of work and complexity and what allows for a consistent UX across languages. -#+end_src - -*** 2026-05-15 Fri @ 19:19:21 -0500 Inital Goals -Bind F5 globally to a debug entry point. Backend choice is the hard part: - -- dape (Debug Adapter Protocol for Emacs) — modern, multi-language via DAP. Single UX across Python, Go, TS, Rust, etc. Less mature than DAP clients in other editors. -- realgud — wraps multiple debuggers (pdb, gdb, node --inspect, etc.). More mature; UX varies by backend. -- Language-specific stacks — dap-mode (python-mode + dap), delve for go, ts-node --inspect, etc. Best per-language UX; most config work. - -F5 itself will be simple (start/resume debug). Likely modifier variants once the backend is picked: -- C-F5 toggle breakpoint at point -- M-F5 eval expression in debug context (or step-over shortcut) - -Evaluate against these projects' languages: elisp (edebug already works), Python, Go, TS, shell. Shell debug is usually print-based; skip. - -Do this after the F-key rework ticket ships so F5 is the only hole left. - -** TODO [#C] Review and rebind M-S- keybindings :refactor: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-21 -:END: - -Changed from M-uppercase to M-S-lowercase for terminal compatibility. -These may override useful defaults - review and pick better bindings: -- M-S-b calibredb (was overriding backward-word) -- M-S-c time-zones (was overriding capitalize-word) -- M-S-d dwim-shell-menu (was overriding kill-word) -- M-S-e eww (was overriding forward-sentence) -- M-S-f fontaine (was overriding forward-word) -- M-S-h split-below -- M-S-i edit-indirect -- M-S-k show-kill-ring (was overriding kill-sentence) -- M-S-l switch-themes (was overriding downcase-word) -- M-S-m kill-all-buffers -- M-S-o kill-other-window -- M-S-r elfeed -- M-S-s window-swap -- M-S-t toggle-split (was overriding transpose-words) -- M-S-u winner-undo (was overriding upcase-word) -- M-S-v split-right (was overriding scroll-down) -- M-S-w wttrin (was overriding kill-ring-save) -- M-S-y yank-media (was overriding yank-pop) -- M-S-z undo-kill-buffer (was overriding zap-to-char) - -** PROJECT [#C] Music Open Work -Parent grouping the open music / EMMS issues; close each child independently. -*** VERIFY [#C] music: extract faces for music config :refactor:quick:solo:next: -Needs from Craig: this is theme-side work, not a config edit — the music-config faces were already stripped (2026-06-14), so "extracting" them means DEFINING them in the theme (theme-studio JSON / build-theme) for playlist name, status, the per-button on/off pair, per-key symbol+text, and other labels. That needs the actual color choices and which theme(s) to add them to. Give me the palette intent (or say "pick sensible defaults in WIP") and I'll add the face definitions. -Pull the music-config faces out to the theme (the config no longer defines faces directly): playlist name, status (paused, etc.), two mode colors per "button" (on vs off), a per-key symbol+text color, and a color for all other labels. Pairs with the 2026-06-14 face-stripping work (music-config faces were removed there and are currently undefined until the theme defines them). From the roam inbox 2026-06-15. -*** TODO [#C] music: show song information in the modeline :feature: -Show basic song information in the modeline, with streaming-source support too. Write a spec for this one first. From the roam inbox 2026-06-15. -*** TODO [#C] Internet radio now-playing song :feature: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-11 -:END: -Show the currently-playing song while streaming an internet radio station. Lives in =modules/music-config.el= (EMMS + MPV backend, M3U radio stations). The track title comes from the stream's ICY metadata — EMMS exposes it via =emms-track-description= / =emms-playing-time= and updates it on the metadata-change hook; MPV reports the ICY title too. Add an option to show the song in the minibuffer (e.g. echo on track change, or an on-demand command). Consider also a mode-line indicator as a second surface. - -*** VERIFY [#C] music-config option-combination audit + tests :test:next: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-06 -:END: -Deferred from the batch — this is a sizable test-writing audit (pairwise option combinations + new ERT coverage for music-config), better as its own focused /add-tests or /pairwise-tests session than crammed into a bug-fix sweep. No blocker; say the word and I'll run /pairwise-tests over the option space. - -Two-part task surfaced 2026-05-28 during the Signel verify walk — generalized from the "are there combinations of options that we'd want to disallow together" question. - -Part 1 — enumerate the configurable option surface of =modules/music-config.el=: every =defcustom=, every behavior toggle, every backend-selection variable, every cross-cutting flag (auto-play, repeat, shuffle, follow-cursor, side-window-height-fraction, etc.). Audit each option for valid value ranges. Capture the matrix in =docs/design/music-config-options.org= (or inline in the test file's header — judgment call when the matrix lands). - -Part 2 — combinatorial test coverage. Use the =/pairwise-tests= skill: identify parameters, value partitions, and inter-parameter constraints, build a PICT model, generate the minimal test matrix that hits every 2-way combination. For each problematic combination the matrix surfaces, decide: (a) validate at config-load time with a =user-error= that names the conflict, (b) runtime guard in the affected command, or (c) doc-only warning in the option's docstring. Disallow only the genuinely-broken pairs; doc-warn the merely-confusing ones. - -The recent F10 side-window-height-fraction work and the EMMS-free refactor candidate ("Implement EMMS-free music-config architecture" above) are both natural near-term touchpoints — best to land this audit before the EMMS swap so the new architecture inherits a clean option spec. - -*** TODO [#C] Implement EMMS-free music-config architecture :refactor: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-01 -:END: -**** 2026-05-15 Fri @ 19:17:01 -0500 Specification -Implement the design in [[id:423bc355-18d3-4e39-9e7a-f768b865d95b][Design: music-config Without EMMS]]. - -The implementation should make =music-config.el= load without EMMS, introduce -package-owned playlist and track state, add a =cj/music-playlist-mode= view, -and route playback through a small backend protocol with an initial =mpv= -backend. Preserve the current F10 and =C-; m= user workflows where practical, -and keep M3U load/save/edit/reload plus radio station creation working. - -Complexity estimate: high. This is a module rewrite with a new internal data -model, package-owned playlist mode, backend protocol, mpv process management, -and migration of existing EMMS-backed commands/tests. - -Time estimate: 2-4 focused days for an EMMS-free v1 with play/stop/next/previous, -M3U persistence, playlist UI, and focused tests. Add another 1-2 days if v1 -must include full mpv IPC support for pause, seek, and volume parity. - -Acceptance checks: -- =music-config.el= can be required in batch with no EMMS package installed. -- Existing focused music tests pass without EMMS preload or EMMS stubs except - where a compatibility adapter is explicitly under test. -- New tests cover playlist state, backend command dispatch, M3U persistence, - and the EMMS-free load smoke path. - -**** TODO [#B] Pure helpers + state structs extraction :refactor: -Lift EMMS-free pure code into standalone form: file validation, recursive -collection, M3U parse/write, safe filenames, radio-station content, and -URL/file track typing. Introduce =cj/music-track= and =cj/music-playlist= -cl-structs plus state-mutation helpers (=cj/music-playlist-*= predicates and -setters). Files: =modules/music-config.el=, possibly a new -=modules/music-state.el= split. Existing pure-helper tests should pass -unchanged. - -Acceptance: structs defined, helpers callable in batch without EMMS loaded. - -Depends on: none (start here). - -**** TODO [#B] Backend protocol + fake test backend :refactor:test: -Define the backend plist contract (=:available-p :play :pause :resume :stop -:seek :volume :status :metadata=) and =cj/music-current-backend=. Add -=cj/music-state-change-functions= abnormal hook with the v1 event set -(=started=, =paused=, =resumed=, =stopped=, =finished=, =error=, -=playlist-changed=, =mode-changed=). Create =tests/testutil-music-backend.el= -exposing =cj/test-music-fake-backend= with an event ledger. - -Acceptance: fake backend installable in tests; ordered-event assertions work -against a no-op playback flow. - -Depends on: pure helpers + state structs. - -**** TODO [#B] Read-side state API + characterization tests :test:refactor: -Implement =cj/music-playing-p=, =cj/music-paused-p=, =cj/music-current-track=, -=cj/music-playlist-state=, =cj/music-track-description=. Before rewriting -command bodies, add characterization tests against current behavior for -=cj/music-next=, =cj/music-previous=, =cj/music-toggle-consume=, -=cj/music-playlist-toggle=, =cj/music-playlist-load=, =cj/music-playlist-clear= -so the migration has a safety net. - -Acceptance: read-side helpers covered; characterization tests green against -the current EMMS-backed implementation. - -Depends on: backend protocol + fake test backend. - -**** TODO [#B] Playlist major mode + render-from-state :feature: -Add =cj/music-playlist-mode= rendering the buffer as a view over -=cj/music-current-playlist=. Selected-track overlay + face, header reads -package state, full keymap from design Section "Playlist Buffer" (RET/p, SPC, -s, >/<, f/b, +/=/-, a, A, c/C, L/S/E/g, r/t/z/x, Z, i, o, q, S-up/down). -Preserve the active-window background highlight. - -Acceptance: opening the playlist renders package state; reorder/shuffle/clear -go through state mutations and re-render; tests cover header + overlay -positioning. - -Depends on: read-side state API. - -**** TODO [#B] mpv backend implementation :feature: -Implement =cj/music-mpv-*= backend functions. Phase the work per migration -plan §5: (a) process spawn, UID/PID-stamped socket under -=temporary-file-directory=, stale-socket sweep, IPC connect via -=make-network-process :family 'local=, state-hook plumbing. (b) play/stop/ -next/previous + finished-track auto-advance with deliberate-stop tracking. -(c) pause/resume, seek, volume over JSON IPC. (d) metadata read on track -start. Add =cj/music-doctor= reporting platform capabilities; ship Windows -degraded mode (play/stop/next/previous only via stdin/=call-process=). - -Acceptance: integration tests tagged =:slow= and skipped when =mpv= not on -PATH; on Linux/macOS pause/seek/volume parity works; clean socket lifecycle -across Emacs restart and exit. - -Depends on: backend protocol + fake test backend. - -**** TODO [#B] Command + Dired/Dirvish rewire :refactor: -Migrate user-facing commands (=cj/music-play=, =cj/music-pause=, -=cj/music-stop=, =cj/music-next=, =cj/music-previous=, seek/volume, -random/repeat/consume/shuffle toggles) to operate on package state and call -=cj/music-current-backend=. Update Dired/Dirvish =+= add routing, -M3U load/save/edit/reload, radio-station creation, F10 toggle, and =C-; m= -keymap entries to drop EMMS symbols. Migrate command-flow tests to the fake -backend. - -Acceptance: full keymap functional end-to-end against the fake backend; -characterization tests still green; Dirvish =+= add path covered. - -Depends on: playlist major mode + mpv backend. - -**** TODO [#B] EMMS removal + parity walk :test: -Remove =cj/emms--setup=, the on-demand EMMS loader, and the =use-package emms= -block. Add the EMMS-free batch-load smoke test (=music-config.el= requires -clean without EMMS installed). Run the 22-step parity walk from design -§"Parity Walk" against the new implementation; record measurements against -the performance budget (1000-track load <500ms, reorder <50ms, IPC dispatch -<100ms, header refresh <16ms) and note any deviations. - -Acceptance: =init.el= loads cleanly without EMMS; =make test= passes; parity -walk recorded as a completion log entry under the parent task. - -Depends on: command + Dired/Dirvish rewire. - -** PROJECT [#C] Calibre Open Work -:PROPERTIES: -:LAST_REVIEWED: 2026-06-06 -:END: -Parent grouping the open Calibre / ebook-workflow issues; close each child independently. The EPUB reading-width tasks were already resolved (2026-05-12/14). - -*** 2026-06-12 Fri @ 07:34:05 -0500 Calibre bookmark naming ships "Author, Title" from the filename -When I hit m in calibre, I'm making my place in the book with a bookmark. -While sometimes, the books look fine: "The A.B.C. Murders - Agatha Christie.epub" -Sometimes they look not so good: Engines of Logic_ Mathematicians and the O - Martin Davis.pdf or Software Architecture_ The Hard Parts _ Mo - Neal Ford.pdf - -What I would like to do is to have the bookmarks be saved in the following format: - -Author, Title [no extension]. Underscores should be stripped. - -Root cause: in a nov buffer =m= is =bookmark-set= (rebound at calibredb-epub-config.el:311); nov's =nov-bookmark-make-record= names the record =(buffer-name)= -- the EPUB filename. - -Implemented 2026-06-06. Source decision: parse the *filename*, not the embedded EPUB metadata -- under Calibre's "<Title> - <Author>.epub" naming the filename is more complete (the embedded metadata had truncated titles, author-sort "Last, First" forms, and lost punctuation; see the separate metadata-cleanup task). A =:filter-return= advice on =nov-bookmark-make-record= rebuilds the name from the record's filename: split on the last " - " into title/author, restore the colon Calibre sanitized to "_ " (-> ": "), reorder to "Author, Title". Pure helpers =cj/--nov-clean-title= + =cj/--nov-bookmark-name-from-file= in =modules/calibredb-epub-config.el=; 10 ERT tests in =tests/test-calibredb-epub-config--bookmark-name.el=. Live in the daemon. - -Existing bookmarks: the 3 nov bookmarks in =~/sync/org/emacs_bookmarks= were renamed by hand (one-pass, in the daemon + saved; backup at =emacs_bookmarks.bak-2026-06-06=): "Edward Kanterian, Frege: A Guide for the Perplexed", "Agatha Christie, The A.B.C. Murders", "Edward Abbey, The Fool's Progress: An Honest Novel". - -Manual verify filed under the Manual testing and validation parent. - -*** 2026-06-12 Fri @ 07:34:05 -0500 Curated Calibre keybinding menu + docked description shipped -Relocated from the global capture inbox 2026-06-06. Want a discoverable set of keybindings (visible in which-key) for the most frequent calibredb workflows: -- Switch to a library (e.g. Literature), sort by last name, scroll the list. -- Scope/filter the list in place, keeping the current library scope: - - by format (e.g. epubs only) - - by author last name (exact == or ^begins-with some text) - - sort by title, publication date, or group by format -- One key pops up the selected book's description in a bottom-30% buffer, dismissed with q (same display pattern as the signel chat dock). -- RET opens the book in the appropriate viewer. -Survey finding 2026-06-06: calibredb already binds almost all of this in calibredb-search-mode-map (S/L library, g filter [f format, a author, t tag, d date], o sort [t title, a author, p pubdate, f format], RET open) and even ships transient menus (? = calibredb-dispatch, g, o). The real problem was discoverability -- they are top-level single keys (which-key never pops up) and Craig didn't know ? opened a menu. calibredb-quick-look is macOS-only; the detail view (v -> *calibredb-entry*, q quits) is the description but opens full-window. - -Implemented 2026-06-06 in =modules/calibredb-epub-config.el=: -- A curated transient =cj/calibredb-menu= (library switch; filter format/author/reset; sort author/title/pubdate/format; open; describe; H = full calibredb-dispatch) bound to =?= in calibredb-search-mode-map. calibredb's own full dispatch moved to =H=. Defined in the use-package =:config= (needs the elpa transient, which batch doesn't load) -- the "? brings up a curated help menu" convention. -- Bottom-30% description dock: =calibredb-show-entry-switch= -> =pop-to-buffer= + a =display-buffer-alist= rule for =*calibredb-entry*= (display-buffer-at-bottom, height 0.3); =cj/calibredb-describe-at-point= shows the entry without switching focus so q dismisses it. Same pattern as the signel chat dock. -1 ERT test (the describe command; the transient/bindings/dock need the elpa transient + live calibredb, verified in the daemon). Author "begins-with" is covered well enough by g a's completing-read over "Last, First"; a true regex filter was not built. Manual verify filed under the Manual testing and validation parent. - -*** TODO Embed Calibre DB metadata into the EPUB files -Surfaced 2026-06-06 while building the bookmark naming: the metadata embedded in the EPUB files' OPF is worse than Calibre's database metadata. nov reads the embedded OPF and got truncated titles ("Frege" vs the filename's "Frege: A Guide for the Perplexed"), author-sort "Last, First" forms ("Christie, Agatha"), and lost punctuation ("A.B.C." -> "A B C"). The filenames (from Calibre's curated DB) are the good copy. Fix on the Calibre side: select all (or by library), run "Edit metadata -> Embed metadata into book files" so the DB metadata is written into each EPUB's OPF. Consider auditing author vs author_sort first. After embedding, the in-file metadata matches the library and any tool reading the files (nov, other readers, re-imports) gets the good data. Not an Emacs task; Calibre-side bulk maintenance. - -** PROJECT [#C] 2026-06 full config audit — findings backlog :refactor: -Module-by-module review of all 121 modules + init/early-init, holistic passes (startup/perf, stability, UX consistency, package strategy), and spin-offs into pearl, chime, emacs-wttrin. Method: parallel read-only review agents per module group; key claims spot-verified (incl. against the live daemon) before filing. Run 2026-06-11/12, COMPLETE. Tally: ~165 module findings + ~40 holistic + 30 spin-off ≈ 235 total; 40 high-impact bugs filed as standalone tasks above this parent; the rest live in the group children below. Spin-off findings delivered as inbox handoffs to pearl, chime, and emacs-wttrin (2026-06-12-0057). Start with the synthesis child below for the recommended attack order. - -*** Synthesis: the overall picture and attack order -Six cross-cutting themes, then the order I'd work them. - -Themes: -1. Performance has one systemic lever, not many small ones: native-comp is accidentally OFF config-wide and GC sits at the stock 800KB ([#A] task). Daemon init itself is healthy (1.11s measured). Fix the lever before any micro-deferral work, and before burning time on the org-capture-perf debug. -2. A "dangerous defaults" safety cluster: yes-or-no-p fset (single-keystroke shutdown/file-destruction), the silently-failing Wayland lock screen, erc-yank's public gists, mu4e's broken trash/refile on the primary account. All four are [#A]/[#B] standalones; do these first — they're where the config can actually hurt you. -3. Calendar/agenda data correctness: calendar-sync's RFC trio (vanishing final occurrences, resurrected cancelled meetings, collapsed multi-day events) + agenda sources missing roam Projects. Meetings are missed over this. -4. Recurring mechanical defect classes worth sweeping as one commit each, config-wide: use-package :hook "-hook" suffix trap (org-babel, eshell, latex); eval-when-compile-only requires read at runtime (auth-config, keyboard-macros, erc-config); M-S-<letter> bindings vs uppercase events (4 dead keys + 1 asymmetry); raw C-; entries bypassing cj/register-prefix-map (8 modules); unreachable modules (prog-lsp, ledger-config, show-kill-ring, mu4e-org-contacts-setup); config for package versions long gone (mu4e 1.7 block, dashboard override, org timeline, checkdoc-arguments). -5. The test suite has a blind-spot class: characterization tests asserting BROKEN output (reverse-lines, heavy-box, undo-kill's explicit 0), unit tests hand-building data that hides integration mismatches (F7 coverage paths), and an integration gate that prints green over "Ran 0 tests" (chime). When fixing any standalone bug above, fix its test to assert correct behavior — and consider extending the architecture smoke test to mechanically pin the class-4 sweeps (hooks must be bound after load, no raw C-; binds, no M-S-<letter> specs, no eval-when-compile requires of runtime vars). -6. Consistency wants conventions, not patches: one notification facade (cj/notify — messenger spec addendum already covers the messenger half), one confirmation tier (the fset fix), one prefix-registration mechanism with labels, one buffer-naming shape. The messenger-unification registry mindset generalizes. - -Attack order: (a) the three [#A]s + gptel-shadow (it's blocking the filed gptel-magit investigation); (b) the daily-data pair — mail trash/refile + calendar RFC trio; (c) the :quick:solo: standalone sweep — roughly 20 one-to-five-line fixes, a satisfying solo batch; (d) the class-4 mechanical sweeps, one commit per class, each with its smoke-test guard; (e) the consistency conventions, opportunistically as those modules get touched. - -*** TODO Findings: foundation/system group -From agents 2026-06-11; spot-verified sample. Remaining findings beyond the standalone bug tasks: -- [BUG] =keyboard-compat.el:121= — terminal arrow-key fix runs once on emacs-startup-hook; =input-decode-map= is terminal-local, so =emacsclient -t= frames under the daemon never get it. Register on =tty-setup-hook= (GUI half already uses =server-after-make-frame-hook=). -- [BUG] =config-utilities.el:142= — =cj/recompile-emacs-home=: =(boundp 'native-compile-async)= is always nil (it's a function — needs =fboundp=), so native compilation is never selected; and the helper deletes =<dir>/eln= when the real cache is =eln-cache/= (derive from =native-comp-eln-load-path=). Extend the existing test. -- [BUG] =system-utils.el:94= — success message args swapped: prints "Running notes.txt on mpv...". Trivial; wired into dirvish (O) and calibredb so it shows regularly. -- [REMOVE] =local-repository.el:51= — =localrepo-initialize=, its three defcustoms, and unprefixed =car-member= are dead; early-init owns archive setup with its own divergent path constant. Shrink to =cj/update-localrepo-repository= pointed at early-init's =localrepo-location=. -- [REMOVE] =keybindings.el:146-147= — C-x C-f unset/reset is a no-op (already find-file); comment wrong. Delete or retarget. -- [COVERAGE] =local-repository.el= — only module in the group with no test file. - -*** TODO Findings: UI core group -From agents 2026-06-11; spot-verified sample. Remaining findings beyond the standalone bug tasks: -- [BUG] =font-config.el:262= — emojify =:defer 1= means :config runs before any daemon GUI frame exists; =env-gui-p= picks ='unicode= permanently, GUI frames never get image emojis. Compute per-frame (=server-after-make-frame-hook=) or test =(daemonp)=. -- [BUG] =font-config.el:283= — =cj/display-available-fonts= errors on second invocation: first call's =special-mode= sets read-only; next call's erase/insert signals. Wrap in =inhibit-read-only=. (Also [COVERAGE]: untested — a call-twice test catches it.) -- [UX] =undead-buffers.el:82= — =cj/kill-other-window= in a single-window frame kills the buffer you're looking at (other-window no-ops; only delete-window is guarded). Add the sibling's =(user-error "No other window")= guard. -- [UX] =undead-buffers.el:48= — C-u C-x k silently marks a buffer undead (then it refuses to die with no explanation later). Undocumented mode-switch inside a core-command remap; document or split into its own command. -- [ENHANCE] =ui-theme.el:87= — theme persistence silently fails on a fresh machine until =persist/= exists; =make-directory= before the writability check. -- [REMOVE] =dashboard-config.el:32-58= — =dashboard-insert-bookmarks= override is dead code: the :demand t require lets upstream dashboard-widgets.el redefine it; behavior survives only because upstream natively honors the settings now. Delete. -- [REMOVE] =font-config.el:199-220= — all-the-icons stack (2 =:demand t= packages + unprompted network font install on fresh machines) likely redundant with nerd-icons everywhere; verify keyboard-compat's reference then drop. -- [REMOVE] =ui-config.el:185= — duplicate =(use-package nerd-icons :defer t)= stanza; nerd-icons-config owns it. Delete stanza + stale Commentary bullet. - -*** TODO Findings: buffer/window libs group -From agents 2026-06-11; spot-verified sample. Remaining findings beyond the standalone bug tasks: -- [REMOVE] =show-kill-ring.el= — loaded by nothing (init require deliberately removed in b785a19d), so its M-S-k binding is dead; =keyboard-compat.el:177= still installs the M-K → M-S-k translation whose only purpose was this module. Re-add or delete module + stale translation/comment (consult-yank-pop largely supersedes it). -- [UX] =selection-framework.el:38= — =vertico-sort-function= custom is dead config: =vertico-prescient-mode= (line 250) replaces sorting when it activates. Pick one policy (drop the custom, or =vertico-prescient-enable-sorting nil=). -- [BUG] =custom-buffer-file.el:486= — =cj/view-email-in-buffer= leaks MIME handles when no displayable part: =user-error= fires before =mm-destroy-parts=. unwind-protect. -- [ENHANCE] =custom-buffer-file.el:49= — eager =(require 'mm-decode)= at startup only for macro expansion; runtime require already exists at line 481. Make it =eval-when-compile=. -- [UX] =custom-buffer-file.el:221= — =cj/copy-link-to-buffer-file= is a silent no-op in non-file buffers while siblings signal =user-error=. Match them. - -*** TODO Findings: editing helpers group -From agents 2026-06-11; spot-verified sample (jump-paren, sortable-time confirmed). Beyond the standalone heavy-box task: -- [BUG] =custom-misc.el:48= — jump-to-matching-paren with point ON a closer lands at the last inner sexp, not the opener (batch-verified). =(forward-char)= before =(backward-sexp)= in the char-after-closer case; the test only covers the after-closer position. -- [BUG] =custom-datetime.el:71= — "sortable" time format is 12-hour ="%I:%M:%S %p %Z"= — "01:00:00 PM" sorts before "09:00:00 AM". Should be ="%H:%M:%S"=. -- [BUG] =custom-comments.el:82= — =cj/comment-reformat= prints "No region was selected" even on success (message outside the if-else), and the fill-column shrink/restore isn't unwind-protected — an error leaves fill-column permanently -3. Use let-binding + =user-error=; also =mark-active= vs the config's usual =use-region-p=. -- [BUG] =custom-line-paragraph.el:52= — join-line-or-region without region inserts a spurious blank line mid-buffer (verified); only insert the newline at eobp. -- [BUG] =custom-line-paragraph.el:77= — duplicate-line-or-region splits a mid-line-ending region via open-line and duplicates an extra empty line when the region ends at bol. Normalize bounds to whole lines. -- [BUG] =custom-ordering.el:158= — reverse-lines and number-lines mishandle the trailing newline ("a\nb\n" → "\nb\na"); the trailing-newline test asserts the broken output. =cj/--arrayify= (line 43) has the correct pattern — apply it; fix the characterization test. -- [BUG] =custom-comments.el:152= — inline-border lines come out 2 chars short for even-length or empty text (parity computed from text length instead of remaining width); stacked dividers misalign. -- [UX] =custom-text-enclose.el:216= — indent-lines =(interactive "p\nP")= couples COUNT and USE-TABS to one prefix arg — multi-column space indent is impossible interactively; docstrings claim "default 4" but "p" defaults to 1 (same in dedent :256). -- [REMOVE] =custom-ordering.el:90= — =cj/arrayify-python= is byte-identical to =cj/arrayify-json= (two bindings, same output). Delete one or differentiate (single quotes for Python). -- [UX] =custom-case.el:66= — title-case contradicts its docstring: "is" is in word-skip despite "linking verbs are major words"; no sentence-restart capitalization after periods; no capitalize-last-word rule. Align list + docstring. - -*** TODO Findings: text/prose tools group -From agents 2026-06-11. Beyond the standalone markdown/latex tasks: -- [BUG] =text-config.el:72= — "M-S-i" for edit-indirect-region is unreachable: Meta+Shift+i generates the event M-I, not M-S-i, so the keypress falls back to M-i tab-to-tab-stop. Rebind as "M-I" (the "was M-I" comment thought the rename was a no-op; it wasn't). -- [BUG] =keyboard-macros.el:46= — user-constants required only =eval-when-compile= but =macros-file= is read at runtime; works only because init.el loads user-constants first. Plain require (same trap as auth-config). -- [BUG] =keyboard-macros.el:137= — kill-emacs-hook fires =y-or-n-p= + an interactive name prompt whenever any last-kbd-macro exists — hazardous for daemon/systemd shutdown (no one to answer) and noisy for throwaway macros. Guard =(and last-kbd-macro (not noninteractive))= minimum; consider dropping the prompt (M-F3 already persists named macros). -- [BUG] =lorem-optimum.el:221= — empty Markov chain (missing assets/liber-primus.txt) makes =cj/lipsum-insert= do =(insert nil)= — cryptic wrong-type error far from cause. Signal =user-error= naming the fix; also Commentary advertises "M-x cj/lipsum" but it has no interactive spec. -- [UX] =flyspell-and-abbrev.el:230= — every C-' press re-runs =flyspell-buffer= over the whole buffer while flyspell-mode is off (the documented word-by-word workflow = O(buffer) per keypress in large files). Call =cj/flyspell-on-for-buffer-type= so the mode sticks and the scan runs once. -- [ENHANCE] =text-config.el:121= — accent is wired to the company backend (=accent-company=); the filed Company→Corfu migration task doesn't list it, so C-` breaks silently post-migration. Add to the migration scope or switch to =accent-menu= now. - -*** TODO Findings: org core group -From agents 2026-06-11; spot-verified sample (dailies head, babel hook, void bindings confirmed). Beyond the standalone tasks: -- [BUG] =org-babel-config.el:27= — =:hook (org-babel-after-execute-hook . org-redisplay-inline-images)= gets a second "-hook" appended (symbol unbound at expansion, doesn't end in -mode) → registers on nonexistent =org-babel-after-execute-hook-hook=; inline dot-graph images never refresh after C-c C-c. Write =(org-babel-after-execute . ...)= or add-hook in :config. -- [BUG] =org-roam-config.el:67,71= — C-c n p / C-c n w bound (and which-key-labeled) to =cj/org-roam-find-node-project= / =-webclip=, defined nowhere — keypress errors "autoloading failed to define function". Define via =cj/org-roam-find-node= (a project template exists) or drop bindings + labels. -- [BUG] =org-export-config.el:74-81= — ox-texinfo block can never run (=:defer t=, no trigger, excluded from line-47 dolist and =org-export-backends=); commentary still advertises Texinfo. Add to the dolist or delete; also commentary says "subtree default scope" vs actual ='buffer= (line 61). -- [UX] =org-roam-config.el:50-63= — two parallel template dirs drift: :custom templates read =~/.emacs.d/org-roam-templates/= while find-node-topic/recipe read =roam-dir/templates/= — overlapping recipe/topic/v2mom files, edits don't propagate. Pick one canonical dir. -- [REMOVE] =org-agenda-config.el:84= — dead =timeline= entry in org-agenda-prefix-format (removed in org 9.1). Also =org-config.el:47-48= — the TASK note claiming =org-indent-indentation-per-level= "doesn't exist" is wrong (real org-indent defcustom); restore the setq or fix the comment. -- [REMOVE] =org-babel-config.el:161= — =org-html-footnote-separator= is an ox-html setting parked in the babel module with a wrong comment; =org-roam-config.el:76= similarly hides =org-agenda-timegrid-use-ampm= in roam's :config (only takes effect after roam loads). Move both to their owning modules. -- [REMOVE] =org-roam-config.el:363-390= — 28-line commented consult-org-roam block on a TASK comment; its proposed C-c n l / C-c n r now collide with live bindings, so it can't ship as written. Decide + delete (git keeps the draft). -- [COVERAGE] =org-agenda-config.el:423= cj/add-timestamp-to-org-entry (defvar-inside-defun smell), =org-roam-config.el:115,185= node-insert-immediate + finalize-hook — untested. - -*** TODO Findings: org apps + calendar-sync group -From agents 2026-06-11/12; spot-verified sample (UNTIL comparisons, EXDATE regex, drill setq confirmed). Beyond the standalone tasks: -- [BUG] =org-reveal-config.el:241= — seven raw =global-set-key= "C-; p ..." calls carry a hidden load-order dependency on keybindings.el (signals "non-prefix key" otherwise); every sibling uses =defvar-keymap= + =cj/register-prefix-map=. Convert. -- [BUG] =org-drill-config.el:131= — =:load-path "~/code/org-drill"= dev checkout breaks drill on machines without it (velox already diverges per the gptel-magit task). Guard with =file-directory-p= fallback to :vc. -- [UX] =org-contacts-config.el:146= — =cj/org-contacts-find= visits the file BEFORE prompting (C-g strands you at point-min) and plain =search-forward= can match body text in another entry. Collect heading positions in org-map-entries, goto after prompt. -- [REMOVE] =calendar-sync.el:1240= — =calendar-sync--fetch-ics= (buffer-string variant) is dead; the sync path uses the temp-file variant exclusively. 30 lines of duplicate curl/sentinel logic that will drift. -- [REMOVE] =org-webclipper.el:216-241= dead commented keymap blocks; =org-contacts-config.el:118-124= commented duplicate capture template flagged "TASK: duplicate?!?". Delete both (git keeps drafts). -- [COVERAGE] =calendar-sync.el:1274= — fetch sentinel branches (curl failure, temp-file cleanup, signal exit) untested; dispatch tests stub above this layer. - -*** TODO Findings: mail group -From agents 2026-06-12; spot-verified sample (cmail trash gap, no refile folders, gmail-first contexts confirmed). Beyond the standalone [#A] task: -- [BUG] =mail-config.el:392-407= — C-; e account nav lambdas call =mu4e-search=, not autoloaded — void-function before first mu4e launch. Add to :commands or require first. -- [BUG] =mail-config.el:481-484= — unconditional =org-msg-edit-mode= :after advice on replies defeats the =(reply-to-text . (text))= alternative at :459 and re-runs a major mode org-msg already set up. Gate or remove. -- [BUG] =mu4e-attachments.el:222= — the *mu4e attachments* selection buffer saves through stale MIME handles if the view changed before s — errors or saves the wrong message's parts. Check =buffer-live-p= per handle at save. -- [BUG] =mail-config.el:329= — "save attachment" in =mu4e-headers-actions= can't work from headers (MIME vars are view-buffer-local, nil in headers-mode). Drop it there. -- [BUG] =mail-config.el:282-305= — HTML view block sets variables obsolete since mu4e 1.7 (installed 1.14.1): =mu4e-view-prefer-html=, =mu4e-html2text-command= (also set twice: 186, 285), =mu4e-view-show-images=, =mu4e-view-image-max-width=. The pandoc/w3m selection never runs; shr renders regardless. Delete the dead block (image/privacy reconciliation already filed separately). -- [BUG] =mail-config.el:45-49,80-89= — top-level =(defvar message-send-mail-function nil)= pre-empts message.el's defcustom default; with msmtp absent the fallback leaves it nil → "invalid function: nil" on first send. Explicit =smtpmail-send-it= fallback or descriptive user-error. -- [UX] =mail-config.el:171,196-199= — =pick-first= + gmail listed first makes gmail the startup context though cmail reads as primary everywhere else — quiet wrong-account hazard for the first compose. Reorder contexts. -- [REMOVE] =mu4e-org-contacts-setup.el= — unreachable (nothing requires it; mail-config calls activation directly) and its featurep gate would be nil at init anyway. Delete or fold its two setqs into mail-config. -- [REMOVE] =mail-config.el:208,232= — =mu4e-starred-folder= isn't a mu4e variable (invented, no effect); =:174= =mu4e-maildir= is the obsolete alias of root-maildir set on the previous line. Drop all three. -- [REMOVE] =mu4e-org-contacts-integration.el:158,171-172= — hook surgery on =mu4e--compose-setup-completion= is a no-op on mu4e 1.14 (called directly, not via hook; already gated by the var activation sets). Delete both hook calls. -- [COVERAGE] =mu4e-attachments.el:101-105= — mid-batch save-failure path and stale-handle scenario untested. - -*** TODO Findings: messengers group -From agents 2026-06-12. Beyond the standalone tasks; several feed the messenger-unification spec: -- [BUG] =signal-config.el:201= — contact cache docstring claims "cleared on signel-stop/restart"; nothing clears it (grep: fork never references it). Stale list after relink/reconnect. Advise =signel-stop= or clear on start. -- [BUG] =signal-config.el:298= — fetched-and-empty contact list is indistinguishable from cold cache (nil), so a zero-contact account re-runs the blocking fetch (up to fetch-timeout) on every C-; M m. Cache a sentinel. -- [UX] =slack-config.el:208= — =cj/slack-notify= lacks signel's hardening: no truncation (giant toasts), no sound gating, no notifications-notify fallback when the script is absent. Unification-relevant: extract a shared =cj/messenger-notify= (title prefix, truncation, sound flag, script-with-fallback) — noted in the unification spec. -- [ENHANCE] =telega-config.el:52= — telega has NO notification path (=telega-notifications-mode= not enabled); incoming Telegram messages invisible unless the buffer is on screen. Enable, or route through the shared notifier. Unification-relevant. -- [COVERAGE] — =cj/erc-join-channel-with-completion= (erc:148, four-way reconnect branching), =cj/erc-connected-servers= (would have caught the tautology), =cj/slack-notify= predicates, =cj/signel--ensure-started= branches — all untested. - -*** TODO Findings: programming group -From agents 2026-06-12; spot-verified sample (prog-lsp unreachable confirmed by grep). Beyond the standalone tasks: -- [BUG→FOLD] =prog-lsp.el= — the module is UNREACHABLE: nothing requires it, so its entire LSP policy (TRAMP guard, file-watch ignores, read-process-output-max, idle-delay 0.5) is dead while prog-general.el:388-416's older conflicting block wins (idle 0.1, lsp-ui-doc on). Fold this fact into the filed "Make prog-lsp.el the single owner of generic LSP policy" task — it doesn't currently record that prog-lsp never loads. -- [BUG] =flycheck-config.el:68-70= — =checkdoc-arguments= isn't a real variable (invented name + invented format); the intended checkdoc suppression has never worked. Use =flycheck-emacs-lisp-checkdoc-variables= or drop. -- [BUG] =prog-json.el:87-90= — C-c C-q → jq-interactively binding defers to eval-after-load of jq-mode, which nothing loads — dead key. Bind in =cj/json-setup= via local-set-key (jq-interactively IS autoloaded). -- [BUG] =prog-python.el:129-132= — lsp-pyright's :hook lambda calls =lsp-deferred= unguarded on the same hook as the guarded =cj/python-setup= — pyright-absent machines still get the LSP attach prompt the guard exists to prevent. Move the require into the guarded branch; delete the hook. -- [BUG] =prog-lisp.el:122-125= — =:after (flycheck package-lint)= waits for a manual M-x to load package-lint, so =flycheck-package-setup= effectively never runs. Hook on flycheck load + require inside. -- [UX] =prog-python.el:111-115=, =prog-go.el:111-114=, =prog-webdev.el:128-147= — setup hooks attach to ts-modes only (C/shell hook both variants); grammar-unavailable fallback to classic modes silently loses indent/keys/formatter/LSP. Add classic-mode hooks. -- [UX] =prog-webdev.el:165-173= — web-mode gets the format key but none of the promised setup (no company/flyspell/LSP in HTML buffers). Add to the setup hook or fix the Commentary. -- [ENHANCE] gopls, clangd, bash-language-server, shfmt, shellcheck lack the =cj/executable-find-or-warn= load-time warnings pyright/prettier have; prog-shell's =:if (executable-find ...)= evaluates once at startup and silently disables shfmt/flycheck setup forever. -- [REMOVE] =prog-training.el:36-37= — =(url-debug t)= turns on GLOBAL url.el debug logging once leetcode loads. Debugging leftover; delete. -- [REMOVE] =prog-webdev.el:85=, =prog-json.el:44=, =prog-yaml.el:39= — three byte-identical format-region helpers. Extract one shared tested helper (system-lib). - -*** TODO Findings: dev tooling group -From agents 2026-06-12; spot-verified sample. Beyond the standalone F7 task: -- [BUG] =vc-config.el:138-144= — =cj/goto-git-gutter-diff-hunks= (C-; v d) never did what it claims: consult-line over "^[+\\-]" matches source text, not gutter hunks. Build candidates from =git-gutter:diffinfos= or drop the binding (C-; v n/p covers it). -- [BUG] =dev-fkeys.el:116-122= — F4 compile+run one-shot hook installs on GLOBAL =compilation-finish-functions= before the prompt; C-g leaves it armed and the next unrelated compile triggers projectile-run-project. Use the buffer-local pattern the module already uses for cache-revert (same in =--f4-clean-rebuild-impl=:143). -- [BUG] =test-runner.el:84,222= — documented ~/.emacs.d/tests fallback doesn't exist (=cj/test-global-directory= defvar'd nil, never set); outside a project =(file-directory-p nil)= crashes in three commands. Initialize the defvar or guard with user-error. (Adds specifics to the open "Fix up test runner" task — fold.) -- [BUG] =test-runner.el:288= — focus-add prefix check lacks the trailing slash so =tests-scratch/= passes the "inside tests/" check; the correct helper =cj/test--file-in-directory-p= exists at :168 — use it. -- [BUG] =vc-config.el:217-219= — difftastic blame map binds D and S to the same command (show); D should be diff per the transient four lines down. -- [UX] =diff-config.el:37= — =ediff-diff-options "-w"= ignores ALL whitespace in every ediff session — indentation-only Python changes compare as identical. Drop the default; toggle per-session. -- [UX] =restclient-config.el:64-65= — raw global-set-key "C-; R n" hides a load-order dependency (header claims "Runtime requires: none"); use defvar-keymap + =cj/register-prefix-map= like siblings (same class as org-reveal, slack). -- [UX] =vc-config.el:196= — clipboard clone via synchronous =call-process= freezes every emacsclient frame for the whole clone. make-process + sentinel. -- [REMOVE] =vc-config.el:80-82= — phantom autoload =git-timemachine-show-selected-revision= (no such function in the package) appears in M-x and errors. Drop from :commands. -- [REMOVE] =httpd-config.el:19-30= — pointless =:defer 1= (impatient-mode loads simple-httpd on demand) + unprefixed eager globals =wwwdir=/=check-or-create-wwwdir= creating www/ on every startup. =:defer t=, prefix, or fold into markdown-config. -- [COVERAGE] — intersect/parse unit tests hand-build matching keys (the F7 bug's escape route); =--coverage-elisp-run='s compilation-finish wiring, goto-git-gutter-diff-hunks, timemachine candidate round-trip untested. F-key sweep clean: no collisions; F5 free for the debug-backend task. - -*** TODO Findings: shell/term/files group -From agents 2026-06-12; spot-verified sample (eshell nested list confirmed). Beyond the standalone tasks: -- [BUG] =dirvish-config.el:37= — =cj/xdg-open= attributed to system-utils in the require-comment but defined in external-open.el; neither dirvish-config nor dwim-shell-config (caller at :876) requires it — "Direct test load: yes" headers are false. Require external-open (or move the fn into external-open-lib) + fix comment. -- [UX] =tramp-config.el:73= — =revert-without-query '(".*")= kills revert confirmation for EVERY file in Emacs, buried in the TRAMP module. Scope to =tramp-file-name-regexp= or move deliberately to an editing module. -- [UX] =dirvish-config.el:403= — quick-access entries lx (~/archive/lectures), phl (~/projects/homelab), pn (~/projects/nextjob) point at directories that don't exist on this machine. Prune or create. -- [REMOVE] =dwim-shell-config.el:474,507= — open-externally (raw xdg-open) and open-file-manager (thunar/nautilus probe chain) duplicate cj/xdg-open (dirvish o) and cj/dirvish-open-file-manager-here (f); ascii-art references jp2a, the module's only absent binary. Delete the two duplicates; install jp2a or drop ascii-art. -- [REMOVE] =tramp-config.el:115= — custom =sshfast= method referenced nowhere (everything uses sshx); =tramp-own-remote-path= added twice (:39,:128); =dirtrack-list= and =magit-git-executable "/usr/bin/git"= are unrelated globals hiding here. Prune/relocate. -- [COVERAGE] — eshell visual-commands/xterm-color wiring and the dirvish mark-all loop had no load-and-assert tests (both standalone bugs above); TRAMP perf settings look sound for the DUET latency concern (attr caching, no remote VC, direct-async + controlmaster). - -*** TODO Findings: AI group -From agents 2026-06-12; spot-verified sample (string-model setq confirmed). Beyond the standalone tasks: -- [BUG] =ai-term.el:875= — close derives the tmux session name from =default-directory=, which ghostel retargets via OSC 7; after a cd the kill-session misses (orphaned agent session) or name-collides with a different aiv- session. Derive from the buffer name's immutable basename. -- [UX] =ai-term.el:827= — multi-window F9 toggle-off unconditionally delete-windows, never restoring the displaced edge-window buffer the Commentary (:24) and reuse-edge docstring (:521) promise. Restore when quit-restore still matches, or fix the docs to describe delete-window reality. -- [UX] =ai-conversations-browser.el:191= — browser load stubs =y-or-n-p= to nil, silently discarding an unsaved in-progress conversation (the direct C-; a l path offers to save). Give ai-conversations a file-arg internal instead of puppeting the interactive command via cl-letf; also the =(caar cands)= fallback loads the newest conversation on a filename mismatch — fail loudly. -- [ENHANCE] =ai-quick-ask.el:103= — dismiss mid-stream kills the buffer without =gptel-abort= — request keeps streaming to a dead buffer (wasted tokens). -- [NOTE] =ai-mcp.el= — unreachable from init, consistent with the paused Phase 1.5; add a one-line Commentary note ("not wired until Phase 2") so future audits don't re-flag, and revisit =cj/mcp-enabled-servers= defaulting to all nine servers before wiring. -- [COVERAGE] — load/autosave lifecycle untested (fresh-session load, timer self-cancel, close-buffer session-name derivation). - -*** TODO Findings: media/reading group -From agents 2026-06-12; spot-verified sample (M-S- bindings, eww store split confirmed). Beyond the standalone tasks: -- [BUG] =music-config.el:585= — =cj/music-add-dired-selection= gates =dired-get-marked-files= on =(use-region-p)= — but dired marks aren't a region; marked files are ignored, + adds only file-at-point. Drop the conditional (the function already falls back correctly). Note for the EMMS-free rewrite: dirvish + shadows =dired-create-directory= — deliberate decision needed before carrying it over. -- [UX] =media-utils.el:195-204= — =cj/yt-dl-it= watches tsp (which enqueues and exits), so "Finished downloading" fires immediately while yt-dlp may fail later, silently; also affects elfeed d. Message "queued" honestly or watch the real job (tsp -f). -- [UX] =browser-config.el:34-47,171= — first-run fallback picks EWW (first, "always available") over installed real browsers; fresh machines get org links in a text browser until cj/choose-browser runs. Prefer the first external match. -- [REMOVE] =video-audio-recording.el:442-488= — =cj/recording-group-devices-by-hardware= is dead code (nothing calls it) carrying a hardcoded "Jabra SPEAK 510 USB" branch. Delete + its test file. -- [REMOVE] =calibredb-epub-config.el:198-212= — =set-auto-mode= :around advice for .epub is redundant with nov's :mode registration (auto-mode-alist wins before magic-fallback); overhead + failure surface on every file visit. Remove and verify. -- [COVERAGE] — eww interactive commands (switch-search-engine, bookmark-quick-add, copy-url) and =cj/nov-center-images= untested. - -*** TODO Findings: apps/misc group -From agents 2026-06-12. Beyond the standalone tasks: -- [BUG] =hugo-config.el:49= — =cj/hugo-new-post= void-functions on =org-hugo-slug= in a fresh session (ox-hugo is :after ox, which loads on first export); =cj/hugo-export-post= already requires ox-hugo — do the same here. -- [BUG] =help-utils.el:73= — arch-wiki search signals raw file-missing when the docs dir is absent; the friendly install hint at :81 is unreachable. Guard with =file-directory-p= + user-error up front. -- [UX] =hugo-config.el:244= — eight raw global-set-key C-; h calls + hand-rolled which-key mutate cj/custom-keymap directly, against keybindings.el's own instruction. Convert to defvar-keymap + =cj/register-prefix-map= (same class as org-reveal, restclient, slack). -- [ENHANCE] =games-config.el:25= — =:defer 1= pulls malyon + 2048 into every session for nothing; use =:commands=. Also :config references =org-dir= without requiring user-constants (free-variable warning at byte-compile). -- [REMOVE] =wrap-up.el:29= — =elisp-compile-mode= doesn't exist (real mode emacs-lisp-compilation-mode derives from compilation-mode, already covered at :27); dead line. (The prior unguarded-timer fix is intact.) -- [REMOVE] =help-config.el:99-106= — stray empty :preface + dead commented Info-directory-list block. Delete. -- [NOTE] =duet-config.el= — orphaned BY DESIGN (Commentary documents pre-alpha staging; Stage 1 is the wire-in trigger). Audit record only. -- [COVERAGE] — help-config and help-utils have zero test files; the two broken paths above are exactly the untested branches. - -*** TODO Findings: holistic — startup & performance -From the 2026-06-12 holistic pass; daemon init measured at 1.11s (healthy). Beyond the standalone [#A] native-comp/GC task: -- [BUG→FOLD] the eager-org chain: =org-config.el:352= org-appear has no defer trigger (only :custom) → requires all of org at init; org-agenda (=:after org :demand t=) cascades; chime's =:demand t= pulls it anyway. org-config is the most expensive require (0.229s of 1.11s). Decide fully-eager vs fully-deferred — and =init.el:146='s "calendar-sync must come after org-agenda" contract exists only as a comment (three uncoordinated writers of =org-agenda-files=). Both facts belong in the filed defer-modules task before that refactor starts. -- [PERF] =dirvish-config.el:385-387= — =:defer 0.5= defeated by :init calling autoloaded =dirvish-override-dired-mode= → dirvish fully loads at init (0.072s, third most expensive; trace-confirmed). Own the eager load or defer the override to a dired-mode-hook shim. -- [PERF] timed =:defer N= loads unused packages into every start: simple-httpd (:1s + startup mkdir despite the defer), malyon, 2048-game, emojify (may hit network), ligature. Convert to :commands/mode hooks. -- [UX] =early-init.el:235-256= — synchronous =package-refresh-contents= on the startup path when any archive cache is >7 days old (MELPA ~6MB) — multi-second network-bound start, fires in batch too. Make async post-startup or push into the localrepo update script (distinct from the filed bootstrap-relocation task). -- [PERF] =early-init.el:228= — no =package-quickstart= with 184 packages; activation walks every package dir each start (~0.3s of early-init). Free win; regenerate after package ops. -- [PERF] =prog-general.el:298= — =yas-reload-all= immediately before =yas-global-mode= scans snippet dirs twice per start (doubled "[yas] Prepared..." message). Delete the line. -- [REMOVE] cross-ref: the all-the-icons stack (already in UI core findings) is 2 of the :demand t packages plus a per-frame install-check hook. - -*** TODO Findings: holistic — daemon stability -From the 2026-06-12 holistic pass. Architecture-level verdict good (timers cancelled/guarded, calendar-sync async well-contained, advice mostly named + guarded). Residual: -- [STABILITY] =transcription-config.el:293= — sentinel chain has no unwind-protect; =--append-to-log='s =insert-file-contents= signals if the log is missing → process buffer leaks, entry stuck 'running in the modeline forever, no notification. Extends the filed transcription standalone — fix together. -- [STABILITY] =calendar-sync.el:1646= — hourly timer body: fetch/parse guarded but the timezone check and =--require-calendars= run bare — any signal repeats hourly forever (the exact class fixed in four modules once). Condition-case the body; demote the hourly echo-area message to the silent log. -- [STABILITY] =music-config.el:865= — four anonymous-lambda advice in :config stack per live reload (verified: lambdas don't dedupe) and can't be advice-removed. Name the function. -- [STABILITY] =system-defaults.el:69= — =display-warning= advice appends to comp-warnings-log with no condition-case (unwritable path → every async comp warning signals from inside display-warning) and the log grows unbounded. Guard + cap. -- [STABILITY] =media-utils.el:164= — playback sentinel assumes the process buffer is alive (user killed *player:...* → sentinel error, diagnostics lost); sibling yt-dl sentinel shares the kill-buffer gap. buffer-live-p guards. -- [ENHANCE] =system-commands.el:86= — =#'ignore= sentinel + output to /dev/null makes failing lock/suspend indistinguishable from success — the user walks away from an unlocked machine. Message on nonzero exit. (Compounds the [#A] slock task: the broken lock currently fails through exactly this silent path.) -- [ENHANCE] =ui-config.el:153= — post-command cursor hook unguarded: any future signal self-removes it silently (cursor stops signaling modified/read-only until restart); frame-hook lambda also accumulates per reload. with-demoted-errors + name it. -- (kill-emacs-hook y-or-n-p prompt independently re-found here — already filed in the text/prose child; convergence noted.) - -*** TODO Findings: holistic — UX consistency -From the 2026-06-12 holistic pass. Verdict: more coherent than most 120-module configs (~85% prefix-helper adoption, M-S translation fully covers its 18 bindings, F-keys collision-free, DEF-arg prompts dominate). Beyond the standalone [#A] fset task: -- [BUG] notification env gate: =transcription-config.el:169-171= gates desktop notifications on =(getenv "DISPLAY")= — an X11 predicate that works only because XWayland exports it. Use =env-gui-p= (host-environment.el provides it). -- [UX] four notification stacks beyond the messenger split (notify script ± fallback, alert.el, raw notifications-notify, echo-only for calendar-sync/recording completions). Proposed: one cj/notify facade (transcription's =cj/--notify= is the right shape) — config-wide companion to the messenger-notify addendum in the unification spec. -- [UX] five more C-; entries bypass the register helpers or lack labels: =browser-config.el:182= (C-; B, no label), =org-babel-config.el:51= (C-; k, no label), =flycheck-config.el:62-64= (:bind into cj/custom-keymap), =pearl-config.el:43= (:bind-keymap C-; L, no label), =dev-fkeys.el:533= (helper but no label). Sweep onto cj/register-prefix-map with labels. -- [UX] user-error vs message inconsistent for "nothing to act on" config-wide (examples: =custom-whitespace.el:190=, =jumper.el:202=, =chrono-tools.el:99= message; =mu4e-attachments.el:112=, =ai-rewrite.el:79= user-error; =test-runner.el:392/394= mixes both 2 lines apart). Convention: user-error when the command can't proceed; message when it ran and found nothing. -- [ENHANCE] M-S translation layer: complete for GUI (18/18) but installs only on env-gui-p paths — terminal frames have no M-uppercase route; and =dwim-shell-config.el:932/934= binds M-S-d (dired) vs raw M-D (dirvish) asymmetrically. Feeds the filed M-S review task with the concrete map. -- [ENHANCE] which-key labels: register-helper's LABEL arg used by exactly 1 of 23 registrants (rest use separate with-eval-after-load blocks); label style drifts ("X menu" vs bare nouns). Adopt LABEL arg + one style. -- [ENHANCE] "?" curated-menu candidates (for the filed convention task): elfeed search/show, dirvish, signel chat/dashboard, music playlist, ai-conversations-browser, mu4e-attachments, transcription status, pearl. calibredb remains the model. -- [UX] ="(Cancel)"= pseudo-candidate in =music-config.el:253-256= vs C-g everywhere else (90+ prompts). Drop it. -- [UX] buffer-naming drifts across three conventions (*AI-Assistant* / *Kill Ring* / *dashboard*); pick Title Case + "*Name: param*", lowercase for process logs. -- [ENHANCE] C-; f formatter shadowing implemented 3 ways (:bind :map vs local-set-key in hooks); unify on :bind. Also =keybindings.el:21= commentary still says "C-c j" for the jump prefix the code binds at C-; j. -- [ENHANCE] initial-input anti-pattern at =dwim-shell-config.el:661,680= and =erc-config.el:176-177= against the config's DEF-arg norm. - -*** TODO Findings: holistic — package strategy -From the 2026-06-12 holistic pass (184 elpa dirs). Core stack modern (vertico/consult/embark/orderless, treesit-auto, built-in which-key, current magit/forge/telega/slack). Beyond the standalone gptel/prescient tasks: -- [REMOVE] true orphans, nothing references them: js2-mode, tide, json-mode (pre-treesit JS stack). package-delete + drop from .localrepo. -- [REMOVE] emojify: 2021 snapshot, dormant upstream, crashes in lui (slack disabled it), Emacs 30 renders emoji natively. Drop the use-package + hooks (=font-config.el:253=, =erc-config.el:211=); it stays on disk only as slack's declared dep. -- [BUG] legacy-mode hooks miss the ts modes: =prog-general.el:91-92= hooks =yaml-mode-hook=/=toml-mode-hook= but the config runs yaml-ts/toml-ts — general prog settings silently don't apply in YAML/TOML buffers. Rehook; delete toml-mode + eldoc-toml + yaml-mode packages (superseded by treesit). -- [RISK→FOLD] localrepo priority 200 is absolute, so package-upgrade silently no-ops on everything mirrored — the engine that fossilized emojify@2021/toml-mode@2016/js2@2023. The filed refresh-script task at [#D] deserves [#B] + a quarterly cadence, else every orphan finding regrows. -- [RISK] fork fleet sync-back stories: org-drill flip back to :vc when done (filed dev-checkout finding); auto-dim-other-buffers local checkout with :vc commented — decide its home; org-msg pins =:rev :newest= (unpinned moving target) — pin a known rev. signel/duet/pearl/wttrin/gloss/chime self-owned remotes are fine. -- [UPGRADE] wiki-summary (2018, dead upstream, predates Wikipedia's REST API; sole caller help-utils) — the audit's one write-your-own: ~30-line url-retrieve against the REST summary endpoint. Delete the package, inline the helper. -- [UPGRADE] xterm-color droppable in eshell on Emacs 30's native ansi-color (its only use; also doubly-broken per the eshell standalone task — fixing by deletion is an option). -- [ENHANCE] Python tier: poetry.el (sluggish) + pyvenv (2021) keep only if Poetry projects are still real; blacken fine until ruff-format (reformatter.el already installed). lsp-pyright current. -- [DECIDED] projectile, lsp-mode, dirvish: keep (wired into 10/7/many modules, maintained, migration cost > benefit). On the record so future audits don't relitigate. - -*** TODO Findings: spin-off repos (pearl, chime, emacs-wttrin) -Full findings delivered as handoffs to each repo's inbox/ (2026-06-12-0057-from-.emacs.d-handoff-*.org); each repo's next session files them through its own value gate. Highlights: -- pearl (10 findings; suite green, 66 ERT files): auth-source negative-cache trap in pearl-clear-cache (the 2026-06-01 incident class, unfixed); sync wrapper ignores pearl-request-timeout + async has no timeout; mutation errors discard Linear's GraphQL reason; no RATELIMITED handling; dead legacy API layer (~150 lines). -- chime (10 findings; suite green; the 2026-06-11 watchdog handoff VERIFIED landed in full): lookahead vars never injected into the async child (documented feature silently capped at 8 days — one-line fix); days-until-event nil crash on mixed timed/all-day events; stale-callback race after watchdog interrupt (generation counter needed); default test run prints green integration banner over "Ran 0 tests". -- emacs-wttrin (10 findings; ~56 ERT files, CI; the face-flood reminder VERIFIED resolved — test 8f3c770 + fix c5e5e1d, reminder cleared from notes.org): no network timeouts (wttr.in stalls hang the loading buffer); error-path response-buffer leak; non-favorite cache never expires; 17 unreleased commits incl. two features — tag v0.4.0. - -** PROJECT [#C] Build cj/dev-setup-project helper (per docs/specs/dev-setup-project-spec.org) :feature: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-01 -:END: -*** 2026-05-15 Fri @ 19:17:37 -0500 Specification - -Interactive command that opens a review buffer with proposed per-subdirectory .dir-locals.el contents (projectile compile/run/test + cj/coverage-backend), optional starter Makefile when none exists, and gitignore updates. User edits inline, C-c C-c writes all files. - -Design: [[id:596fce5d-1bab-46e7-8567-d4a2e0923091][docs/specs/dev-setup-project-spec.org]] - -Scope of v1: -- modules/dev-setup-config.el (command + review-buffer major mode) -- Three-tier detection: existing Makefile, existing package.json/pyproject.toml scripts, fall-back starter Makefile generation. -- Project shapes supported: pure Elisp, pure Go, pure Python, pure Node/TS, Docker Compose polyglot. -- Re-run semantics: status banners (UNCHANGED / WILL UPDATE / WILL CREATE), idempotent gitignore append, never modifies an existing Makefile. -- ERT tests for the pure helpers (Makefile parser, package.json parser, shape detection, target-to-role mapping, review-buffer parser). - -Deferred: -- Rust (Cargo.toml), Java (pom.xml), other language shapes. -- Project-wide override config file. -- Auto-detecting external run scripts in conventional locations. - -Do this after the F-key rework ticket ships; don't want to churn project configs before the keys are stable. - -*** TODO [#B] Pure detection + parsing helpers :feature: -Implement the four pure helpers the rest of the command composes on: -- =cj/--dev-setup-parse-makefile-targets FILE= (.PHONY + bare target lines, skip pattern rules) -- =cj/--dev-setup-parse-package-json-scripts FILE= (scripts block, JSON) -- =cj/--dev-setup-detect-project-shape ROOT= (Elisp / Go / Python / Node-TS / Docker-Compose polyglot / unknown) -- =cj/--dev-setup-map-targets-to-roles TARGETS= (best-guess compile/run/test mapping per design § Detection) - -Files: =modules/dev-setup-config.el= (new). No interactive surface, no I/O -beyond reading the named file. - -Acceptance: each helper callable in isolation with handcrafted fixtures; -no command yet. - -Depends on: none -- start here. - -*** TODO [#B] ERT coverage for the pure helpers :feature:test: -Normal/Boundary/Error tests for every helper from the prior sub-task, -matching the design's testing section. - -Files: =tests/test-dev-setup-config.el=, plus -=tests/testutil-dev-setup-config.el= for the temp-project fixture builder -(writes Makefile / package.json / compose stub into =make-temp-file ... 'dir=). - -Acceptance: =make test-file FILE=tests/test-dev-setup-config.el= green; -every helper has at least one Normal, one Boundary, one Error case. - -Depends on: pure detection + parsing helpers. - -*** TODO [#B] Starter-Makefile + .dir-locals.el proposal generator :feature: -Pure function =cj/--dev-setup-build-proposal SHAPE ROOT= returning a -structured plist of proposed blocks: one per subproject =.dir-locals.el= -(projectile compile/run/test + =cj/coverage-backend=), the optional starter -Makefile (only when none exists, adapted per shape per design § Tier 3), -and the gitignore append lines. - -Files: =modules/dev-setup-config.el=. - -Acceptance: given a shape plist, returns deterministic block list ready for -the review buffer; ERT cases cover each shape (Elisp / Go / Python / Node-TS -/ polyglot) plus the Tier-1 "Makefile already exists, suppress Makefile -block" branch. - -Depends on: pure detection + parsing helpers. - -*** TODO [#B] Review-buffer major mode + parser :feature: -Define =cj/dev-setup-review-mode= (derived from =emacs-lisp-mode=) with =C-c -C-c= / =C-c C-k= bindings, plus the pure parser -=cj/--dev-setup-review-buffer-parse CONTENTS= that turns buffer text back -into a block list. Banner syntax per design § Review Buffer (=;; ==== <path> -====[ <status>]==, gitignore special, Makefile special). - -Files: =modules/dev-setup-config.el=, =tests/test-dev-setup-config.el= -(parser cases: well-formed multi-block, single block, empty body, missing -banner, malformed elisp inside a dir-locals block). - -Acceptance: round-trip -- render proposal -> parse buffer -> equal block -list. Mode keybindings smoke-tested. - -Depends on: starter-Makefile + .dir-locals.el proposal generator. - -*** TODO [#B] Writer + status diff + projectile cache reset :feature: -Implement the =C-c C-c= writer: diff each parsed block against the on-disk -file to assign =UNCHANGED= / =WILL UPDATE= / =WILL CREATE=, write only the -non-UNCHANGED ones, append gitignore idempotently, never touch an existing -Makefile, honor the =;;; cj/dev-setup-project: ignore= escape hatch, clear -projectile's per-project command cache, print the summary line. - -Files: =modules/dev-setup-config.el=, plus ERT cases for the diff + -idempotent-append logic against temp dirs. - -Acceptance: re-run on an unchanged project writes nothing; renaming a -Makefile target flips one block to =WILL UPDATE=; ignore-marked files stay -untouched. - -Depends on: review-buffer major mode + parser. - -*** TODO [#B] Interactive command + smoke test :feature:test: -Thin =cj/dev-setup-project= interactive wrapper: resolve project root via -projectile, run detection, build proposal, render the review buffer, pop to -it. One smoke test against a prepared temp project asserting the expected -files exist after a simulated =C-c C-c=. - -Files: =modules/dev-setup-config.el=, =tests/test-dev-setup-config.el=. Add -=(require 'dev-setup-config)= to =init.el= (or the appropriate aggregator). - -Acceptance: =M-x cj/dev-setup-project= on a fixture project opens the review -buffer; =C-c C-c= writes the expected files. - -Depends on: writer + status diff + projectile cache reset. - -*** TODO [#B] Resolve open questions + design follow-ups -Three design questions to close before / during implementation: (a) include -=make coverage= target in starter Makefile? (b) project-wide override file -=.cj-dev-setup.el=? (c) Cargo/pom detection. - -Body: park decisions inline in the design doc or run =arch-decide= if they -turn out load-bearing. - -Depends on: none, but easiest after the writer sub-task surfaces real -friction. - -** PROJECT [#C] Localrepo Documentation :feature: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-05 -:END: - -Audit on 2026-05-27 found the localrepo build half is shipped (=.localrepo/= holds 185 entries; =early-init.el= L135–165 wires the priority-200 pin above the local ELPA-mirror tier at 120–125 and the online fallback). The remaining "document limitations" half splits into one docs-set plus four gap-fix follow-ups that the docs cross-reference. - -Docs land in three artifacts. =docs/design/localrepo.org= carries the full architecture (tier model, install path, refresh story, all four limitations with pointers to the follow-up tasks). =.localrepo/README.org= sits next to the artifact as the user-facing entry — a short summary that survives even if =early-init.el= moves. =early-init.el= grows a commentary header that points at the README, not at the design doc — the README is what future-Craig hits first. - -The four limitations the docs cover (each spun out below as its own task): -- Treesitter grammars (downloaded by =treesit-auto= on first use; not in the localrepo) -- Native-comp =.eln= cache (Emacs-version-specific; invalidated by version bumps) -- System-tool deps (=ripgrep=, =fd=, =pandoc=, =prettier=, =pyright=, etc.; flagged at load by =cj/executable-find-or-warn=, not packageable via =package.el=) -- Refresh / update story (no dedicated script today; ad-hoc =cp= from the elpa mirrors) -*** TODO [#C] Design doc — docs/design/localrepo.org -Write the design doc: tier model, priorities, install path, refresh story, all four limitations with cross-links to the follow-up tasks below. -*** TODO [#C] README — .localrepo/README.org -Write the README at the artifact: short prose entry point summarizing the tier model, pointing at =docs/design/localrepo.org= for full detail. This is what =early-init.el='s commentary header links to. -*** TODO [#C] Commentary header in early-init.el -Add a Commentary-section header in =early-init.el= pointing at =.localrepo/README.org= for usage and =docs/design/localrepo.org= for architecture. Sits at the top of the localrepo block (around L130). -** PROJECT [#C] Migrate from Company to Corfu (with prescient integration) :feature: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-02 -:END: - -Spec: [[id:68733ba2-37a7-4a7b-bfaa-b845d82ff1e7][docs/specs/company-to-corfu-migration-spec.org]] - -*** TODO [#C] Install corfu-side packages -Add corfu, cape, kind-icon, corfu-prescient to the package list. corfu-popupinfo ships inside corfu. Spec step 1. - -*** TODO [#C] Rewrite selection-framework.el company block as corfu/cape stack -Replace the three company-* use-package blocks (lines 192-226) and company-prescient (240-243) with corfu / cape / corfu-popupinfo / kind-icon / corfu-prescient. Rename the section header Company → Corfu in the same change. Spec steps 2 + 8. - -*** TODO [#C] Swap mail-compose completion disable to corfu -Rewrite cj/disable-company-in-mu4e-compose to (corfu-mode -1) across mu4e-compose, org-msg-edit, and message modes (mail-config.el:319-333). Spec step 3. - -*** TODO [#C] Drop company-ledger for ledger's built-in capf -ledger-config.el: remove company-ledger; verify ledger-complete-at-point registers on completion-at-point-functions, add a ledger-mode-hook capf push only if it doesn't. Spec step 4. - -*** TODO [#C] Drop company-auctex for AUCTeX capf + cape-tex -latex-config.el: remove company-auctex and (company-auctex-init); add cape-tex on TeX-mode-hook. Spec step 5. - -*** TODO [#C] Rewire eshell completion to pcomplete capf -eshell-config.el:163-171: drop company-shell and the company-mode activation; add cape-capf-buster around pcomplete-completions-at-point + corfu-mode. Spec step 6. - -*** TODO [#C] Remove company-mode calls from prog-go/python/webdev -Delete (declare-function company-mode ...) and (company-mode) from the three mode hooks; global-corfu-mode covers them. Spec step 7. - -*** TODO [#C] Uninstall company packages + recompile -After the rewrite is green: package-delete company, -quickhelp, -box, -prescient, -ledger, -auctex, -shell; make clean && make compile. Spec step 9. - -*** TODO [#C] Tests: corfu activation, mail-disable, capf registration -New tests/test-selection-framework-corfu.el and tests/test-mail-config-corfu-disable.el; update ledger/latex tests to assert their capf registers. Spec Testing section. - -*** 2026-05-16 Sat @ 11:07:24 -0500 Goals -Drop-in replacement for the in-buffer completion stack: =company= → -=corfu=, =company-quickhelp= → =corfu-popupinfo=, =company-box= → -=kind-icon=, =company-prescient= → =corfu-prescient=, plus =cape= for -the file/keyword/dabbrev capfs that =company-files= / =company-keywords= -used to handle. Per-module fixups for ledger, AUCTeX, eshell, mu4e -compose, and the three =prog-*= modules. See the design doc for the -full translation table, migration steps, tests, and risks. - -** PROJECT [#C] Terminal GPG pinentry Completion :feature: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-05 -:END: - -Audit on 2026-05-27 found no trace of the =terminal-pinentry= branch on this machine: no local or remote ref, no reflog entry across 732 entries reaching back through January, no stash, no dangling commit, no sibling worktree. The 2026-01-24 session log says the branch was created that day, but the work either lived on another machine or was deleted before reaching here. The original task above (=Finish terminal GPG pinentry configuration=) is superseded by this one. - -Surviving footprint on this machine: one commented line at =modules/auth-config.el:83= (=;; (setq epa-pinentry-mode 'loopback)=). The hook point =env-terminal-p= exists in =modules/host-environment.el:97=. Everything else (terminal-vs-GUI branching in the epa =:config=, external pinentry wiring for GUI, =GPG_TTY= export, tests) is to be written fresh off main. - -Goal: in terminal Emacs, GPG passphrase prompts land in the minibuffer via loopback mode; in GUI Emacs, prompts go to the existing external pinentry. - -Open: confirm the GUI pinentry tool (2026-01-24 notes named =pinentry-dmenu=; current =auth-config.el= names no pinentry program, leaving it to =gpg-agent='s config). Also worth checking whether the =terminal-pinentry= branch survives on the laptop and should be pulled here rather than rewritten. - -*** TODO [#C] env-terminal-p branch in epa :config :feature: -Inside the epa =use-package= =:config= in =modules/auth-config.el=, set =epa-pinentry-mode= to ='loopback= when =(env-terminal-p)=, else leave the external pinentry path active. Replace the lone commented line at =auth-config.el:83=. - -*** TODO [#C] GPG_TTY export for terminal sessions :feature: -When =(env-terminal-p)=, =(setenv "GPG_TTY" (shell-command-to-string "tty"))= so gpg-agent can target the controlling tty. Guard against a non-tty stdin. - -*** TODO [#C] gpg-agent updatestartuptty refresh in terminal :feature: -The current =call-process= to "gpg-connect-agent updatestartuptty /bye" runs unconditionally; keep it for GUI, and re-fire it on terminal entry so the agent re-binds to the current tty. - -*** TODO [#C] ERT tests for terminal vs GUI pinentry branching :test: -Test that with =env-terminal-p= stubbed t, =epa-pinentry-mode= resolves to ='loopback= after =auth-config= loads; with it stubbed nil, the loopback setting is not applied. Use =cl-letf= around =env-terminal-p=; cover normal, boundary (=epa= already loaded), error (=gpg-connect-agent= missing). - -*** TODO [#C] Minibuffer prompt in real terminal Emacs -=emacs -nw=, open an encrypted file or trigger an auth-source decrypt, confirm the passphrase prompt lands in the minibuffer rather than failing on missing pinentry. - -*** TODO [#C] External pinentry still fires in GUI Emacs -Restart the daemon, open a GUI frame, trigger an encrypted decrypt, confirm =pinentry-dmenu= (or whatever GUI pinentry is configured) still appears. - -*** TODO [#C] Archive the original L3813 task -After this work lands, mark the original "Finish terminal GPG pinentry configuration" task DONE with a =CLOSED:= stamp and a one-line note pointing at this parent task. - -** DOING [#C] google-keep in-editor integration — build, module-to-package :feature: -v1 (read-only) implemented and tested (Phases 1-3): the gkeepapi Python bridge (=scripts/google-keep/keep-bridge.py=, 12 tests), the elisp core + =cj/keep-refresh= renderer with atomic writes and async make-process (=modules/google-keep-config.el=, 15 ERT tests), un-orphaned under a =C-c k= prefix, graceful warning when gkeepapi/token/auth is missing. The pure JSON-to-org core is kept extractable per the spec. Live fetch needs the one-time gkeepapi + master-token setup — see "Google Keep v1 live setup and first fetch" under Manual testing and validation. -Next: v2 (read-write — create/edit back to Keep, with a staleness guard) per the spec, the immediate follow-on once the live read is confirmed. Later: list/checkbox rendering, package extraction. -Spec: [[file:docs/specs/google-keep-emacs-integration-spec.org][google-keep-emacs-integration-spec.org]] (Ready, 2 review rounds; all five decisions resolved 2026-06-25). -** VERIFY [#C] Remove unused system-power keybindings :refactor:quick:next: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-20 -:END: -Needs from Craig: the task says "confirm the exact set to keep before unbinding." Under C-; ! the bindings are shutdown (s), reboot (r), restart-Emacs (e), and friends. Tell me which to keep bound and which to drop (the completing-read menu still reaches the rare ones), and I'll unbind the rest. - -=modules/system-commands.el= binds shutdown (=C-; ! s=), reboot (=C-; ! r=), restart-Emacs (=C-; ! e=) and friends under the =C-; != prefix. Craig rarely uses them and wants the key real-estate back. Drop the bindings he doesn't use; the completing-read menu can still reach the rare ones. Confirm the exact set to keep before unbinding. From the roam inbox. - -#+begin_src cj: comment - remove them all. -#+end_src - -** CANCELLED [#C] dirvish image previews missing in the pictures dir :bug: -CLOSED: [2026-06-25 Thu] -Craig couldn't reproduce — image previews render fine in dirvish now. Cancelled. -** DONE [#C] ai-term test isolation: collapse-split leaks state breaking display-rule :bug:test: -CLOSED: [2026-06-25 Thu] -Root cause found: the display rule's 4th action =cj/--ai-term-display-saved= splits per the globals =cj/--ai-term-last-direction= / =cj/--ai-term-last-size=, captured on the last toggle-off. The collapse-split multi-window and single-window tests call =cj/ai-term= (which captures those globals) but only let-bound =cj/--ai-term-last-was-bury=, so they leaked =last-direction= = below into =display-rule=, which then split below (left-col 0) instead of right (left-col 40). Confirmed by instrumenting: every window/split global was identical fresh vs after-collapse, but the leaked =last-direction= flipped the directional split. Fix: let-bind =cj/--ai-term-last-direction= + =cj/--ai-term-last-size= to nil in both collapse-split tests, isolating the capture-state globals the way the roundtrip test in the same file already does. Full ai-term suite now 158/158 green. -** DONE [#C] dirvish leaves stray buffers; should be single-instance like org-capture :bug: -CLOSED: [2026-06-25 Thu] -Diagnosed and fixed (commit e190648b). The single-instance frame behavior already existed (=cj/dirvish-popup-focus-existing= raises the open popup on a second Super+F; =q= tears it down). Measured the litter: navigating a dirvish session piles up one dired buffer per directory (2 -> 6 over three subdirs), but =dirvish-quit= reaps them all back to baseline. So the leak was only when the popup is closed WITHOUT =q= — closing the Hyprland float or losing focus bypassed =dirvish-quit= and orphaned the session's buffers. Fix: a =delete-frame-functions= hook scoped to the "dirvish" popup frame runs =dirvish-quit= on every close path (verified: navigated session drops back to baseline on frame close without q). Deliberately did NOT enable =dired-kill-when-opening-new-dired-buffer= — it's off on purpose (dirvish-config.el:208) because it breaks mark-in-A-then-move-to-B; the popup-scoped reap leaves regular =C-x d= sessions and that workflow untouched. -** DONE [#C] ai-term: step between running ai-terms even when detached :feature:solo:next: -CLOSED: [2026-06-25 Thu] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-22 -:END: -Implemented 2026-06-25 (commit 79cbccb5): =cj/ai-term-next= now cycles every active agent (a live buffer OR a live tmux session) keyed on the project dir and ordered by buffer name, and stepping onto a detached one attaches it (=cj/--ai-term-show-or-create= recreates the terminal, which reattaches the session). New pure helpers =cj/--ai-term-next-agent-dir= + =cj/--ai-term-active-agent-dirs= with 10 ERT tests; the live-buffer swap path is unchanged. Live check filed under Manual testing and validation. - -** DONE [#C] Compare terminal themeability: EAT vs vterm vs ghostel :feature:solo:next: -CLOSED: [2026-06-25 Thu] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-22 -:END: -Researched 2026-06-24. All three expose the 16 ANSI colors as Emacs faces (=eat-term-color-*=, =vterm-color-*=, =ghostel-color-*=, each inheriting =ansi-color-*= / =term-color-*=). Ghostel is the most live-themeable: it alone registers an =enable-theme-functions= resync hook (repaints live buffers on a theme change) and exposes a dedicated =ghostel-default= face for the terminal's default fg/bg. EAT (pure elisp, where the faces are the real render source) and vterm (native, faces read at render) both expose themeable palettes but need a buffer reload to pick up a theme switch and give less default-fg/bg control. Outcome: Craig is moving F12 to EAT anyway, for pure-elisp face control and the fun of theming it — see "F12 pops EAT instead of ghostel" above, which carries the resync tradeoff knowingly. - -** TODO [#D] Un-pin ghostel from 0.33.0 once upstream fixes #422/#423 :bug: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-20 -:END: -ghostel is held at 0.33.0 (=ghostel-20260604.2049=, commit 5779a2adceb2) in =modules/term-config.el= to dodge the 0.35.x native-PTY crash. When dakra/ghostel ships a fix for #422 (Linux malloc/signal reentrancy) and #423 (macOS recursive lock), restore =:ensure t= (drop the pin comment) and =package-upgrade ghostel=, then re-run the open-ghostel-in-a-GUI-frame survival check. Watch the two issues for the fixing commit. - -archsetup automated the zig 0.15.2 pin (managed =install_zig_pin= step, sha-verified, unit-tested). If the un-pinned ghostel bumps its ghostty dependency to a newer zig, send archsetup the new version + sha256 so it bumps its =ZIG_VERSION= / =ZIG_SHA256= constants (=inbox-send archsetup=). - -** TODO [#D] Slack message buffers in a reused popup window :quick: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-25 -:END: -Display slack.el message and thread buffers in a dedicated popup window (side or bottom) and reuse that one window instead of spawning a new window per buffer. Likely a =display-buffer-alist= rule (or popper integration) in =modules/slack-config.el=. Status (2026-06-25): =cj/slack--display-buffer= already reuses one non-selected window; the remaining piece is a *dedicated* side/bottom window. Craig's call — keep the current reuse behavior for now and fold the dedicated-window placement into the "Unified popup and messenger UX" work (same window-placement decision should cover Slack, not be solved piecemeal here). - -** TODO [#D] Theme Studio nerd-icons vNext follow-ups :feature: -Deferred from [[file:docs/specs/theme-studio-nerd-icons-colors-spec.org][theme-studio-nerd-icons-colors-spec.org]]: extend the legend to -buffer-mode and command/symbol categories if the file set proves insufficient; -add a "reset to nerd-icons native palette" button. -** TODO [#D] Dashboard over-scroll: pin last line to window bottom :bug: -:PROPERTIES: -:LAST_REVIEWED: 2026-05-22 -:END: -Triggered by: 2026-05-20 Dashboard buffer too long follow-up. - -After the opens-at-top fix (=4ac1b81=), the dashboard can still be -scrolled past its content: the banner image makes the buffer just over -one screenful, so the wheel / =C-v= / =M->= pull the last line up and -leave empty space below it. Craig wants scrolling to stop once the -trailing line reaches the window bottom (no void) while still allowing -scroll-down to reach content below the window. - -Findings from the 2026-05-20 investigation: -- =pixel-scroll-precision-mode= is off, so this is standard line-based - scroll overshoot (the tall banner image inflates the rendered height). -- A =window-start= clamp does not work: =window-start= only lands on - line boundaries, so it can't express a position partway into the - banner image — it either blocks all scrolling or leaves the void. -- A =recenter -1= pin on =post-command-hook= does not work: it fires on - every command, so it fights item navigation (the cursor can't reach - the projects / bookmarks / recents). -- Right design: clamp only on actual scroll commands — advise - =mwheel-scroll= / =scroll-up-command= / =scroll-down-command= / - =end-of-buffer= to =recenter -1= when over-scrolled, never on - navigation commands. -- Live experiment scratch file: =~/dashboard-overscroll-experiment.el=. - -** TODO [#D] Emacs Packages — Curl-Friendly Web Service Wrappers -Ideas for new Emacs packages following the same pattern as wttrin: HTTP GET to a simple web service, render results in a buffer, optionally show summary in the mode-line. All of these share the async fetch + caching infrastructure already proven in wttrin. -Captured On: [2026-04-04 Sat] -*** TODO Stock Market / Finance Package (Finnhub or Alpha Vantage) -Build a stock watchlist and quote viewer for Emacs. User defines a list of symbols; package fetches quotes and renders a formatted table in a dedicated buffer. Optional mode-line ticker showing one or more symbols rotating on a timer. - -**** Features -- Customizable watchlist: user defines a list of stock symbols in a defcustom; package fetches and displays all of them in a single buffer -- Formatted quote table: symbol, company name, current price, daily change (absolute and percent), volume — color-coded green/red for gains/losses -- ASCII sparkline charts: inline mini-charts showing intraday or multi-day price movement using Unicode block characters (▁▂▃▅▇ style) -- Mode-line ticker: rotating display of one or more symbols with price and change indicator, similar to wttrin's weather widget — click to open the full watchlist buffer -- Detail view: press RET on a symbol to see extended data — open/high/low/close, 52-week range, market cap, P/E ratio (data availability depends on backend) -- Auto-refresh with market awareness: background timer fetches new data during market hours; pauses on weekends and after-hours to conserve API calls -- Unit/currency preference: display prices in local currency if the backend supports it -- Cache layer: same pattern as wttrin — serve cached data instantly, refresh in background, show staleness indicator when data is old -- Interactive symbol lookup: ~M-x stock-add-symbol~ with completion against a symbol database or search endpoint - -**** What you'd learn -- JSON parsing in elisp (~json-parse-buffer~, ~json-read~) — these APIs return JSON, not plain text, so this is the main new skill vs. wttrin -- ASCII chart rendering — drawing sparklines or simple price charts with Unicode block characters in a buffer -- API key management in elisp — storing keys in ~auth-source~ or custom variables, passing them as query params - -**** Where the complexity lives -- Rendering: No pre-formatted ASCII comes back from the API. You'd build the table layout and any chart visualization yourself. This is the bulk of the work. -- Market hours awareness: Knowing when to fetch (pre-market, regular, after-hours, weekends) to avoid wasting API calls. -- Rate limiting: Free tiers are tight. Finnhub gives 60 calls/min which is generous; Alpha Vantage gives only 25/day on the free tier. Caching strategy matters more here than in wttrin. - -**** Candidate backends -- Finnhub (finnhub.io): Free API key, 60 calls/min, real-time US quotes. JSON only. Best rate limit of the free options. -- Alpha Vantage (alphavantage.co): Free API key, 25 calls/day. Supports CSV output which is trivial to parse — no JSON needed. Good for daily summaries, bad for frequent polling. -- Twelve Data (twelvedata.com): Free key, 800 calls/day, 8/min. Covers stocks, forex, crypto, ETFs. JSON and CSV. - -**** Downsides -- API key requirement adds friction for users (signup, config). Not as frictionless as wttrin. -- Rate limits mean you can't poll aggressively. Stale data is the norm on free tiers. -- Financial APIs change or shut down. Yahoo Finance's unofficial API has broken repeatedly over the years. Even paid services deprecate endpoints. Expect maintenance. -- Finnhub and Alpha Vantage are US-market-centric. International coverage varies. - -**** Effort: Medium-High -The fetch/cache layer is straightforward (reuse wttrin patterns). The rendering layer (tables, charts, color-coding gains/losses) is where most of the time goes. Expect this to be a real project, not a weekend hack. - -**** Name candidates (backronyms) -Pick one. All are recursive (self-referential) in the style of CHIME. -- BULL — *BULL Updates Live Listings* -- MINT — *MINT Indexes Noteworthy Tickers* -- QUOTE — *QUOTE Updates Ongoing Ticker Estimates* -- ASSET — *ASSET Surfaces Stock Exchange Tickers* -- MOAT — *MOAT Monitors Active Tickers* -- TRADE — *TRADE Reveals Active Daily Equities* -- BELL — *BELL Exhibits Live Listings* -- CHART — *CHART Highlights Asset Rate Tickers* -- BOARD — *BOARD Oversees Asset Rate Data* -- VAULT — *VAULT Aggregates Underlying Listing Tickers* - -*** TODO rate.sx Wrapper — Cryptocurrency Rates -Wrap Igor Chubin's rate.sx service. This is the lowest-effort, highest-pattern-match option — rate.sx works exactly like wttr.in. Returns colored ASCII tables with sparkline charts. Same ~User-Agent: curl~ trick, same ANSI escape codes. - -**** Features -- Full crypto dashboard: ~M-x rate-sx~ opens a buffer with a colored ASCII table of top cryptocurrencies — name, price, 24h change, market cap, and sparkline charts — all rendered by the service -- Single coin lookup: ~M-x rate-sx-coin~ prompts for a coin name (e.g., ~eth~, ~btc~) and displays its detailed view -- Plain price fetch: query ~rate.sx/1BTC~ to get a single numeric price — useful for mode-line display or programmatic use from other elisp -- Mode-line widget: show the price of one or more coins in the mode-line with periodic background refresh, similar to wttrin's weather indicator -- Customizable coin list: user picks which coins appear in the dashboard via a defcustom -- Currency base selection: rate.sx supports displaying prices in different fiat currencies -- ANSI color rendering: reuse wttrin's ~xterm-color~ pipeline to convert the service's colored ASCII output into Emacs faces -- Cache with background refresh: same timer-based pattern as wttrin — data stays warm, buffer opens instantly - -**** What you'd learn -- Very little new — this is almost a copy of wttrin with different URL construction. Good first project if you want to validate the pattern before tackling stocks. -- Could explore sharing infrastructure between wttrin and this package (common async fetch, caching, ANSI rendering). - -**** Where the complexity lives -- Minimal. The service does the formatting. Your job is URL construction, fetch, ANSI-to-faces conversion (already solved in wttrin via ~xterm-color~), and buffer display. -- Coin selection UX: letting users pick which coins to show, custom vs. top-N, etc. - -**** Downsides -- Single point of failure: rate.sx is one person's side project. If Chubin takes it down, the package is dead. No fallback. -- Crypto-only. No traditional stocks, forex, or commodities. -- Less useful than a stock package for most people. - -**** Effort: Low -Could reuse 70-80% of wttrin's code. A weekend project if you're focused. - -*** TODO Frankfurter Currency Exchange Package -Wrap the Frankfurter API (frankfurter.dev) for fiat currency conversion and historical rates. ECB data, open source, no API key. - -**** Features -- Quick conversion: ~M-x currency-convert~ prompts for amount, base currency, and target currency — displays the result in the echo area (e.g., "100 USD = 91.34 EUR") -- Multi-target conversion table: convert one amount against several currencies at once, rendered as an aligned table in a dedicated buffer -- Historical rate lookup: query a specific date's exchange rate — useful for expense reports, invoicing, or curiosity -- Rate trend view: fetch a date range and display a table or ASCII sparkline showing how a currency pair moved over days/weeks/months -- Latest rates dashboard: ~M-x currency-latest~ shows today's rates for a user-defined set of currency pairs in a buffer -- Interactive currency selection: completing-read over the ~30 supported currencies with full names (e.g., "USD — United States Dollar") -- Mode-line rate display: optionally show one currency pair's rate in the mode-line with daily background refresh -- Cache layer: rates only update once per business day, so caching is especially effective — fetch once, serve all day - -**** What you'd learn -- JSON parsing in elisp (the API returns JSON, not formatted text) -- Table rendering — building aligned currency tables with ~format~ and text properties -- Historical data display — the API supports date ranges, so you could show rate trends over time - -**** Where the complexity lives -- Rendering: You'd build the table and any trend visualization yourself. -- Date handling in elisp for historical queries (~encode-time~, ~format-time-string~, etc.). -- UX: interactive base/target currency selection with completion. - -**** Downsides -- ECB data updates once per business day. No real-time rates — this is reference data, not trading data. -- Covers ~30 currencies (major fiats). No crypto, no exotic currencies. -- Frankfurter is open-source and self-hostable, which is good for longevity, but the public instance could still go away. - -**** Effort: Low-Medium -JSON parsing adds a step vs. wttrin's plain text, but the API is clean and well-documented. Straightforward project. - -*** TODO ipinfo.io — IP and Geolocation Lookup -~curl ipinfo.io~ returns JSON with your public IP, city, region, country, ISP, and timezone. No auth needed for basic lookups (1000 requests/day unauthenticated). - -**** Features -- My IP: ~M-x ipinfo~ fetches your public IP and geolocation, displays a formatted summary in a buffer or the echo area — IP, city, region, country, ISP, timezone, coordinates -- Arbitrary IP lookup: ~M-x ipinfo-lookup~ prompts for an IP address and shows the same geolocation detail -- Copy IP to kill ring: one-keystroke convenience for grabbing your public IP -- Open in browser map: command to open the returned lat/long coordinates in OpenStreetMap or Google Maps via ~browse-url~ -- Hostname resolution: the API also returns the reverse DNS hostname for an IP -- Mode-line IP display: optionally show your current public IP in the mode-line (useful when switching between networks/VPNs) -- Org-mode integration: insert IP/geo info as an org property block or table row at point - -**** What you'd learn -- Minimal new skills — simple JSON response, single fetch, render in buffer or echo area. -- Could add map integration (open coordinates in browser or an Emacs map package). - -**** Where the complexity lives -- Almost nowhere. This is the simplest possible package. Fetch JSON, format it, display it. -- If you want to look up arbitrary IPs (not just your own), add a prompt with completion history. - -**** Downsides -- Very niche utility. You look up your IP occasionally, not daily. -- Free tier is generous (1000/day) but authenticated lookups require a token for enriched data. -- Privacy-conscious users may not want to send their IP to a third party (though they already do by virtue of connecting). - -**** Effort: Very Low -An afternoon project. Good as a learning exercise for the fetch-parse-render pattern if you haven't done JSON APIs in elisp before. - -*** TODO icanhazdadjoke.com — Dad Jokes in Emacs -~curl -H "Accept: text/plain" https://icanhazdadjoke.com~ returns a single plain-text joke. No auth, no key, no rate limit concerns for casual use. - -**** Features -- Random joke: ~M-x dad-joke~ fetches a random joke and displays it in the echo area — minimal disruption, maximum groan -- Joke buffer: ~M-x dad-joke-buffer~ opens a dedicated buffer with a joke, nicely formatted with a large font face. Press ~n~ for the next joke, ~q~ to quit -- Search jokes: ~M-x dad-joke-search~ prompts for a term (e.g., "cat") and displays matching jokes in a buffer — the API supports ~?term=~ search -- Startup joke: optional hook to display a dad joke in the echo area or scratch buffer on Emacs startup -- Org-mode insertion: ~M-x dad-joke-insert~ inserts a joke at point — for lightening up documentation or commit messages -- Kill ring: ~M-x dad-joke-yank~ fetches a joke and puts it directly in the kill ring for pasting elsewhere - -**** What you'd learn -- Nothing technically new — this is the simplest possible HTTP-GET-to-buffer pattern. -- Good excuse to experiment with fun presentation: display in echo area, dedicated buffer, or even as a startup message. - -**** Where the complexity lives -- It doesn't. Fetch a string, display it. The API also supports search (~?term=dog~) if you want to add that. - -**** Downsides -- Toy project. Zero practical utility beyond morale. -- The joke quality is... dad jokes. - -**** Effort: Trivial -An hour, maybe two if you add search and a nice buffer layout. Publishable on MELPA as a novelty package. - -*** TODO qrenco.de — QR Code Generator -Chubin's QR code service. ~curl qrenco.de/hello~ returns a QR code rendered in Unicode block characters. Encodes arbitrary text, URLs, WiFi credentials, etc. - -**** Features -- Encode text: ~M-x qr-encode~ prompts for a string and displays the QR code in a dedicated buffer using Unicode block characters -- Encode region: ~M-x qr-encode-region~ encodes the currently selected text — quick way to QR-ify a URL, password, or snippet -- Encode URL at point: ~M-x qr-encode-url~ detects the URL under point (via ~thing-at-point~) and generates a QR code for it -- WiFi QR codes: ~M-x qr-wifi~ prompts for SSID, password, and encryption type, then generates the standard WiFi QR format (~WIFI:T:WPA;S:MyNetwork;P:password;;~) — scan to join a network -- Buffer font management: automatically sets the buffer to a monospace font with consistent Unicode block rendering (same approach as wttrin's Liberation Mono override) -- Copy as text: yank the QR code's block characters to the kill ring for pasting into emails, READMEs, or chat -- Adjustable size: the service supports size parameters — expose this as a prefix argument or defcustom - -**** What you'd learn -- Handling Unicode block character output (not ANSI colors this time, but character-level rendering) -- Interactive input patterns — prompting for text to encode, or encoding the current region/URL at point - -**** Where the complexity lives -- Font and character width: QR codes require a monospace font where the block characters render at consistent widths. Some Emacs font configurations break this. You'd need to set the buffer font explicitly (like wttrin does). -- The service sometimes returns ANSI codes for inverted colors. May need ~xterm-color~ or manual processing. - -**** Downsides -- Same single-point-of-failure risk as rate.sx — one person's service. -- QR codes in a terminal/buffer are inherently lower resolution than image-based ones. Scanning reliability depends on terminal font size and screen. -- Niche use case. Most people generate QR codes infrequently. - -**** Effort: Low -Similar to rate.sx in scope. The fetch is trivial; font handling and display are the main considerations. - -*** TODO dns.toys — Multi-Tool Utility via DNS -dns.toys answers queries over DNS instead of HTTP. ~dig 100USD-EUR.fx @dns.toys~ returns currency conversion, ~dig mumbai.time @dns.toys~ returns world time, ~dig 42km-mi.unit @dns.toys~ does unit conversion. Also supports base conversion, math constants, and more. - -**** Features -- Currency conversion: ~M-x dns-toys-currency~ prompts for amount and currency pair (e.g., "100 USD to EUR"), displays result in echo area -- World time: ~M-x dns-toys-time~ prompts for a city name and shows the current local time — faster than searching online, no browser needed -- Unit conversion: ~M-x dns-toys-unit~ prompts for a value and unit pair (e.g., "42 km to mi"), returns the conversion -- Base conversion: ~M-x dns-toys-base~ converts between decimal, hex, octal, and binary (e.g., "100 dec to hex") -- Math constants: ~M-x dns-toys-constant~ looks up pi, e, tau, etc. — niche but handy in a calc session -- Unified command: ~M-x dns-toys~ with a smart prompt that detects query type from input format, dispatching to the right DNS query automatically -- Echo area results: all results display in the echo area by default for quick non-disruptive answers, with an optional dedicated buffer for history -- Async queries: use ~start-process~ with sentinels so ~dig~ calls don't block Emacs - -**** What you'd learn -- Calling external processes from elisp (~call-process~ or ~start-process~ to invoke ~dig~) instead of ~url-retrieve~. This is a meaningfully different integration pattern from wttrin. -- Parsing DNS TXT record output — dig returns structured but noisy output; you'd extract the answer section. -- Building a multi-function package — this one service covers currency, time, units, and base conversion, so the UX needs a dispatch mechanism (separate commands, or a unified prompt with type detection). - -**** Where the complexity lives -- Output parsing: ~dig~ output is not designed for human consumption. You'd parse the ANSWER SECTION, strip TTL/class/type fields, and extract the payload string. -- Latency: DNS queries are fast but ~call-process~ on ~dig~ has subprocess overhead. For interactive use this is fine; for mode-line updates you'd want async (~start-process~ with a sentinel). -- Feature breadth: The temptation is to wrap every dns.toys feature. Scoping to a focused set (currency + time + units) keeps it manageable. - -**** Downsides -- Requires ~dig~ installed (standard on Linux/macOS, not on Windows). Limits portability. -- dns.toys is a single maintainer's project. Same fragility concern as rate.sx and qrenco.de. -- DNS protocol means no rich formatting — just short text strings. The results are useful but visually plain. -- Some networks/firewalls block non-standard DNS queries, which would silently break the package. - -**** Effort: Low-Medium -The individual queries are trivial. The interesting work is building a clean multi-function UX and handling the process-based (vs. HTTP-based) integration pattern. Good project for learning elisp process management. - -*** TODO cheat.sh Integration — Programming Cheat Sheets -~curl cheat.sh/tar~ returns a syntax-highlighted cheat sheet. Supports language-specific queries like ~cheat.sh/python/lambda~. Already has some Emacs integrations (cheat-sh.el exists) but could be worth a custom implementation if existing packages don't fit your workflow. - -**** Features -- Quick lookup: ~M-x cheat-sh~ prompts for a topic (e.g., "tar", "git/stash") and displays a syntax-highlighted cheat sheet in a dedicated buffer -- Language-scoped queries: ~M-x cheat-sh-lang~ prompts for language then topic (e.g., ~python/lambda~, ~go/goroutine~) with two-stage completion -- Context-aware lookup: detect the current buffer's major mode and scope the query to that language automatically — in a Python buffer, querying "lambda" goes to ~cheat.sh/python/lambda~ -- ANSI-to-faces rendering: convert the service's syntax-highlighted ANSI output to proper Emacs font-lock faces using ~xterm-color~ (same pipeline as wttrin) -- Navigation: browse related topics from within the buffer — follow-up queries without returning to the minibuffer. Previous/next topic history with ~p~ / ~n~ -- Completion against the topic list: fetch and cache ~cheat.sh/:list~ to provide completing-read over all available topics -- Offline cache: optionally cache previously viewed cheat sheets for offline access or instant re-display -- Region query: select a command or function name and look it up directly with ~M-x cheat-sh-region~ - -**** What you'd learn -- ANSI syntax highlighting → Emacs faces (same skill as wttrin) -- Deep completion support: cheat.sh has a massive topic tree. Building good interactive completion for ~cheat.sh/{language}/{topic}~ is a UX challenge. - -**** Where the complexity lives -- Completion and navigation: the value is in making it fast to find the right cheat sheet. ~cheat.sh/:list~ returns thousands of entries. -- Existing packages: ~cheat-sh.el~ already exists on MELPA. You'd need a reason to build your own (better caching, offline support, integration with your workflow). - -**** Downsides -- Overlaps with existing Emacs packages. Check ~cheat-sh.el~ before building. -- The service aggregates from many sources. Quality is inconsistent across topics. - -**** Effort: Medium -If building from scratch. Low if extending or wrapping an existing package. The completion UX is where the effort goes. -** TODO [#D] Localrepo refresh / update script :feature: -No dedicated update path today — refreshing a pinned package means ad-hoc =cp= from the local elpa mirrors. Document the current shape and decide whether a =scripts/refresh-localrepo.sh= is worth writing. Cross-linked from =docs/design/localrepo.org=. - -** TODO [#D] Native-comp .eln cache strategy :feature: -The native-comp =.eln= cache is Emacs-version-specific; an Emacs upgrade invalidates everything. Document the cache location, what an upgrade triggers, and whether a warm-the-cache script is worth shipping. Cross-linked from =docs/design/localrepo.org=. - -** TODO [#D] Polish reveal.js presentation setup :feature: - -Three small reveal.js improvements; collected into one task because each on its own is too small to track separately. - -1. *Image insertion helper.* Function to insert images with proper org-reveal attributes (sizing, background images, etc.) without having to remember the syntax. -2. *Default font sizing for slide elements.* Configure reveal.js font sizes for headings, body text, code blocks, etc. — better defaults via =org-reveal-head-preamble= CSS or a custom theme. -3. *Custom dupre reveal.js theme.* CSS theme using the colors from =themes/dupre-palette.el=. Install into =reveal.js/css/theme/= for use with =#+REVEAL_THEME: dupre=. - -** TODO [#D] System-tool dependency install script :feature: -=ripgrep=, =fd=, =pandoc=, =prettier=, =pyright=, and other binaries that =cj/executable-find-or-warn= flags at module load are not in =package.el='s reach. Document the required-tool set and ship a setup script (or =pacman=/=apt= invocation set). Cross-linked from =docs/design/localrepo.org=. - -** TODO [#D] Treesitter grammar offline cache :feature: -Treesitter grammars are downloaded by =treesit-auto= on first use and live outside the localrepo. For true offline reproducibility, cache the grammars next to the localrepo (a =.localrepo/treesitter/= tier, or a separate mirror script). Cross-linked from =docs/design/localrepo.org=. -* Emacs Someday/Maybe - -** TODO [#D] GPTel orphan tasks and useful ideas :feature: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-01 -:END: - -On 2026-06-23 gptel was archived out of the live config (its modules, -tools, tests, and specs moved to archive/gptel/) because it sees little -use. This subtree was the gptel agentic-tool feature backlog. I kept it -here in Someday/Maybe instead of deleting it: most of the child ideas -below are agent-tool concepts that are not gptel-specific (org-roam node -tools, git section tools, ripgrep / pandoc / ffmpeg / jq wrappers, -messaging and buffer-state tools) and would carry over to the ai-term -Claude agents or an MCP tool layer if that path is taken. They are -reference, not active work. - -Categories below thematize the agent affordances the design doc -[[file:docs/design/gptel-agentic-tool-ideas.org][gptel-agentic-tool-ideas.org]] -points at -- Git, Org, messaging, file / buffer / workspace state, -media, and the dev loop. The shortlist's first-batch ADOPT tools -(git_status / git_log / git_diff / web_fetch) already shipped; the -themes below are next-tier work where the agent treats Emacs as a -structured workspace, not a text terminal. Per-theme spec lives in -the task body once written; implementation tasks land as siblings -of the spec heading once the spec is approved. The magit-backend -reimplementation of the shipped git tools is tracked separately in -[[id:bd47c9a8-aae1-4a3d-ad5b-b8767f2fd580][gptel-git-tools-magit-backend-spec.org]]. - -*** TODO [#C] Wire Up MCP.el so That GPTel Has Access to MCP Servers via GPTel Tools - -**** 2026-05-16 Sat @ 15:44:36 -0500 Spec - -Design doc: [[id:b4c274c5-8572-4a7b-b657-d315712bd6af][docs/specs/mcp-el-gptel-integration-spec-doing.org]] - -**** 2026-05-17 Sun @ 14:14:34 -0500 Landed ai-mcp.el pure-helper foundation - -Commit =54d231be=. Sections 1 (constants + defcustoms) and 3 (pure helpers) of the seven-section outline. 41 ERT tests, all green. Refactor audit caught two duplications during Phase 4 and folded them into the same commit (=cj/mcp--get-server-entry= and =cj/mcp--name-matches-p=). Phase 1.5 (confirmation contract) is next. - -**** TODO [#C] Phase 1.5 -- GPTel confirmation contract - -*Goal:* flip =gptel-confirm-tool-calls= to ='auto= and gate the existing local tools that need it. - -*Entry:* Phase 1 module exists and helpers tested. - -*DECISION (cj):* which of the existing local tools register with =:confirm t= once ='auto= is in effect? Reads (=read_buffer=, =read_text_file=, =list_directory_files=, =git_status=, =git_log=, =git_diff=) clearly stay =:confirm nil=. Judgment calls: -- =web_fetch= -- fetches arbitrary URLs the agent supplies. Spec recommends gating. -- =write_text_file= -- writes any path under =$HOME= with agent-supplied content. -- =update_text_file= -- modifies an existing file with an agent-supplied transform. -- =move_to_trash= -- moves a path to trash (reversible but disruptive). - -*Deliverables:* -- =ai-mcp.el= setup section runs =(setq gptel-confirm-tool-calls 'auto)=. -- Remove =(setq gptel-confirm-tool-calls nil)= from =modules/ai-config.el:386= with a comment pointing at =ai-mcp.el=. -- For each tool the decision marks "gate," add =:confirm t= to its =gptel-make-tool= form. -- Tests in =tests/test-ai-mcp-confirm-contract.el= asserting: =gptel-confirm-tool-calls= is ='auto= after load; write-classified stub MCP tool with =:confirm t= triggers the confirm branch in =gptel-send='s dispatch (stub the prompt); read-classified MCP tool with =:confirm nil= does not; =git_log= (=:confirm nil=) still runs without prompting; each newly-gated local tool does prompt. - -*Exit:* tests green. Manual smoke: open GPTel, call a gated tool, confirm prompt appears. Call =git_log=, no prompt. - -**** TODO [#B] Phase 2 -- Compat layer + registration pipeline (fake inventory) - -*Goal:* implement the mcp.el compat wrappers and the tool-registration pipeline against stubbed =mcp-server-connections=. - -*Entry:* Phase 1.5 proves gptel respects per-tool =:confirm= slot. - -*Deliverables:* -- Section 4 of =ai-mcp.el= (compat layer): =cj/mcp--server-status=, =cj/mcp--server-tools=, =cj/mcp--server-name=, =cj/mcp--assert-capabilities=. Each helper documents the upstream commit / file location it targets. -- Section 5 of =ai-mcp.el= (registration pipeline): =cj/mcp--register-tool=, =cj/mcp--register-server-tools=, =cj/mcp--deregister-server-tools=, =cj/mcp--rewrite-plist=, =cj/mcp--registered-tools= hash. -- All MCP tools register with =:async t=. -- Tests in =tests/test-ai-mcp-registration.el=. - -*Exit:* with a stubbed =mcp-server-connections=, registration produces correctly prefixed =mcp__SERVER__TOOL= entries in =gptel-tools=; closures call =mcp-call-tool SERVER REMOTE-NAME= (verified by stubbing =mcp-async-call-tool=); deregistration removes only MCP-owned tools and leaves a pre-populated local =git_log= entry intact; re-registration replaces function pointer without duplicating menu entries; confirm overrides win over patterns. - -**** TODO [#B] Phase 3 -- Async state machine + timer-race timeout wrapper - -*Goal:* implement the lifecycle state machine and the per-call timer-race timeout. - -*Entry:* Phase 2 registration works against stubs. - -*Deliverables:* -- Section 6 of =ai-mcp.el= (async state machine): =cj/mcp--state=, =cj/mcp--server-status= alist, =cj/mcp--stall-timer=, =cj/mcp-ensure-started=, =cj/mcp--on-hub-callback=, =cj/mcp--poll-status=, =cj/mcp--start-stall-timer=, =cj/mcp--build-status-from-specs=. -- =cj/mcp--wrap-async-with-timeout= (timer/callback race; both branches set =done= before invoking gptel callback so late responses are ignored). -- Tests in =tests/test-ai-mcp-async.el=. - -*Exit:* =cj/mcp-ensure-started= returns in <100 ms with delayed-callback stubs; stall timer fires for stuck servers; timer-race wrapper handles all three orderings (MCP-first, timer-first, late-MCP-after-timer); async error path (=:error-callback= without inited callback) reaches =failed= state via polling. - -**** TODO [#B] Phase 4 -- First real connection (drawio or slack-deepsat) - -*Goal:* wire one real no-auth server end-to-end against actual mcp.el and prove the stubbed Phase 3 behavior matches reality. - -*Entry:* Phase 3 async works against stubs. - -*Deliverables:* -- Add =use-package mcp= to =ai-mcp.el= (MELPA active, =:load-path= for local checkout commented). -- =cj/mcp--assert-capabilities= called at load time; signals clearly if mcp.el is too old. -- Set =cj/mcp-enabled-servers= temporarily to =("drawio")= (or =("slack-deepsat")= if the local proxy is running). -- First real =cj/mcp-ensure-started= invocation from =cj/toggle-gptel=. - -*Exit:* manual smoke -- =C-; a t= opens GPTel without blocking; within 30 s, drawio (or slack-deepsat) tools appear in =gptel-menu= grouped by category; calling a tool returns expected output; killing the subprocess externally surfaces as =failed= in =cj/mcp--server-status=. - -**** TODO [#B] Phase 5 -- Status UX + commands + doctor (static) - -*Goal:* ship the full server-management UX so partial-availability and failures are visible. - -*Entry:* Phase 4 proves a real connection works. - -*Deliverables:* -- Section 7 of =ai-mcp.el= (UI). -- Commands: =cj/mcp-status= (echo-area summary keyed off =cj/mcp--state=), =cj/mcp-list-tools= (tabulated buffer with failed servers at top in red face; keys =g r c RET q=), =cj/mcp-doctor= (static mode only -- capability, =npx=/=uvx=, Claude config, per-server env, local endpoints; output buffer keys =c r q=), =cj/mcp-wait-until-ready=, =cj/mcp-hub= (thin wrapper that ensures startup first), =cj/mcp-restart-failed=, =cj/mcp-restart-server=, =cj/mcp-stop-all=. -- Keymap: =C-; a C= subprefix bound in =ai-config.el='s autoload section. Keys =h s l r R S d w=. -- which-key labels for every binding. -- =kill-emacs-hook= registration for =cj/mcp-stop-all=. -- Investigation: does =gptel-menu= refresh after mid-call tool registration? Document the answer in =ai-mcp.el= commentary; if it requires close+reopen, add to known UX caveats. - -*Exit:* all keymap bindings work; audit buffer surfaces failed servers prominently; doctor identifies each scenario in the manual test matrix; status command shows the right state for each phase transition. - -**** TODO [#B] Phase 6 -- HTTP servers (linear, notion) - -*Goal:* add the two HTTP-transport servers with in-protocol OAuth. - -*Entry:* Phase 5 UX shipped. - -*Deliverables:* -- Add =linear= and =notion= back to =cj/mcp-enabled-servers=. -- Doctor gains live-auth-check mode (=C-u C-; a C d=): invokes a single safe read per auth class to verify OAuth tokens haven't silently expired. Static checks first; live probe only fires after static passes. -- OAuth recovery pattern matcher surfaces auth URLs in =cj/mcp-status= on first connect. - -*Exit:* first connect surfaces the OAuth URL through the recovery pattern; after browser handshake completes, subsequent connects succeed without prompt; live-auth-check correctly identifies a deliberately revoked token; both servers appear ready in the audit buffer. - -**** TODO [#B] Phase 7 -- Env-dependent stdio servers (figma, google-*) - -*Goal:* add the remaining five env-dependent servers. - -*Entry:* Phase 6 HTTP servers connect cleanly. - -*Deliverables:* -- Add =figma=, =google-calendar=, =google-docs-personal=, =google-docs-work=, =google-keep= to =cj/mcp-enabled-servers=. -- Verify env-merge from =~/.claude.json= for each (the mtime-cached reader from Phase 1). -- Verify figma's =:secret-args= splicing places the API key correctly without echoing it. -- Manual smoke: simulate token expiry on one Google server; recovery message points at "re-auth via Claude Code, then C-; a C r SERVER". - -*Exit:* all 9 servers reach =ready= state on a clean machine. Sentinel-grep check across status / audit / hub / errors / audit-log shows zero secret leakage. Doctor's live-auth covers each auth class (oauth, token, args-token, in-protocol, local, none). - -**** TODO [#B] Phase 8 -- Privacy + audit polish - -*Goal:* land the final UX polish and documentation. - -*Entry:* all 9 servers working. - -*Deliverables:* -- Audit buffer privacy header: "Tool results land in =gptel-tools= responses; saved conversations persist them. Use =cj/gptel-autosave-toggle= per buffer to opt out." -- =cj/mcp-tool-audit-log-enabled= defcustom + log writer (=~/.emacs.d/data/mcp-tool-log/YYYY-MM-DD.log= -- metadata only, one line per call, daily rotation). -- =ai-mcp.el= commentary updated with the code-organization outline as a table of contents. -- Final pass on tests covering saved-conversation behavior (autosave persists MCP tool results; toggling off prevents persistence). - -*Exit:* all 10 acceptance criteria from the spec pass. Manual matrix run end-to-end on a fresh Emacs. Working tree clean. - -*** TODO [#C] Wrap the gh CLI as a GPTel tool - -**** 2026-05-16 Sat @ 16:20:00 -0500 Spec - -Design doc: [[id:a124dd0f-1f40-4533-aeb8-595d93e20865][docs/specs/gptel-gh-tool-spec.org]] - -*** TODO [#C] GPTel should autosave regularly after a conversation is saved -*** TODO [#B] Org Workflow Related Tools - -Affordances that expose the Org workspace -- agenda state, capture -targets, org-roam nodes and backlinks, dailies, drill review state -- -to the agent as structured context, not raw .org buffer text. - -**** TODO [#B] Agenda state tools :feature: - -Read scheduled / deadline / waiting tasks for a date range; query by -tag, priority, or TODO keyword; list what's blocking today. Lets the -agent answer "what's on the critical path this week" without me -pasting agenda output, and feeds the daily-prep / wrap-up workflows. - -**** TODO [#B] Org-roam node tools :feature: - -Resolve a topic to its node; return body + backlinks; list nodes by -tag; surface dailies for a date range. Lets the agent reason over -the personal knowledge graph and write back into it via the capture -tools below. - -**** TODO [#B] Capture creation tools :feature: - -Drive =org-capture= from a template key + body string. Lets the -agent file inbox items, reading notes, journal entries, or roam -nodes without me leaving the chat. Tight pairing with the -=cj/org-capture= optimization task in todo.org. - -**** TODO [#B] Org-drill review tools :feature: - -Surface next-due drill cards in =drill-dir=; let the agent quiz on a -topic and report performance. Useful for prompted recall sessions -("ask me five medical-Spanish cards") and for "did this card stick" -analysis. - -*** TODO [#B] Git Related Tools - -Affordances that expose magit's structured view of a repo -- sections, -staged-vs-unstaged, commit metadata, rebase / conflict state -- as -first-class tools rather than asking the model to reason over raw -diff text. - -**** TODO [#B] Section-aware git tools :feature: - -Expose Magit sections as first-class GPTel tools: current section type, -heading, file, hunk range, and content; sibling sections under the same -file; staged / unstaged / untracked status; commit metadata around the -selected commit or branch; the exact staged patch that would be -committed. Lets prompts say "review the file section at point" or -"explain this hunk in the context of adjacent hunks" without manual -context-copying. - -**** TODO [#B] Commit intent workbench :feature: - -Transient that builds a commit intentionally: -1. Agent reads unstaged + staged changes. -2. Agent proposes coherent commit groups. -3. User selects groups in a Magit-style buffer. -4. Agent stages those paths or hunks only after confirmation. -5. Agent generates a message reflecting the selected intent. - -Addresses the common case of two or three unrelated edits in one -working tree -- a single commit-message generator can't handle that -cleanly. - -**** TODO [#B] Patch narrative buffer :feature: - -Generate an Org buffer that explains a change set as a reviewable -narrative: -- "What changed" by subsystem. -- "Why it appears to have changed" inferred from names, tests, and docs. -- "Risk areas" with links back to Magit file sections. -- "Suggested verification" using local Makefile targets when present. - -Reusable artifact: paste into a PR description, save with an AI -session, or file into org-roam. - -**** TODO [#B] Review-thread simulator :feature: - -Before opening a PR, create a local review buffer with inline comments -attached to Magit diff positions. The agent writes comments as if -reviewing someone else's patch: -- Comments grouped by severity. -- Each comment links to file and line. -- Resolved comments check off in Org. -- Accepted suggestions apply through the existing text-update tools. - -Makes "review my diff" less ephemeral and avoids losing useful findings -inside a chat transcript. - -**** TODO [#B] Rebase and conflict coach :feature: - -When Magit enters a rebase, cherry-pick, merge, or conflict state, -expose an agent command that reads: -- Git operation state from =.git/=. -- Conflict markers in the worktree. -- Relevant commits from =git log --merge= or the rebase todo. -- The current Magit status sections. - -The agent explains the conflict in domain terms and proposes a -resolution patch; the actual edit and =git add= stay under explicit -user control. - -**** TODO [#B] Regression archaeology :feature: - -Magit transient that runs a bisect-like reasoning workflow: -- Ask for a symptom and a known-good / known-bad range. -- Summarize candidate commits in small batches. -- Use tests or user-provided repro commands when available. -- Maintain a bisect journal in an Org buffer. - -Even when the agent can't run the whole bisect, it keeps the -investigation structured and preserves why each commit was judged -good or bad. - -**** TODO [#B] Messaging Related Tools - -Affordances over mu4e, Slack, Telegram, and ERC. Same shape across -protocols: read recent threads, search by sender / topic, compose a -draft from a prompt + thread context, leave the send under explicit -user control. - -***** TODO [#B] Mu4e thread and compose tools :feature: - -Read the message at point and surrounding thread (with attachments -summarized); query the inbox by =from:= / =subject:= / date range; -compose a draft from a prompt + thread context using =org-msg=. -Pairs with the existing =mu4e-org-contacts-integration.el=. - -***** TODO [#B] Slack thread and compose tools :feature: - -Read channel / DM / thread history through =emacs-slack=; search by -user or channel; compose a draft message but leave sending to me. -Mirrors the mu4e shape so the agent's interface is uniform across -messaging protocols. - -***** TODO [#B] Telegram and IRC read tools :feature: - -Same shape as Slack for =telega= (Telegram) and =erc= (IRC): -recent-message reads, search, and draft compose. Bundled because -the API shape is identical even if the underlying clients differ. - -***** TODO [#B] Contact resolution tools :feature: - -Resolve a name to email / Slack ID / Telegram handle via -=org-contacts= and the configured address books. Removes the -"who's this person again" friction from the compose flows above. - -**** TODO [#B] File and Buffer Related Tools - -Affordances that expose the user's actual workspace -- open buffers, -narrowed regions, marked files, vterm / eshell sessions -- as -structured context. Stops the model from asking "what file are you -looking at" or "what region is selected." - -***** TODO [#B] Buffer state tools :feature: - -List visible buffers with major-mode + file (when any); read the -narrowed region instead of the whole buffer; report point + mark -positions and the active region's text. The single most-asked -question between turns becomes a tool call. - -***** TODO [#B] Dirvish / Dired tools :feature: - -Read marked files, sort state, and filter state from a Dired or -Dirvish buffer. Lets the agent operate on "the files I just marked" -rather than "files in this directory" -- a real distinction in any -review or refactor workflow. - -***** TODO [#B] Vterm session tools :feature: - -Recent command output from a named vterm session; scroll-history -search. Pairs naturally with the =ai-vterm= design: the agent -running in one project's vterm can read another project's vterm -without leaving the chat. - -***** TODO [#B] Eshell session tools :feature: - -Same shape as the vterm tools for =eshell= sessions -- last-command -output, history search, current directory. Most useful for -agent-driven inspection of long-running pipelines. - -**** TODO [#B] Filesystem Related Tools - -Affordances that let the agent operate on actual files on disk and -run common CLI utilities -- pandoc, ffmpeg, imagemagick, ripgrep, -fd, jq -- rather than relying on me to paste content or run -commands by hand. - -*Design tension to resolve before any of these ship: one tool per -utility, or one generic =run_shell_command=?* - -The shortlist's first pass DEFERRED a generic =run_shell_command=: -sandboxing to HOME + /tmp with a denylist for destructive ops is -straightforward, but the denylist can never be exhaustive, and -"confirmation for everything else" becomes click-fatigue. - -The children below take the other path -- *one gptel tool per -binary*, with a strictly-typed argv shape (e.g. -=pandoc_convert(input_path, output_format)=, not -=pandoc_convert(args_string)=). Each tool: - -- Validates its own paths (must be under HOME, outputs in a - sandboxed dir). -- Rejects dangerous flags explicitly (pandoc =--filter=, ffmpeg's - =-protocol_whitelist= chicanery, imagemagick's policy bypasses). -- Runs via =call-process= with an argv list -- no shell parsing, - no string-interpolation injection. -- Caps output and reports truncation inline. - -The trade-off is breadth: every new CLI tool means a new gptel tool -file. Acceptable because (a) the list of utilities I actually need -agent access to is small (~8 below covers most of it), and (b) each -wrapper gets type-checked argv and a focused description the model -can reason over, which is genuinely better than a free-form -=run_shell_command(string)=. - -The =eshell_submit= entry at the end is the escape hatch for one- -off needs the wrappers don't cover -- =:confirm t= always. - -Adjacent categories: the existing =gptel-tools/= file CRUD -(=read_text_file=, =write_text_file=, =update_text_file=, -=list_directory_files=, =move_to_trash=) is the foundation this -category extends. =web_fetch= is the network-fetch counterpart. - -***** TODO [#B] Document conversion (pandoc) :feature: - -Convert between markdown, org, html, pdf, docx, latex, epub, plain -text. Most common use: "extract this docx to markdown so I can -read it inline." Strict argv: input path, output format, optional -output path. Reject =--filter= and =--lua-filter= (arbitrary code -execution). Output written to a sandbox dir unless explicit -override. - -***** TODO [#B] Image manipulation (imagemagick) :feature: - -Resize, format-convert, get-metadata (=identify=), optionally crop / -rotate / annotate. Common use: "resize this PNG to a thumbnail" or -"convert these HEICs to JPEGs." Strict argv per operation. -Reject pre-validated dangerous formats (the historical EXR / SVG / -MVG CVE surface) unless explicitly enabled. ImageMagick's -=policy.xml= is the underlying defense; the wrapper enforces it at -the tool boundary too. - -***** TODO [#B] Audio / video processing (ffmpeg) :feature: - -Trim, transcode, extract audio, get-metadata (=ffprobe=). Paths -under HOME only; reject network-protocol inputs (=http:= / =rtmp:= -/ =rtsp:=) so the model can't pull from arbitrary sources. Pairs -with the existing transcription module -- the same "extract audio -from video" path =cj/transcribe-media= uses internally. - -***** TODO [#B] Content search (ripgrep) :feature: - -=rg= wrapper with path / glob filtering, result-count cap, optional -literal-vs-regex mode. Pure read. Was in the shortlist's ADOPT -bucket as =search_in_files=. Highest-leverage filesystem tool by -expected call frequency -- "where in this repo is X" is the -question I paste agent output for most often. - -***** TODO [#B] File discovery (fd) :feature: - -=fd= (or =find= fallback) wrapper, capped result count. Pure -read, lower stakes than =search_in_files= (filenames only, no -content). Common pairing: =find_file_by_name= then -=read_text_file=. - -***** TODO [#B] Metadata extraction (file / exiftool) :feature: - -=file= for MIME-type detection; =exiftool= for image / video / -audio metadata. Lets the agent answer "what is this file" or -"when was this photo taken" without me opening external tools. -Pure read. - -***** TODO [#B] Structured data processing (jq / yq) :feature: - -=jq= for JSON, =yq= for YAML / TOML. Filter / project / transform -structured data into a smaller, more focused view before reading. -Strictly read-only -- output goes to the chat, not to disk. The -agent often wants "the third element of .results" from a JSON file -and this is much cheaper than pasting the whole thing. - -***** TODO [#B] Eshell command submission :feature: - -Submit a single eshell command line, return output (capped). -=:confirm t= always -- this is the escape hatch where the -strictly-typed wrappers above don't fit, so each invocation needs -my eyeball. Eshell parses in-process (no /bin/sh fork) so the -security surface is narrower than a shell command runner, but it's -still effectively arbitrary execution -- treat it as such. - -**** TODO [#B] Media and Reading Related Tools - -Affordances over non-code content: feeds, PDFs, EPUBs, music. The -agent's job here is summarize / extract / queue, not produce. - -***** TODO [#B] Elfeed entry tools :feature: - -Read entry body; list unread by feed or tag; mark read after a -summary lands in a roam node or inbox. Enables "give me the -non-noise headlines from this week's feeds" flows. - -***** TODO [#B] PDF and EPUB text tools :feature: - -Extract plain text from a PDF page or page range (via =pdftotext=) -and from an EPUB (via the existing nov-mode pipeline). Lets the -agent summarize / quote a research paper or book chapter without -me pasting passages. - -***** TODO [#B] EMMS playback and queue tools :feature: - -Current track, queue contents, playback state; queue or play a -path; compose a playlist from a prompt ("play something focusing -that's not Nick Cave"). Light tools, but a frequent friction -point. - -**** TODO [#B] Development Workflow Related Tools - -Affordances over the dev loop: compilation output, test invocation, -coverage / profile data, flycheck / flymake diagnostics. - -***** TODO [#B] Compilation buffer tools :feature: - -Read the most recent =compile= buffer output; parse error locations -to =file:line=; summarize what broke. Pairs with the F6 test-runner -flow -- "tell me what's failing" becomes a single agent turn -instead of paste + parse. - -***** TODO [#B] Project test invocation tools :feature: - -Run =make test-file FILE=X= / =make test-name TEST=Y= / -project-equivalent and return results. Currently each agent guesses -the project convention; expose the canonical invocation explicitly -per project so the agent can run focused tests itself. - -***** TODO [#B] Coverage and profile tools :feature: - -Read the most recent SimpleCov JSON or profile dump. Lets the -agent answer "what's still uncovered after this push" or "what -function dominates startup time" against real measured data. - -***** TODO [#B] Diagnostic tools (flycheck / flymake) :feature: - -Surface current-buffer or project-wide errors and warnings. Useful -both as a "what's broken right now" check and as input to the -patch-narrative buffer / commit-intent workbench above. - -**** CANCELLED [#B] gptel-magit activation fails on velox :bug:quick: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-01 -:END: -Surfaced 2026-05-25 while diagnosing an unrelated load failure over SSH. velox-specific — the workstation has a current gptel and does not show it. - -At startup (and reproducibly in batch) velox logs: "Unable to activate package `gptel-magit'. Required package `gptel-0.9.8' is unavailable." gptel-magit depends on gptel >= 0.9.8 and velox's installed gptel is older or missing, so it can't activate. A startup warning, not a blocker. - -Reproduce: -: emacs --batch --no-site-file -L . -L modules --eval "(package-initialize)" --eval "(message \"done\")" 2>&1 | grep -i gptel - -Next step: check the installed gptel version (=(assq 'gptel package-alist)= or =M-x package-list-packages=), update gptel to >= 0.9.8, then re-evaluate gptel-magit activation. If gptel was pinned/held on velox, reconcile the pin against the gptel-magit dependency. - - -** TODO [#C] Build an Org-native API workspace :feature:test: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-21 -:END: - -Moved to Someday/Maybe on 2026-06-23 when gptel was archived. This -design used gptel for its AI-assisted parts (restclient-ai.el, API -summaries, the AI-debugging ideas); with gptel archived those modules -are orphaned. The non-AI parts (OpenAPI import, request execution, -response capture) still stand on their own, so I shelved the whole design -here rather than dropping it. Pull it back to Open Work if the non-AI -core is worth building. - -Build an Emacs-native API workspace layer that keeps =restclient.el= useful for -lightweight request execution while adding OpenAPI import, Org notebooks, -response capture, inline images, and =gptel=-assisted API documentation. - -*** Spec - -**** Summary -Build a small Emacs API-workspace layer that keeps =restclient.el= as the -plain-text request executor, while adding higher-level discovery, generation, -Org notebook, response handling, and =gptel=-assisted documentation workflows. - -The intended result is not a Postman clone. It should feel like an -Emacs-native API lab: -- generate request collections from OpenAPI/Swagger specs -- browse and execute requests from =.rest= files or Org notebooks -- save useful responses back into Org -- display image responses inline -- use =gptel= to explain APIs, endpoints, request bodies, and responses -- leave room for =verb.el= or Hurl where they are a better fit - -**** Goals -- Preserve the current lightweight =restclient.el= workflow for ad-hoc calls. -- Add an OpenAPI importer that can generate useful first-draft request files. -- Add an Org workspace format for API notes, executable request blocks, results, - response links, and generated summaries. -- Add response post-processing helpers for JSON, binary/image data, and model - summaries. -- Make common auth flows easy to scaffold without storing secrets in generated - files. -- Keep generated artifacts readable and editable by hand. -- Keep implementation modular enough that =verb.el= can be evaluated as a richer - Org-native frontend. - -**** Non-Goals -- Do not build a full graphical API client. -- Do not store secrets directly in Org or =.rest= files. -- Do not attempt complete OpenAPI 3.1 schema synthesis in the first pass. -- Do not require =gptel= for ordinary request execution. -- Do not make Hurl a runtime dependency for the restclient workflow. - -**** Primary User Flows -***** Import An API -1. User runs =cj/restclient-import-openapi=. -2. Command prompts for a URL or local OpenAPI/Swagger file. -3. Command parses the spec into normalized endpoint records. -4. Command prompts for output format: - - =restclient= request collection - - Org API workspace - - both -5. Command writes generated files under a project/API workspace directory. -6. Generated file includes host variables, auth placeholders, request examples, - and a short summary of how to start using the collection. - -***** Describe An API -1. User runs =cj/restclient-describe-api= from a generated workspace or spec file. -2. Command extracts API metadata, paths, operations, schemas, auth, and tags. -3. Command sends a bounded summary payload to =gptel=. -4. Result is inserted under an Org =Overview= subtree. - -***** Execute And Capture A Request -1. User executes a request via =restclient.el= or =ob-restclient=. -2. Command captures response status, headers, content type, body, and timestamp - when available. -3. JSON/XML responses can be inserted as source blocks or summarized. -4. Image responses are saved to an assets directory and linked inline in Org. -5. Binary responses that are not image-like are saved as file links. - -***** Iterate On A Response -1. User runs helper commands against the last response: - - pretty-print JSON/XML - - run =jq= - - summarize with =gptel= - - extract a value into a restclient variable - - save body to a file -2. The result is inserted near the endpoint subtree or shown in a temporary - buffer depending on command prefix/options. - -**** Proposed Modules -***** =modules/restclient-workspace.el= -Main configuration and user-facing commands. Owns keybindings, workspace -creation, dispatch commands, and integration with existing restclient config. - -***** =modules/restclient-openapi.el= -OpenAPI/Swagger loading and normalization: -- fetch URL or read file -- parse JSON/YAML where available -- normalize servers, paths, methods, parameters, request bodies, auth schemes, - tags, operation IDs, and examples -- expose pure helper functions suitable for unit tests - -***** =modules/restclient-generate.el= -Generation layer: -- render =.rest= / =.http= request collections -- render Org workspaces -- synthesize simple JSON request bodies from schemas/examples -- generate variables and auth placeholders - -***** =modules/restclient-response.el= -Response helpers: -- identify content type -- save binary/image bodies -- insert Org links -- display inline images -- route JSON/XML/text handling -- track last response metadata - -***** =modules/restclient-ai.el= -=gptel= integration: -- summarize API specs -- explain endpoint behavior -- generate example payload notes -- summarize responses -- keep prompts bounded and avoid sending secrets - -**** File And Workspace Layout -Default generated workspace: - -#+begin_src text -data/apis/<api-slug>/ - <api-slug>.rest - <api-slug>.org - openapi.json - assets/ - responses/ -#+end_src - -The exact root should be configurable, defaulting to the existing REST data -directory if one is already present in the config. - -**** Org Workspace Shape -#+begin_example -,* API Name -:PROPERTIES: -:OPENAPI_SOURCE: https://example.com/openapi.json -:BASE_URL: https://api.example.com -:END: - -,** Overview -Generated or user-written API notes. - -,** Auth -Token acquisition notes and placeholders. No secrets stored here. - -,** Endpoints -,*** GET /users -:PROPERTIES: -:OPERATION_ID: listUsers -:METHOD: GET -:PATH: /users -:END: - -#+begin_src restclient :results raw -GET :host/users -Authorization: Bearer :token -Accept: application/json -#+end_src - -,**** Notes -,**** Responses -#+end_example - -**** Commands -- =cj/restclient-new-scratch= :: open a scratch =restclient-mode= buffer. -- =cj/restclient-open-file= :: open a REST file from the configured API data dir. -- =cj/restclient-import-openapi= :: generate a workspace from OpenAPI/Swagger. -- =cj/restclient-describe-api= :: insert a =gptel=-generated API overview. -- =cj/restclient-describe-endpoint= :: explain the endpoint at point. -- =cj/restclient-generate-example-body= :: generate or refresh sample JSON body. -- =cj/restclient-save-last-response= :: save response body and metadata. -- =cj/restclient-insert-last-response-org= :: insert response under Org subtree. -- =cj/restclient-display-image-response= :: save and display image response. -- =cj/restclient-response-jq= :: run =jq= against the last JSON response. -- =cj/restclient-copy-curl= :: copy the request at point as curl if supported. - -**** Keybindings -Keep the existing prefix shape under =C-; R=: -- =C-; R n= :: new scratch request buffer -- =C-; R o= :: open REST file -- =C-; R i= :: import OpenAPI/Swagger -- =C-; R d= :: describe API or endpoint -- =C-; R s= :: save/capture last response -- =C-; R j= :: run =jq= on last response -- =C-; R m= :: transient menu for workspace commands - -**** OpenAPI Import Details -Minimum first-pass support: -- OpenAPI 3.x JSON -- Swagger 2.0 JSON if easy to normalize -- YAML via available Emacs YAML library or external converter if already present -- =servers= / =host= + =basePath= -- path-level and operation-level parameters -- query/path/header parameters -- JSON request bodies -- examples and default schema values -- security schemes: - - HTTP bearer - - basic - - API key header - - API key query - -First pass can skip or mark as unsupported: -- polymorphic schemas beyond simple =oneOf= / =anyOf= note generation -- multipart body generation -- full OAuth flows -- callbacks/webhooks -- complete response schema rendering - -**** Secret Handling -- Generated files must use placeholders like =:token=, =:api-key=, or - =:basic-auth=. -- Do not write tokens into generated files. -- Prefer variables loaded from auth-source, environment variables, or manually - entered restclient variables. -- =gptel= prompts must strip obvious auth headers and secret-like values from - request/response payloads before sending context. - -**** Response Handling -- Text JSON/XML/HTML/plain responses may be inserted into Org as source blocks. -- JSON responses should support optional =jq= filters. -- Image responses should be saved under =assets/responses/= and inserted as Org - file links. -- After inserting image links, call =org-display-inline-images= when in Org. -- Large responses should be saved as files and linked rather than inserted. -- Binary non-image responses should be saved and linked with content type notes. - -**** Integration Choices To Evaluate -- =restclient.el= remains the default executor for =.rest= files. -- =ob-restclient= powers executable Org source blocks. -- =verb.el= should be evaluated as an alternate frontend for Org-native API - workspaces because it already has tree inheritance, embedded Elisp, and image - response display. -- Hurl should be evaluated as an export/test target, especially for chained - request tests and CI assertions. - -**** Testing Strategy -- Unit-test OpenAPI normalization with small fixture specs. -- Unit-test request generation for GET, POST, auth, query params, path params, - and request-body examples. -- Unit-test secret redaction before =gptel= calls. -- Unit-test response classification and Org insertion helpers. -- Integration-test generated =.rest= files for representative APIs. -- Integration-test generated Org workspaces with =ob-restclient= where feasible. -- Avoid live network tests by default; use fixtures/stubs unless explicitly - tagged =:network=. - -**** First Milestone -1. Keep/verify existing restclient scratch/open commands. -2. Add a tiny OpenAPI JSON parser/normalizer for a fixture spec. -3. Generate a readable =.rest= collection with variables and examples. -4. Generate a matching Org workspace. -5. Add response save/link helpers for JSON and images. -6. Add a =gptel= API-summary command with secret redaction. -7. Add focused unit tests and one sample fixture. - -**** Open Questions -- Should the canonical workspace be =.rest= first, Org first, or generated in - both formats by default? -- Is =verb.el= a better primary target than =ob-restclient= for the Org notebook - experience? -- Which YAML parser should be used if no YAML package is already configured? -- Where should API workspaces live by default: =data/=, =docs/=, or project root? -- Should response capture hook into restclient internals, or should capture be a - separate explicit command operating on response buffers? -- How much schema synthesis is useful before it becomes noisy? - -*** Ideas -- Treat =restclient.el= as the lightweight request scratchpad, and layer richer workflow commands around it instead of trying to turn it into Postman. -- Add an OpenAPI/Swagger importer: - - prompt for a spec URL or local file - - parse paths, methods, auth schemes, request bodies, and examples - - generate a =.http= / =.rest= request collection - - optionally generate an Org notebook with one subtree per endpoint -- Add an API description command using =gptel=: - - summarize the API from an OpenAPI spec - - explain each endpoint, auth requirement, parameters, and response shape - - write the summary into the generated Org workspace -- Generate example requests automatically: - - =GET= examples with query params - - =POST= / =PUT= / =PATCH= examples with sample JSON bodies - - =DELETE= examples with safe placeholder IDs - - shared variables like =:host=, =:token=, =:api-version=, =:tenant= -- Add auth helpers: - - bearer token insertion - - basic auth - - API key header/query param - - OAuth token fetch request template -- Improve Org integration: - - use =ob-restclient= for executable API notebooks - - support =:jq= filters for clean JSON results - - save response bodies under endpoint subtrees - - capture request/response metadata as Org properties -- Handle images and binary responses: - - detect image =Content-Type= - - save response data into an assets directory - - insert =[[file:...]]= links into Org - - call =org-display-inline-images= after execution -- Add response-processing commands: - - pretty-print JSON/XML - - run =jq= against the last response - - summarize response with =gptel= - - extract fields into restclient variables for follow-up calls -- Add request collection ergonomics: - - imenu/consult navigation by endpoint - - transient menu for send/copy curl/jq/save response - - templates for common headers - - per-project API workspace discovery -- Investigate =verb.el= as the richer Org-native frontend: - - Org tree inheritance for host/header/auth defaults - - embedded Elisp in request specs - - built-in display of image/PDF/SVG responses - - likely better base for a notebook-style API client -- Investigate Hurl for repeatable API tests: - - request chaining - - captures - - assertions - - CI-friendly execution - - possible export target from generated API workspaces - -*** Original Goals -**** Keybindings to test -- C-; R n — new scratch *restclient* buffer (should open in restclient-mode) -- C-; R o — open .rest file (should default to data/ directory) - -**** Functional tests -1. Open tutorial-api.rest, run JSONPlaceholder GET (C-c C-c) — verify response inline -2. Run POST example — verify 201 response with fake ID -3. Run httpbin header echo — verify custom headers echoed back -4. Navigate between requests with C-c C-n / C-c C-p -5. Test jq filtering (requires jq installed): restclient-jq loaded? -6. Open scratch buffer (C-; R n), type a request manually, execute -7. which-key shows "REST client" menu under C-; R - -* Emacs Resolved -** DONE [#B] Fix likely =elpa-mirror-location= path bug :bug:quick: -CLOSED: [2026-05-03 Sun] - -=early-init.el= builds =elpa-mirror-location= with: - -#+begin_src emacs-lisp -(concat user-home-dir ".elpa-mirrors/") -#+end_src - -That likely expands to =~/..= incorrectly, e.g. =/home/cjennings.elpa-mirrors/= -instead of =/home/cjennings/.elpa-mirrors/=. Use =expand-file-name= instead. - -Acceptance criteria: -- Local mirror paths resolve under the home directory as intended. -- Add a small testable helper if this logic moves out of =early-init.el=. - -Done 2026-05-03: -- Replaced =concat= path construction with =expand-file-name= for - =elpa-mirror-location=, =localrepo-location=, and local mirror archive paths. -- Added =tests/test-early-init-paths.el= to load =early-init.el= with package - side effects stubbed and assert local archive paths. - -** DONE [#B] Fix =vc-follow-symlinks= setting in =system-defaults.el= :bug:quick: -CLOSED: [2026-05-03 Sun] - -=modules/system-defaults.el= has: - -#+begin_src emacs-lisp -(setq-default vc-follow-symlinks) -#+end_src - -The comment says "don't ask to follow symlinks if target is version -controlled", but evaluating this leaves =vc-follow-symlinks= as =nil=. That -means the intended prompt suppression is not actually configured. The likely -fix is =t=, but verify the exact Emacs semantics first. - -Acceptance criteria: -- Set =vc-follow-symlinks= to the intended value explicitly. -- Add a small regression test or startup smoke assertion for this setting. -- Confirm opening a symlinked, version-controlled file no longer prompts. - -Done 2026-05-03: -- Confirmed from Emacs docs that =t= follows version-controlled symlinks without - prompting. -- Set =vc-follow-symlinks= explicitly to =t=. -- Added =tests/test-system-defaults-vc-follow-symlinks.el=. - -** DONE [#B] Fix overwritten =C-; != system command prefix :bug:quick: -CLOSED: [2026-05-03 Sun] - -=system-commands.el= first binds =cj/system-command-map= under =C-; !=, then -later replaces the same prefix with =cj/system-command-menu=: - -#+begin_src emacs-lisp -(keymap-set cj/custom-keymap "!" cj/system-command-map) -... -(keymap-set cj/custom-keymap "!" #'cj/system-command-menu) -#+end_src - -That likely makes the documented subkeys such as =C-; ! r= and =C-; ! s= -unreachable. - -Expected outcome: -- Decide whether =C-; != is a prefix map or a direct menu command. -- If keeping both, bind the menu inside the prefix, e.g. =C-; ! != or =C-; ! m=. -- Add a key-resolution smoke test for the chosen bindings. - -Done 2026-05-03: -- Kept =C-; != as the prefix map. -- Moved the completing-read menu to =C-; ! !=. -- Added which-key labels for the documented subkeys. -- Added =tests/test-system-commands-keymap.el=. - -** DONE [#B] Ensure formatters for TS, Python, Go, Shell with automated tests :tests: -CLOSED: [2026-04-30 Thu] - -Audit showed the four formatters were already consistently bound to =C-; f= -across the relevant mode-maps. No production change needed — this branch -shipped the regression net only. - -5 new files (1 testutil + 4 per-language test files), 17 tests total, all -passing. - -Per-language wiring inventory (locked in): -- Python: =blacken-buffer= in =python-ts-mode-map= (use-package =:bind=) -- Shell: =shfmt-buffer= in =sh-mode-map= and =bash-ts-mode-map= - (use-package =:bind=, gated on =:if (executable-find shfmt-path)=) -- Go: =gofmt= via =cj/go-mode-keybindings= hook + =local-set-key= -- TS / JS / Web: =cj/webdev-format-buffer= via =cj/webdev-keybindings= hook - -Each test file checks: prog module requires without error, formatter package -is in =features=, format command is fboundp, C-; f binding resolves, and the -underlying executable is on PATH (skipped via =ert-skip= if not installed). - -Real-formatting tests (run formatter on misformatted input, assert output) -were deferred — wiring tests catch the highest-frequency regressions cheaply -without crossing the boundary into testing the upstream formatter tools. - -** DONE [#A] Continue coverage push on low-coverage modules :tests: -CLOSED: [2026-04-30 Thu] - -The four scoped low-coverage modules — =keybindings.el=, =config-utilities.el=, -=org-noter-config.el=, =host-environment.el= — are now covered. 121 new tests -across 18 test files. Plus one production bug fixed in -=cj/validate-org-agenda-timestamps= (property-check branch was dead since the -function was written: =(intern (downcase prop))= built plain symbols where -=org-element-property= expects keywords). - -Modules covered (per-function test files, Normal/Boundary/Error categories): - -- =keybindings.el= — =cj/jump-open-var=, the auto-generated jump commands. -- =host-environment.el= — laptop/desktop predicates, platform predicates, - display predicates, system-timezone detection. Folded a docstring fix on - =cj/detect-system-timezone= along the way. -- =config-utilities.el= — =with-timer=, =cj/compile-this-elisp-buffer=, - =cj/emacs-build--summary-string=, info-commands smoke. Plus refactor pass - to extract testable internals from the four heavyweight interactives: - =cj/--delete-compiled-files-in-dir=, =cj/--benchmark-method=, - =cj/--recompile-emacs-home=, =cj/--validate-timestamps-in-buffer= + - =cj/--format-validation-report-section=. -- =org-noter-config.el= — preferred-split, title-to-slug, - generate-notes-template, the predicate cluster. - -Broader scope (the 11 high-value untested modules, 7 lightly-tested ones, and -~28 use-package wrappers to triage) is tracked under the [#B] "Coverage audit: -untested and lightly-tested modules" entry. - -** DONE [#B] Test Slack mark-as-read and bury buffer (C-; S q) :tests: -CLOSED: [2026-04-30 Thu] - -Verified working. =cj/slack-mark-read-and-bury= is bound to =C-; S q= in -=modules/slack-config.el=, replacing the previous binding that referenced a -non-existent =slack-buffer-mark-as-read-and-bury=. - -** DONE [#A] Fix calendar-sync UNTIL boundary regression :bug: -CLOSED: [2026-05-03 Sun] - -Real cause was a Saturday-only flake in the test, not a stale =.elc= as -earlier triage suggested. =test-calendar-sync--expand-weekly-boundary-single-week-5-element-until= -built its byday string from a 0-indexed Sunday-first array -=("SU" "MO" "TU" "WE" "TH" "FR" "SA")= while the production code uses -Monday=1, Sunday=7 throughout. When start-date landed on a Sunday -(start-weekday=7), =(nth 7 array)= returned nil, and inside =expand-weekly= -the =(mod (- nil current-weekday) 7)= form raised -=wrong-type-argument number-or-marker-p nil=. The test failed every -Saturday (when "tomorrow" is Sunday) and passed the other six days. - -Fixed in commit =8ec668d= by switching the lookup to -=(nth (1- start-weekday) '("MO" "TU" "WE" "TH" "FR" "SA" "SU"))= — the -same convention as every other weekday-mapping in the codebase. Verified -across all 7 weekdays via faked =current-time=. - -Production code was internally consistent; no production change needed. - -** DONE [#B] Investigate missing yasnippet configuration -CLOSED: [2026-02-16 Mon] - -Resolved: snippets were in ~/sync/org/snippets/ but directory was empty after -machine migration. Restored 28 snippets from backup, relocated snippets-dir -to ~/.emacs.d/snippets/ for source control. - -** DONE [#B] Write Complete ERT Tests for This Config [13/13] -CLOSED: [2026-02-16 Mon] - -All 13 modules covered: custom-case (43), custom-datetime (10), hugo-config (41), -org-capture-config (22), modeline-config (26), config-utilities (11), -org-agenda-config (31), org-contacts-config (40), ui-config (27), -org-refile-config (16), org-webclipper (31), org-noter-config (30), -browser-config (20). 172 test files, all passing. - -** DONE [#B] Validate recording startup -CLOSED: [2026-02-15 Sun 15:40] - -Check process status after starting. -Parse ffmpeg output for errors. -Show actual ffmpeg command for debugging. - -** DONE [#C] Fix EMMS keybinding inconsistency with other buffers -CLOSED: [2026-02-15 Sun 15:40] - -EMMS keybindings conflict with standard buffer keybindings, causing mistypes. -Results in accidental destructive actions (clearing buffers), requires undo + context switch. -Violates Intuitive value - muscle memory should help, not hurt. - -** DONE [#B] Update stale model list in ai-config.el -CLOSED: [2026-03-06 Fri] - -Model IDs were outdated. Updated to current models (claude-opus-4-6, claude-sonnet-4-6, etc.). -See cleanup task in ai-config.el for full list of related improvements. - -** DONE [#C] Graduate easy-hugo into hugo-config.el, retire wip.el, uninstall pomm -CLOSED: [2026-04-22 Wed] - -Move the easy-hugo use-package block from modules/wip.el into modules/hugo-config.el so the full Hugo pipeline (new post → ox-hugo export → preview server → SSH deploy) lives in one place and is actually reachable at runtime. wip.el is currently not required in init.el, so its only live block (pomm) never ran anyway. - -Scope: -- Verify easy-hugo is usable against current Hugo CLI and the paths in the existing config (~/code/cjennings-net/, /var/www/cjennings/). -- If easy-hugo is healthy: graduate it and propose keybindings under the C-; h hugo prefix. -- If easy-hugo is unmaintained or broken: document the issues, assess whether fixing or forking is viable. -- Delete modules/wip.el entirely and remove the commented-out (require 'wip) line at init.el:156. -- Uninstall pomm (remove from elpa/). -- Confirm make compile no longer warns about wip or pomm. - -** DONE [#C] Consider Recording Enhancement via post-processing hooks -CLOSED: [2026-04-04 Sat 12:00] - -Auto-compress after recording. -Move to cloud sync directory. -Generate transcript (once transcription workflow exists). - -** DONE [#B] Implement coverage reporting (per docs/specs/coverage-spec-implemented.org) -CLOSED: [2026-04-23] - -Diff-aware coverage report with pluggable backends. Shipped v1 on 2026-04-23. - -Design: [[id:7d7f4486-fad7-4f0a-bd9a-775bd4cd8f7e][docs/specs/coverage-spec-implemented.org]] - -What shipped: -- modules/coverage-core.el (engine, backend registry, cj/coverage-report, cj/coverage-report-mode) -- modules/coverage-elisp.el (undercover.el backend, auto-registered on load) -- make coverage Makefile target (simplecov JSON output, per-file isolation, .elc cleanup, exclusion list) -- tests/run-coverage-file.el (undercover driver for the Makefile) -- ERT tests for all pure helpers (parse-simplecov, parse-diff, intersect, format-report, backend registry, scope lookup) plus one smoke test for the command -- F7 global binding -- docs/specs/coverage-spec-implemented.org (design doc with historical LCOV→simplecov pivot note) - -Notable pivots during implementation: -- Switched collection format from LCOV to simplecov (undercover's :merge-report t only supports simplecov). -- `make coverage` must delete modules/*.elc first so undercover's source-level instrumentation actually fires. -- Excluded tests/test-all-comp-errors.el from coverage runs (byte-compiles modules, which fails under undercover instrumentation). - -Deferred to future tickets: -- Python, TypeScript, Go backends -- Fringe-overlay coverage display (parked over perf concerns) -- Historical coverage tracking - -** DONE [#A] Fix "Invalid face attribute :foreground nil" flood :bug: -CLOSED: [2026-04-26 Sun 20:15] - -Diagnosed 2026-04-26 — paused at /start-work Gate 2. The diagnostic was originally saved to =~/code/emacs-wttrin/inbox/wttrin-face-flood-diagnosis.txt= but that file has since been cleaned out of the wttrin inbox; the summary below is the surviving record. - -Summary: root cause is =wttrin--make-emoji-icon= in =~/code/emacs-wttrin/wttrin.el:598-608=. Builds a face spec with =:foreground foreground= unconditionally when =wttrin-mode-line-emoji-font= is set; the caller passes nil when the cache is fresh, producing =(:family ... :foreground nil)= which Emacs treats as invalid on every redisplay. - -Fix lives in the wttrin repo (cross-repo), not =.emacs.d=. Two-commit scope: regression test + fix. - -** DONE [#B] Test Slack desktop notifications (DM and @mention) :tests: -CLOSED: [2026-04-26 Sun] - -Notifications were silently failing due to two bugs in =cj/slack-notify=: -1. =slack-room-im-p= (nonexistent) → =slack-im-p= (correct EIEIO predicate) -2. =slack-message-to-string= (propertized) → =slack-message-body= (plain text) - -Verified in actual Slack use: desktop notifications fire correctly for DMs and @mentions, with the title and message body rendering as expected. - -*File:* modules/slack-config.el (cj/slack-notify function) - -** DONE [#C] Clean up ai-config.el -CLOSED: [2026-03-06 Fri] - -Cleaned up assorted issues in =modules/ai-config.el=: -- Stale model list updated to current IDs (=claude-opus-4-6=, =claude-sonnet-4-6=, etc.). -- Removed duplicate =gptel-backend= setq (lines 284 and 295 both did the same set). -- Deleted the unused =cj/gptel-backends= defvar (duplicated =cj/gptel--available-backends=). -- Moved helpers (=cj/gptel--fresh-org-prefix=, =cj/gptel--refresh-org-prefix=, =cj/gptel-backend-and-model=, =cj/gptel-insert-model-heading=) outside the use-package =:config= block for visibility and byte-compilation. -- Changed =gptel-include-reasoning= from ='ignore= to a buffer name (=*AI-Reasoning*=) so reasoning lands in a separate buffer, isn't re-sent as context, and can be toggled per-session via the gptel menu (=C-; a M=). -- Switched =gptel-magit= loading from a hook to lazy autoloads via =with-eval-after-load 'magit= so it only loads on key press. -- Moved Rewrite from =&= to =C-; a r= and Clear context to =C-; a c= for clearer mnemonics. - -** DONE [#B] Use file basename, not buffer name, when moving buffer files :review:bug:quick: -CLOSED: [2026-05-03 Sun] -:PROPERTIES: -:ARCHIVE_TIME: 2026-05-03 Sun 19:24 -:ARCHIVE_FILE: ~/.emacs.d/todo.org -:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review custom editing utility modules -:ARCHIVE_CATEGORY: todo -:ARCHIVE_TODO: DONE -:ARCHIVE_ITAGS: review -:END: - -=cj/--move-buffer-and-file= builds the destination as =(concat dir "/" name)=, -where =name= is =(buffer-name)=. If the buffer has been renamed, uniquified -(e.g. =foo.txt<2>=), or otherwise differs from the file basename, the move can -write an unexpected destination filename. - -Expected outcome: -- Use =(file-name-nondirectory filename)= for the destination basename unless - the interactive command explicitly asks for a new name. -- Add regression tests for: - - renamed buffer visiting =original.txt=, - - duplicate buffer names / uniquified names, - - target directory with and without trailing slash. - -Done 2026-05-03: -- =cj/--move-buffer-and-file= now derives the destination basename from - =buffer-file-name=. -- =cj/move-buffer-and-file= uses the same basename when checking/prompting for - overwrite. -- Added regression coverage for renamed and uniquified buffer names. - -** DONE [#B] Fix malformed drill capture template in =org-capture-config.el= :review:bug:quick: -CLOSED: [2026-05-03 Sun] -:PROPERTIES: -:ARCHIVE_TIME: 2026-05-03 Sun 19:28 -:ARCHIVE_FILE: ~/.emacs.d/todo.org -:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review Org workflow modules -:ARCHIVE_CATEGORY: todo -:ARCHIVE_TODO: DONE -:ARCHIVE_ITAGS: review -:END: - -The ="d"= drill capture template appears to have a malformed source link: - -#+begin_src org -Source: [[%:link][%:description] -nCaptured On: %U -#+end_src - -It is missing the closing =]]= and has a literal leading =n= before "Captured". - -Expected outcome: -- Fix the template string. -- Add a narrow test that expands or inspects the template and confirms the - source link plus "Captured On" line are well-formed. - -Done 2026-05-03: -- Closed the source link in the regular drill capture template. -- Removed the stray literal =n= before =Captured On=. -- Added =tests/test-org-capture-config-drill-template.el=. - -** DONE [#B] Disable auth-source debug logging by default :review:security:quick: -CLOSED: [2026-05-03 Sun] -:PROPERTIES: -:ARCHIVE_TIME: 2026-05-03 Sun 19:40 -:ARCHIVE_FILE: ~/.emacs.d/todo.org -:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review integrations and application modules -:ARCHIVE_CATEGORY: todo -:ARCHIVE_TODO: DONE -:ARCHIVE_ITAGS: review -:END: - -=auth-config.el= sets =auth-source-debug= to =t=. Debug output is helpful while -fixing GPG/auth-source issues, but credential lookup debug logging should not be -the steady-state default for a config that handles Slack, AI, REST, mail, and -transcription credentials. - -Expected outcome: -- Default =auth-source-debug= to nil. -- Add an explicit troubleshooting command or variable to enable auth debugging - temporarily. -- Confirm no module logs secret values directly on auth failure. - -Done 2026-05-03: -- Defaulted =auth-source-debug= to nil via =cj/auth-source-debug-enabled=. -- Added =cj/set-auth-source-debug= and =cj/toggle-auth-source-debug= for - temporary troubleshooting. -- Added =tests/test-auth-config-debug.el=. -- Scanned nearby auth callers; obvious failure messages name hosts/logins but - do not print secret values directly. - -** DONE [#B] Quote F6 current-file test commands in =dev-fkeys.el= :review:bug:quick: -CLOSED: [2026-05-03 Sun] -:PROPERTIES: -:ARCHIVE_TIME: 2026-05-03 Sun 19:44 -:ARCHIVE_FILE: ~/.emacs.d/todo.org -:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review programming workflow modules -:ARCHIVE_CATEGORY: todo -:ARCHIVE_TODO: DONE -:ARCHIVE_ITAGS: review -:END: - -=cj/--f6-test-runner-cmd-for= builds shell command strings from relative paths, -directories, and source stems: - -#+begin_src emacs-lisp -(format "pytest %s" rel-path) -(format "make test-name TEST=^test-%s-" stem) -(format "go test ./%s" rel-dir) -#+end_src - -This is fine for the current repo's simple filenames, but it will break or -misbehave for paths with spaces or shell metacharacters. Since these commands -feed =compile=, either quote each dynamic argument or move to a command-builder -that returns argv plus a shell-rendering function. - -Expected outcome: -- Quote =rel-path=, =stem= / test regex, and =rel-dir= appropriately. -- Add regression tests for: - - Python test file under a directory with spaces, - - Elisp module stem containing shell-significant characters, - - Go package directory with spaces. -- Keep existing command strings unchanged for ordinary paths. - -Done 2026-05-03: -- Added =cj/--f6-shell-quote-argument= so F6 command strings escape dynamic - paths and test regexes only when needed. -- Quoted Python rel-paths, generated Python test paths, Elisp =FILE= / - =TEST= values, and Go package paths. -- Added regression coverage for Python paths with spaces, Elisp stems with - shell metacharacters, and Go package directories with spaces. -- Confirmed ordinary command strings remain unchanged. - -** DONE [#B] Disable mail transport debug logging and validate dependencies :review:security: -CLOSED: [2026-05-03 Sun] -:PROPERTIES: -:ARCHIVE_TIME: 2026-05-03 Sun 19:57 -:ARCHIVE_FILE: ~/.emacs.d/todo.org -:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review integrations and application modules -:ARCHIVE_CATEGORY: todo -:ARCHIVE_TODO: DONE -:ARCHIVE_ITAGS: review -:END: - -=mail-config.el= sets =smtpmail-debug-info= to =t= and builds mail commands from -=executable-find= results at config time. If =msmtp= or =mbsync= is missing, the -configuration can silently produce unusable command values. Mail debug output is -also too sensitive to leave enabled by default. - -Expected outcome: -- Default =smtpmail-debug-info= to nil. -- Add an explicit mail troubleshooting variable/command for temporary SMTP - debug logging. -- Validate =msmtp= and =mbsync= before assigning send/sync commands, and show a - clear warning or disable the dependent feature when missing. -- Add a module-load test with stubbed =executable-find= results. - -Done 2026-05-03: -- Defaulted =smtpmail-debug-info= to nil via =cj/smtpmail-debug-enabled=. -- Added =cj/set-smtpmail-debug= and =cj/toggle-smtpmail-debug= for temporary - troubleshooting. -- Added validation helpers for =msmtp= and =mbsync= so missing executables - warn and do not produce unusable command values. -- Added =tests/test-mail-config-transport.el= with stubbed executable lookup. - -** DONE [#B] Make test scratch paths sandbox- and CI-friendly :refactor:tests: -CLOSED: [2026-05-03 Sun] -:PROPERTIES: -:ARCHIVE_TIME: 2026-05-03 Sun 19:59 -:ARCHIVE_FILE: ~/.emacs.d/todo.org -:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#A] Architecture review follow-up from 2026-05-03 -:ARCHIVE_CATEGORY: todo -:ARCHIVE_TODO: DONE -:ARCHIVE_ITAGS: refactor -:END: - -=tests/testutil-general.el= hardcodes =~/.temp-emacs-tests/=. That caused the -first =make coverage= run to fail under the default workspace sandbox because -tests attempted to write outside the repo and =/tmp=. - -Confirmed again 2026-05-03 with =make test=: the default sandbox run reported -32 failing test files across custom-buffer, custom-line, music, Org, undead -buffers, and recording cleanup tests. Rerunning the same command with approval -outside the sandbox passed all 311 test files. This is a test-environment -contract problem, not a regression in those modules. - -Expected outcome: -- Let tests honor an env var, for example =CJ_EMACS_TEST_DIR=. -- Default to =(make-temp-file ... t)= or a stable directory under - =temporary-file-directory=. -- Keep an option for a stable local directory when debugging manually. -- Ensure cleanup is robust and guarded against deleting outside the selected - test root. - -Acceptance criteria: -- =make test-file FILE=test-custom-line-paragraph-join-line-or-region.el= - works without special home-directory write permission. -- =make coverage= works in a clean sandbox/CI environment. -- Update any docs or Makefile notes that assume =~/.temp-emacs-tests/=. - -Done 2026-05-03: -- Changed =cj/test-base-dir= to honor =CJ_EMACS_TEST_DIR= for stable local - debugging and otherwise create a unique directory under - =temporary-file-directory=. -- Replaced prefix-string path checks with =file-in-directory-p= and added a - deletion guard that refuses broad roots such as =temporary-file-directory=. -- Updated =make clean-tests= to clean the new temp-root pattern and the legacy - =~/.temp-emacs-tests= directory. -- Added =tests/test-testutil-general.el=. -- Confirmed default sandbox =make test= passes: 312 test files. - -** DONE [#B] Fix C single-file compile command path handling :review:bug: -CLOSED: [2026-05-03 Sun] -:PROPERTIES: -:ARCHIVE_TIME: 2026-05-03 Sun 20:11 -:ARCHIVE_FILE: ~/.emacs.d/todo.org -:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review programming workflow modules -:ARCHIVE_CATEGORY: todo -:ARCHIVE_TODO: DONE -:ARCHIVE_ITAGS: review -:END: - -=prog-c.el= builds the fallback single-file compile command from =(buffer-name)=: - -#+begin_src emacs-lisp -(format "gcc -Wall -Wextra -g -o %s %s" - (file-name-sans-extension (buffer-name)) - (buffer-name)) -#+end_src - -This breaks for renamed buffers, duplicate buffer names, paths with spaces, and -files outside =default-directory=. - -Expected outcome: -- Use =buffer-file-name= for source path and derive output from the file path. -- Shell-quote both paths. -- If the buffer is not visiting a file, show a clear message or use a safe temp - target. -- Add regression tests for filenames with spaces and renamed buffers. - -Done 2026-05-03: -- Added =cj/c--single-file-compile-command= and changed the fallback path to - use =buffer-file-name= instead of =(buffer-name)=. -- Shell-quoted source and output paths. -- Made non-file buffers signal a clear =user-error=. -- Added =tests/test-prog-c-compile-command.el= for spaces, shell - metacharacters, renamed buffers, and non-file buffers. - -** DONE [#B] Replace shell-based coverage git diff calls with argv process calls :review:robustness:refactor: -CLOSED: [2026-05-03 Sun] -:PROPERTIES: -:ARCHIVE_TIME: 2026-05-03 Sun 20:11 -:ARCHIVE_FILE: ~/.emacs.d/todo.org -:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review programming workflow modules -:ARCHIVE_CATEGORY: todo -:ARCHIVE_TODO: DONE -:ARCHIVE_ITAGS: review -:END: - -=coverage-core.el= uses =shell-command-to-string= for git diff scopes, including -forms with command substitution: - -#+begin_src emacs-lisp -git diff $(git merge-base HEAD main)..HEAD --unified=0 -#+end_src - -The inputs are mostly fixed, but this code is central tooling and should avoid -shell parsing entirely. - -Expected outcome: -- Use =process-file= / =call-process= with argv lists. -- Compute merge bases with a separate git invocation. -- Surface git failures as clear =user-error= messages. -- Preserve the existing parser and report formatting tests. - -Done 2026-05-03: -- Added argv-boundary tests before the implementation change. -- Replaced =shell-command-to-string= with =process-file= based git helpers. -- Compute merge-base with a separate =git merge-base HEAD <base>= invocation - before running =git diff <merge-base>..HEAD --unified=0=. -- Surface non-zero git exits as =user-error= messages that include the git - argv, exit status, and command output. -- Updated the interactive coverage report smoke test to stub =process-file=. - -** DONE [#B] Cache or cheapen VC work in the custom modeline :review:perf: -CLOSED: [2026-05-03 Sun] -:PROPERTIES: -:ARCHIVE_TIME: 2026-05-03 Sun 20:24 -:ARCHIVE_FILE: ~/.emacs.d/todo.org -:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review UI and navigation modules -:ARCHIVE_CATEGORY: todo -:ARCHIVE_TODO: DONE -:ARCHIVE_ITAGS: review -:END: - -=modeline-config.el= computes VC branch/state in a mode-line =:eval= form using -=vc-backend=, =vc-working-revision=, =vc-git--symbolic-ref=, and =vc-state=. -Even though it only displays for the selected window, this can become expensive -in large repositories, remote/TRAMP buffers, or slow filesystems. - -Expected outcome: -- Measure the current cost in normal git repos and a TRAMP/remote-like case if - available. -- Cache branch/state per buffer and invalidate on buffer/file save, VC refresh, - or timer. -- Avoid VC calls for remote files unless explicitly enabled. -- Add tests around any pure formatting/cache invalidation helpers. - -Pitfalls: -- Mode-line code runs often; avoid anything that can block redisplay. -- Do not lose the useful active-window-only behavior. - -Done 2026-05-03: -- Added buffer-local VC modeline caching with a short TTL, plus cache clearing - on save and revert. -- Kept the active-window-only modeline rendering behavior. -- Skipped VC work for remote files by default, with a custom option to opt in. -- Added focused tests for cache reuse, TTL refresh, remote-file bypass, cache - clearing, and VC rendering metadata. -- Measured on this repo after the change: uncached reads were about 2.4 ms - each, cached reads were about 0.0025 ms each, and remote-skipped reads avoid - VC calls while still paying the cheap =file-remote-p= check. - -** DONE [#B] Make Projectile command-cache revert state compilation-local :review:robustness:bug: -CLOSED: [2026-05-03 Sun] -:PROPERTIES: -:ARCHIVE_TIME: 2026-05-03 Sun 21:11 -:ARCHIVE_FILE: ~/.emacs.d/todo.org -:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review programming workflow modules -:ARCHIVE_CATEGORY: todo -:ARCHIVE_TODO: DONE -:ARCHIVE_ITAGS: review -:END: - -=dev-fkeys.el= protects Projectile's compile/test/run command caches by -capturing prior state in the global =cj/--projectile-revert-state= and reverting -on failed compile when the cached command changed. The idea is useful and well -covered, but the state is global while compilation processes are asynchronous. - -Risk: -- Starting another Projectile compile/test/run before the first finish hook - fires can overwrite the state. -- The finish hook is installed even when no project/cache state was captured. -- A failure from one compilation buffer could theoretically act on state from a - later command. - -Expected outcome: -- Store revert metadata on the compilation buffer/process where possible, or - close over immutable state in a one-shot hook instead of using one global - variable. -- Only install the revert hook when state was captured. -- Add a test that simulates two overlapping compile processes finishing out of - order. - -Done 2026-05-03: -- Changed Projectile command-cache revert capture to return immutable state - instead of storing live compile metadata in one global variable. -- Installed one-shot buffer-local compilation finish hooks on the compilation - buffer returned by Projectile, so overlapping compiles keep separate revert - metadata. -- Avoided installing revert hooks when no project/cache state was captured. -- Added regression coverage for two overlapping compiles finishing out of order. - -** DONE [#C] Tighten =dev-fkeys.el= load-order contract with Projectile :review:cleanup: -CLOSED: [2026-05-03 Sun] -:PROPERTIES: -:ARCHIVE_TIME: 2026-05-03 Sun 21:17 -:ARCHIVE_FILE: ~/.emacs.d/todo.org -:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review programming workflow modules -:ARCHIVE_CATEGORY: todo -:ARCHIVE_TODO: DONE -:ARCHIVE_ITAGS: review -:END: - -=init.el= loads =dev-fkeys.el= before =prog-general.el=, while =prog-general.el= -owns the =projectile= setup. =dev-fkeys.el= currently works through autoloads, -=fboundp= checks, and top-level advice, but the dependency is implicit. - -Expected outcome: -- Either require/load Projectile before installing advice, or move the - =dev-fkeys= require after Projectile setup. -- Keep direct batch requiring of =dev-fkeys.el= test-friendly. -- Add a module-load smoke test for "Projectile not loaded yet" and "Projectile - loaded after dev-fkeys". - -Done 2026-05-03: -- Replaced raw top-level Projectile =advice-add= calls with named advice - wrappers and an explicit idempotent installer. -- Registered advice immediately when Projectile is already loaded, otherwise - delayed installation with =eval-after-load=. -- Kept direct batch requiring of =dev-fkeys.el= from forcing Projectile to load. -- Added smoke tests for deferred registration, already-loaded registration, and - bounded installation behavior when Projectile functions are unavailable. - -** DONE [#B] Retire legacy =cj/--projectile-revert-on-fail= and global revert state :review:chore: -CLOSED: [2026-05-03 Sun] -:PROPERTIES: -:ARCHIVE_TIME: 2026-05-03 Sun 21:32 -:ARCHIVE_FILE: ~/.emacs.d/todo.org -:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review programming workflow modules -:ARCHIVE_CATEGORY: todo -:ARCHIVE_TODO: DONE -:ARCHIVE_ITAGS: review -:END: - -After scoping the projectile cache-revert state to each compile (commit -=31edc86=), =cj/--projectile-revert-on-fail= and the global -=cj/--projectile-revert-state= are production-dead. They survive only so -=tests/test-dev-fkeys--projectile-revert-on-fail.el= keeps exercising the -inner decision logic via the legacy wrapper. - -Expected outcome: -- Delete =cj/--projectile-revert-on-fail= and =cj/--projectile-revert-state= - from =modules/dev-fkeys.el=. -- Re-point the existing =test-dev-fkeys--projectile-revert-on-fail.el= cases - at =cj/--projectile-revert-state-on-fail= (or rename the file to match - the new target). -- Confirm the broader dev-fkeys test set still passes after the rename. - -Done 2026-05-03: -- Removed the production-dead legacy wrapper and global revert state from - =dev-fkeys.el=. -- Repointed the existing revert tests at =cj/--projectile-revert-state-on-fail=. -- Removed stale test bindings/assertions that only existed for the legacy global - state. - -** DONE [#C] Review duplicate or competing search/keybinding setup in =selection-framework.el= :review:cleanup: -CLOSED: [2026-05-03 Sun] -:PROPERTIES: -:ARCHIVE_TIME: 2026-05-03 Sun 23:27 -:ARCHIVE_FILE: ~/.emacs.d/todo.org -:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review UI and navigation modules -:ARCHIVE_CATEGORY: todo -:ARCHIVE_TODO: DONE -:ARCHIVE_ITAGS: review -:END: - -=selection-framework.el= binds =C-s= to =consult-line= and later rebinds it to -=cj/consult-line-or-repeat=. The final behavior is probably intended, but the -earlier binding is dead configuration and makes the file harder to reason about. - -Expected outcome: -- Remove the intermediate =C-s= binding or explain it. -- Add a small test or smoke check that =C-s= resolves to - =cj/consult-line-or-repeat= after the module loads. - -Verify 2026-05-03: -- Removed the intermediate global =C-s= binding to =consult-line=. -- Kept the final =C-s= binding to =cj/consult-line-or-repeat=. -- Added a smoke test that loads =selection-framework.el= with package setup - stubbed and asserts =C-s= resolves to =cj/consult-line-or-repeat=. - -** DONE [#C] Move and test theme persistence behavior :review:tests:refactor: -CLOSED: [2026-05-03 Sun] -:PROPERTIES: -:ARCHIVE_TIME: 2026-05-03 Sun 23:46 -:ARCHIVE_FILE: ~/.emacs.d/todo.org -:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review UI and navigation modules -:ARCHIVE_CATEGORY: todo -:ARCHIVE_TODO: DONE -:ARCHIVE_ITAGS: review -:END: - -=ui-theme.el= persists theme names to =theme-file= and loads fallback themes -when the file is absent or invalid. The current default path is built from -=org-dir= as =emacs-theme.persist=, which makes UI theme persistence depend on -Org-directory configuration and keeps an Emacs preference outside the Emacs -home directory. - -Desired direction: -- Make the persisted theme file a dotfile inside =user-emacs-directory=, e.g. - =.emacs-theme= or another clear dotfile name. -- Remove the runtime need for =org-dir= from theme persistence. -- Keep the theme persistence code self-contained in =ui-theme.el= unless an - existing constants helper is a better local fit. -- Preserve the current user-facing behavior: chosen themes persist, unreadable - or invalid saved themes fall back, and literal ="nil"= means no enabled theme. -- Refactor the current large theme-load function into smaller helpers for: - reading persisted theme names, disabling enabled themes, loading one named - theme, applying a persisted theme value, and loading fallback themes. -- Prefer =defcustom= for user-facing persistence/fallback settings. -- Replace generic =cj/read-file-contents= / =cj/write-file-contents= names with - theme-specific helpers or move generic helpers elsewhere. -- Prefer =write-region= over visiting the file with =write-file= for persistence. -- Decide whether the top-level =(cj/load-theme-from-file)= side effect should - remain in the module or become an explicit init call; preserve startup behavior - either way. - -Useful tests: -- The default =theme-file= expands under =user-emacs-directory= and does not - depend on =org-dir=. -- Reading a missing/unreadable theme file returns nil. -- Writing to a writable temp theme file succeeds. -- Invalid theme name triggers fallback path without leaving multiple themes - enabled. -- The literal ="nil"= disables themes. -- Loading a valid persisted theme uses that theme and does not also load the - fallback. -- Theme application disables existing themes before loading a valid or fallback - theme, so themes do not stack. -- Theme writes use the configured =theme-file= and do not visit that file in a - temp buffer. - -Keep tests isolated by binding =theme-file= to a temp file and mocking -=load-theme= / =disable-theme= where appropriate. Avoid mutating the real -=custom-enabled-themes= state in tests. - -Pitfalls: -- =ui-theme.el= currently calls =cj/load-theme-from-file= at module load time, - so tests should either bind =theme-file= before loading or mock file/theme - effects carefully. -- If changing the persisted filename, consider whether a migration path from - the old =org-dir/emacs-theme.persist= location is worth doing now or should - be a separate compatibility task. - -Verify 2026-05-03: -- Moved the default =theme-file= to =(expand-file-name ".emacs-theme" - user-emacs-directory)=. -- Removed the =org-dir= / =user-constants= dependency from =ui-theme.el= theme - persistence. -- Split theme persistence into theme-specific helpers for read/write, - disabling themes, named theme loading, fallback loading, and applying a - persisted value. -- Switched persistence writes to =write-region=. -- Moved startup theme loading out of module load side effects and into - =init.el= immediately after requiring =ui-theme=. -- Added focused tests for the default path, missing reads, writes, - =write-region= use, valid persisted themes, invalid fallback, missing - fallback, and literal ="nil"=. -- Verified with =make test-file FILE=test-ui-theme-persistence.el=, - =make test-file FILE=test-all-comp-errors.el=, - =make test-file FILE=test-dupre-theme.el=, and full =make test=. - -** DONE [#B] Make test-runner focus state project-scoped :review:tests:bug: -CLOSED: [2026-05-03 Sun] -:PROPERTIES: -:ARCHIVE_TIME: 2026-05-03 Sun 23:46 -:ARCHIVE_FILE: ~/.emacs.d/todo.org -:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review programming workflow modules -:ARCHIVE_CATEGORY: todo -:ARCHIVE_TODO: DONE -:ARCHIVE_ITAGS: review -:END: - -=test-runner.el= stores =cj/test-focused-files= and =cj/test-mode= globally. -When switching between projects, focused test filenames and mode can bleed into -the next project. - -Expected outcome: -- Scope focused files and mode by project root. -- Keep the current UI commands unchanged. -- Coordinate with the existing [#B] "Add project-aware ERT test isolation when - switching projects" task so test registration and focus state follow the same - project boundary. - -Verify 2026-05-03: -- Added per-project test-runner state keyed by Projectile project root, with - focused files and all/focused mode tracked independently per project. -- Kept the existing interactive commands and legacy public variables mirrored - to the current project state. -- Removed the hard test-time dependency on requiring Projectile before project - root calls can be mocked. -- Added regression tests proving focused files and mode do not bleed across - projects. -- Verified with =make test-file FILE=test-test-runner.el=, - =make test-file FILE=test-all-comp-errors.el=, - =make test-file FILE=test-dev-fkeys--f6-test-runner.el=, - =make test-file FILE=test-dev-fkeys--f6-current-file-tests-impl.el=, and - full =make test=. - -** DONE [#B] Add project-aware ERT test isolation when switching projects :tests: -CLOSED: [2026-05-03 Sun] -:PROPERTIES: -:ARCHIVE_TIME: 2026-05-03 Sun 23:46 -:ARCHIVE_FILE: ~/.emacs.d/todo.org -:ARCHIVE_OLPATH: Emacs Open Work -:ARCHIVE_CATEGORY: todo -:ARCHIVE_TODO: DONE -:END: - -When switching between elisp projects (e.g., emacs.d to Chime), previously loaded -ERT tests remain in memory causing confusion and wrong tests to run. - -**Problem:** -- ERT tests globally registered in Emacs session -- `M-x ert RET t RET` runs ALL loaded tests from ALL projects -- Can accidentally run emacs.d tests when working on Chime -- Current workaround: restart Emacs (loses session state) - -**Solution:** -Create `cj/ert-clear-tests` and `cj/ert-run-current-project-tests`: -- Clear tests when switching projects (hook into project-switch) -- Use test name prefixes to selectively clear (cj/ vs chime-) -- Only run current project's tests - -**Success Criteria:** -- Switch projects -> old tests cleared -- Only current project's tests run with `M-x ert` -- Works with both interactive and batch runs - -Verify 2026-05-03: -- Added =cj/ert-clear-tests= to delete ERT tests loaded by this runner from - other known project roots while keeping the current project's tests. -- Added =cj/ert-run-current-project-tests= and routed =cj/test-run-all= through - a current-project selector, so the test runner's "all" path runs all tests - for the current project rather than every loaded ERT test in the session. -- Hooked =cj/test-project-switch-reset= into - =projectile-after-switch-project-hook= after Projectile loads. -- Added regression tests for clearing other-project ERT tests and selecting - only current-project test names. -- Verified with =make test-file FILE=test-test-runner.el=, - =make test-file FILE=test-all-comp-errors.el=, - =make test-file FILE=test-dev-fkeys--f6-test-runner.el=, - =make test-file FILE=test-dev-fkeys--f6-current-file-tests-impl.el=, and - full =make test=. - -** DONE [#B] Sanitize calendar-generated Org headings and properties :review:bug: -CLOSED: [2026-05-03 Sun] -:PROPERTIES: -:ARCHIVE_TIME: 2026-05-03 Sun 23:52 -:ARCHIVE_FILE: ~/.emacs.d/todo.org -:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review integrations and application modules -:ARCHIVE_CATEGORY: todo -:ARCHIVE_TODO: DONE -:ARCHIVE_ITAGS: review -:END: - -=calendar-sync--event-to-org= sanitizes description body text against accidental -Org headings, but event summaries, locations, organizers, statuses, and URLs are -inserted into headings/property drawers directly. Calendar text containing -newlines, leading stars, or property drawer markers can corrupt the generated -Org structure. - -Expected outcome: -- Add separate sanitizers for Org heading text and property values. -- Preserve readable event text while escaping or flattening structural - characters. -- Add tests for summaries with newlines/stars and locations with property-like - lines. - -Verify 2026-05-03: -- Added separate sanitizers for Org heading text and Org property values. -- Event summaries now flatten newlines and convert leading heading stars to - dashes before being inserted as Org heading text. -- Location, organizer, status, and URL values now collapse structural - whitespace into single-line property values before insertion into the - property drawer. -- Added regression tests for summaries with newlines/stars and property values - containing =:END:=, property-looking text, and heading-looking text. -- Verified with =make test-file FILE=test-calendar-sync--event-to-org.el=, - =make test-file FILE=test-calendar-sync--sanitize-org-body.el=, - =make test-file FILE=test-all-comp-errors.el=, - =make test-file FILE=test-calendar-sync.el=, - =make test-file FILE=test-calendar-sync--parse-event.el=, - =make test-file FILE=test-calendar-sync--event-start-time.el=, and full - =make test=. - -** DONE [#B] Add a no-config startup test for =calendar-sync.el= :review:security:refactor: -CLOSED: [2026-05-04 Mon] -:PROPERTIES: -:ARCHIVE_TIME: 2026-05-04 Mon 00:05 -:ARCHIVE_FILE: ~/.emacs.d/todo.org -:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review Org workflow modules/PROJECT [#A] Split personal calendar configuration from =calendar-sync.el= -:ARCHIVE_CATEGORY: todo -:ARCHIVE_TODO: DONE -:ARCHIVE_ITAGS: review security refactor -:END: - -Bind =calendar-sync-calendars= to nil and verify: -- requiring the module does not start a timer, -- =calendar-sync-status= reports the missing configuration cleanly, -- no network process is started. - -Verify 2026-05-03: -- Removed the tracked top-level personal calendar plist from =calendar-sync.el=, - leaving =calendar-sync-calendars= nil by default. -- Added an ignored private config path, =calendar-sync.local.el=, loaded when - readable so local calendar definitions can stay outside git. -- Added =calendar-sync.local.el= to =.gitignore= and moved the current local - calendar plist into that ignored file to preserve this machine's workflow. -- Gated top-level auto-start behind =(not noninteractive)= so batch/test loads - do not start timers or network fetches, even when private config exists. -- Added startup tests for no-config loads, missing-config status reporting, - private config loading, and private config not auto-starting in batch. -- Verified with =make test-file FILE=test-calendar-sync-no-config-startup.el=, - =make test-file FILE=test-calendar-sync.el=, - =make test-file FILE=test-all-comp-errors.el=, and full =make test=. - -** DONE [#C] Add focused tests for early startup archive construction :tests: -CLOSED: [2026-05-10 Sun] - -=tests/test-early-init-paths.el= covers path constants, but not archive -selection, archive priorities, refresh decisions, or the offline/localrepo -branches that make startup reproducible. - -Useful assertions after package bootstrap is extracted: -- Local repo and local mirrors are added only when their directories exist. -- Local archives keep higher priority than online archives. -- =cj/use-online-repos= disables online archives and refresh attempts. -- Stale or missing online archive caches request refresh only through the - extracted bootstrap path, not by loading unrelated modules. - -Verify 2026-05-10: -- Extended =tests/test-early-init-paths.el= to cover local archive presence, - local-vs-online priority, offline archive omission, fresh-cache no-refresh, - and missing-cache refresh behavior. -- Ran =make test-file FILE=test-early-init-paths.el=. - -** DONE [#C] Move inline GPT tool wiring out of =init.el= :startup:refactor: -CLOSED: [2026-05-10 Sun] - -=init.el= contains a =with-eval-after-load 'gptel= block that mutates -=load-path= and requires local files from =~/.emacs.d/gptel-tools=. This is -feature-specific integration code inside the top-level load graph, and it will -be hard to test or defer cleanly while it stays inline. - -Expected outcome: -- Move the tool registration into =ai-config.el= or a small dedicated module. -- Guard the local tool directory and individual tool files so missing optional - files produce a clear message rather than breaking startup after =gptel= loads. -- Keep =init.el= limited to coarse module loading until the load-graph refactor - removes most eager =require=s. -- Add a smoke test for the missing-directory path if the helper is pure enough. - -Verify 2026-05-10: -- Moved optional GPTel tool loading into =ai-config.el= via - =cj/gptel-load-local-tools=. -- Removed the inline =with-eval-after-load 'gptel= tool block from =init.el=. -- Added =tests/test-ai-config-gptel-local-tools.el= for missing-directory, - present-tool, and missing-file behavior. -- Ran focused AI config tests and checked parens for =init.el= and - =modules/ai-config.el=. - -** DONE [#C] Clean up Org keymap ownership and duplicate maps :cleanup:refactor: -CLOSED: [2026-05-10 Sun] - -=org-config.el= creates =cj/org-map= under =cj/custom-keymap=, then later -creates a separate =cj/org-keymap= under =C-; O=. Other Org modules bind their -own global prefixes directly. This works with the current eager load order, but -it makes the intended owner of Org commands less clear. - -Expected outcome: -- Pick one owner for the Org command prefix. -- Move module-specific menus under that owner or document why they remain - separate (=C-c n= for org-roam may be worth keeping). -- Avoid duplicate definitions for =C-; O= and =cj/org-map=. -- Coordinate with the broader custom keymap/load-order architecture task. - -Verify 2026-05-10: -- Removed the duplicate =cj/org-keymap= and kept =cj/org-map= as the single - owner of =C-; O= through =cj/custom-keymap=. -- Kept =C-; O c= bound to =cj/org-clear-element-cache=, which handles all Org - buffers by default and only the current Org buffer with a prefix argument. -- Added =tests/test-org-config-keymap-ownership.el= and updated the existing - Org sort test to load newer source in the presence of ignored =.elc= files. -- Ran =make test-file FILE=test-org-config-keymap-ownership.el= and - =make test-file FILE=test-org-sort-by-todo-and-priority.el=. - -** DONE [#A] Make repo reconciliation non-destructive by default :data:refactor: -CLOSED: [2026-05-10 Sun] - -Before this refactor, =reconcile-open-repos.el= recursively scanned repos and, -for dirty repos, ran -=git stash --quiet=, =git pull --rebase --quiet=, and =git stash pop --quiet= -before opening Magit. That is high blast radius for a convenience command: stash -pop conflicts, untracked files, submodules, and worktrees can all create messy -states. - -Verify 2026-05-10: -- Dirty repos now open Magit for review without running stash, pull, or stash - pop. -- Clean repos still pull with =git pull --rebase --quiet= via =process-file=. -- Git calls now use argv lists through =cj/reconcile--git=. -- Reconcile results distinguish =pulled=, =needs-review=, =skipped=, - =pull-failed=, and =status-failed=. -- Repo discovery prunes heavy/generated directories and stops at repo roots by - default. -- HTTP/HTTPS remote skipping is explicit and configurable via - =cj/reconcile-skipped-remote-regexp=. -- Ran all reconcile ERT files and byte-compiled =reconcile-open-repos.el=. - -*** DONE [#A] Change dirty repo handling to review-first :bug: - -Expected outcome: -- Clean repos may still pull automatically if desired. -- Dirty repos should open Magit or a review buffer before any stash/pull/pop. -- If an auto-reconcile mode is kept, require an explicit prefix argument or - separate command name. -- Update the current dirty-repo tests so they assert the new review-first - behavior instead of encoding =git stash= / =git pull= / =git stash pop= as the - desired path. - -*** DONE [#A] Replace shell git calls with process helpers and parse statuses :refactor: - -Expected outcome: -- Use =process-file= / =call-process= with argv lists. -- Capture stdout/stderr per repo for a final report. -- Distinguish clean, dirty, skipped, pull-failed, and needs-review states. -- Add tests with stubbed git command results. - -*** DONE [#A] Prune expensive directories while discovering repos :refactor: - -=cj/find-git-repos= recursively walks the configured project/code roots and -checks every directory for a nested =.git=. That can wander through -=node_modules=, =.venv=, =target=, vendored source, build output, and nested -dependency checkouts. - -Expected outcome: -- Add a configurable prune list for heavy/generated directories. -- Stop descending once a repo root has been found unless explicitly requested. -- Add tests for nested repos and ignored heavy directories. - -*** DONE [#A] Make remote skip policy explicit and configurable - -=cj/reconcile--reference-clone-p= treats HTTP/HTTPS remotes as reference clones -and skips them. That may be right for this machine, but the behavior is encoded -as a naming mismatch and can skip ordinary repos. - -Expected outcome: -- Rename the predicate to reflect the actual policy, or make the policy - configurable. -- Report skipped repos with the reason in the final reconcile output. -- Keep tests for SSH remotes, HTTP remotes, and local/file remotes. - -** DONE [#B] ai-vterm: occasional wrong-edge replay after buffer-move dance :bug: -CLOSED: [2026-05-10 Sun] - -Shipped 2026-05-09 in commit =26e9763= "fix(ai-vterm): harden F9 toggle across multi-window and buffer-move". The fix maps cardinal directions to frame-edge variants on replay (=right= → =rightmost=, =below= → =bottom=), switches captured units from frame-fractions to absolute body-cols / body-lines, wraps replay sizes in =(body-columns . N)= / =(body-lines . N)= cons forms so dividers don't shift the body, and uses =delete-window= (with =one-window-p= guard) instead of =quit-window= so buffer-moved windows don't leak. 7 regression tests added covering each scenario; 80 ai-vterm tests pass. - -Surfaced 2026-05-09. After an extended sequence with both vterm and -ai-vterm visible, switching orientations, buffer-moving claude -between positions, and toggling each independently, claude -eventually replayed at the right side when its captured direction -should have been =below= (it had just been buffer-moved to the -bottom and toggled there). - -The full sequence that hit it: - -1. F9 to open claude (right side). -2. F12 to open vterm. M-S-t to flip vterm to right-side -- gives - dashboard | vterm | claude. Toggle each off/on; both behave. -3. F12 vterm off. M-S-t flips claude to left half. Toggle both - off/on; both behave. -4. Toggle both off. F12 vterm on. M-S-t flips vterm to bottom. - Toggle both on/off; both behave. -5. Buffer-move claude to the bottom. -6. Toggle claude there -- claude pops up at the right instead of - at the bottom. - -** DONE [#B] Scope F12 (vterm-toggle) to non-claude vterm buffers, preserve user orientation :refactor:bug: -CLOSED: [2026-05-10 Sun] - -Shipped 2026-05-09 in commit =554b32d= "feat(vterm): F12 toggle that excludes claude and preserves geometry". F12 now binds =cj/vterm-toggle= (replaces the =vterm-toggle= package binding). =cj/--vterm-toggle-buffer-p= excludes =claude [= prefixed buffers from the candidate set; =cj/--vterm-toggle-capture-state= records direction + body size at toggle-off; =cj/--vterm-toggle-display-saved= replays via =(body-columns . N)= / =(body-lines . N)= cons forms with cardinal direction mapped to frame-edge variant. Toggle-off uses =delete-window= (with =one-window-p= guard) so buffer-move scenarios don't leak ghost windows. The hard-coded =(window-height . 0.7)= override is gone — user-resized geometry persists. 19 new tests across buffer-filter, dispatch, and display. - -F12 previously ran =vterm-toggle=, which picked the most-recent vterm buffer -as the toggle target. When that target was a =claude [<repo>]= buffer (which -has its own F9/C-F9/M-F9 dispatch via =modules/ai-vterm.el=), F12 ended up -toggling Claude. The display-buffer rule in =modules/eshell-vterm-config.el= -already excluded =claude [= names from the bottom-window placement, but the -exclusion only governed /where/ a buffer landed once vterm-toggle had chosen -it -- not which buffer got chosen. - -Two changes shipped: - -1. *Filter claude buffers from vterm-toggle's target set* via - =cj/--vterm-toggle-buffer-p=, which ignores buffers whose names start with - "claude [". -2. *Respect user-modified window orientation.* Captured direction + body size - at toggle-off; replayed via =(body-columns . N)= / =(body-lines . N)= cons - forms. The hard-coded =(window-height . 0.7)= override is gone. - -** DONE [#C] Move vterm-copy-mode binding off C-c C-t to the personal keymap :chore:quick: -CLOSED: [2026-05-10 Sun 02:02] - -Default vterm binding is =C-c C-t=, which collides with the =C-c= space many modes -reach for and is awkward to hit when the terminal is the active buffer. Move it -to the personal keymap (=C-;= prefix) — pick a mnemonic letter (e.g. =C-; V c= -for "vterm copy") and unbind the default in =vterm-mode-map=. Update -=modules/eshell-vterm-config.el= alongside any related vterm bindings. - -Implemented with a broader =C-; V= vterm menu, clickable URLs in vterm buffers, -=C-; V c= for raw =vterm-copy-mode=, and =C-; V C= for tmux-pane history -capture into a temporary Emacs buffer. -** DONE [#A] AI-Term-Related Improvements -*** DONE Check for widen/shorten buffer keys. -The keybinding you "thought you had" is =windsize= on =C-s-<arrow>= (Ctrl+Super) — a tiling WM eats Ctrl+Super, which is why it didn't seem to exist. Shipped 2026-05-11 in commit =f837e5f= "feat(window): resize the split with C-; b <arrow>": =C-; b <left>/<right>/<up>/<down>= moves the active window's divider that way (via =windsize=), then keeps =cj/window-resize-map= active so bare arrows keep nudging until any other key (or =C-g= / =<escape>=); =C-u N C-; b <right>= resizes by N. The old =C-s-<arrow>= bindings were dropped; =windsize= is now =:commands=-deferred with =windsize-cols=/=windsize-rows= at 2. =cj/window-resize-sticky= (in ui-navigation.el) dispatches on the arrow that triggered it and arms the loop. New ERT tests; all green. -*** DONE Evaluate this buffer should be in personal keybindings also. -=eval-buffer= is now on =C-; b e= (it already had =C-c b=). =e= had been =cj/view-email-in-buffer= and the requested fallback =C-; b m= is =cj/move-buffer-and-file=, so email-view moved to =C-; b E= (docstring + which-key updated too). All in =modules/custom-buffer-file.el=. -*** DONE Last ai-project used should be topmost in completing-read. -Shipped 2026-05-11 in commit =c14d6c8= "feat(ai-vterm): order the project picker by most-recently-used". The picker's active group (projects with a live tmux session) now leads with projects opened this session, most-recent first (=cj/--ai-vterm-mru=, pushed by =cj/--ai-vterm-show-or-create=), then the rest of the active group alpha, then the no-session group alpha. Bundled fix: =cj/--ai-vterm-tmux-session-name= now sanitizes =.= / =:= → =_= the way tmux does, so =.emacs.d= (real session =aiv-_emacs_d=) is correctly matched to its session and shows up in the active group (and crash-recovery reattaches instead of spawning a duplicate). New tests + updated tests; all green. - -*** DONE Kill other window that leaves the split where it is. -Didn't exist (the closest, =cj/kill-other-window= on =M-S-o=, *deletes* the other window). Shipped 2026-05-11 in commit =0ddbcde= "feat(window): kill the other window's buffer with C-; b K": =cj/kill-other-window-buffer= (in undead-buffers.el, on =C-; b K=) kills or buries the buffer shown in the other window and leaves that window and the split alone — the window then shows whatever bury/kill surfaces next. Reuses =cj/kill-buffer-or-bury-alive= so =cj/undead-buffer-list= buffers (=*scratch*= etc.) are buried; with 3+ windows it acts on =next-window=; errors with "No other window" if there's only one. =M-S-o= / =cj/kill-other-window= kept as-is (different op). 4 new ERT tests; all green. -*** DONE Kill this buffer/window that leaves the split. -Yes — the command is =cj/kill-buffer-and-window= (in =modules/undead-buffers.el=), bound to =C-; b k= (keymap entry in =modules/custom-buffer-file.el=, under the "buffer and file menu"). It does =(delete-window)= on the current window unless it's the only one, then kills (or buries, for "undead" buffers like =*scratch*=) the buffer — so in a 3-column split, =C-; b k= in column 2 leaves columns 1 and 3 as a normal 2-column split. No code change needed. - -Footnote on the =M-S-c= memory: =M-S-c= was Emacs's default =capitalize-word= and is now =time-zones= (=modules/chrono-tools.el=) — it was never this command. The =M-S-= window-killing family is =M-S-o= → =cj/kill-other-window= and =M-S-m= → =cj/kill-all-other-buffers-and-windows=. -*** DONE M-w shouldn't close the buffer or copy-mode -Shipped 2026-05-11 in commit =949bdeb= "feat(vterm): unify the keys in vterm copy-mode and tmux history". Both scrollback surfaces (=vterm-copy-mode= and the tmux-history buffer) now share one key story: =M-w= copies the active region and stays put (copy several things in a row); =C-g=, =<escape>=, or =q= leaves without copying; =RET= is unbound (no "copy and exit" — vterm's default =RET → vterm-copy-mode-done= binding removed). Dropped the now-dead =cj/vterm-tmux-history-copy-and-quit= (=M-w= then =q= is the equivalent). Also moved =cj/vterm-tmux-history= from =C-; x C= to =C-; x h= (unshifted, frees =C=) and refreshed the file's stale commentary header. Tests updated. -*** DONE cursor still orange after hitting return. -Shipped 2026-05-11 in commit =a70bb98= "fix(ui-config): use the writeable cursor color in a live vterm". Root cause: =vterm-mode= sets =buffer-read-only=, so the post-command cursor-color hook painted the cursor the read-only color (orange) any time point was in a vterm — copy-mode and the live terminal alike. Fix: a live vterm (=vterm-mode= and not =vterm-copy-mode=) now reports =unmodified= (white); =vterm-copy-mode= still reports =read-only= (orange), which Craig confirmed he wants. Extracted =cj/--buffer-cursor-state= for testability; 7 new ERT tests. - -*** DONE open in other window question/issue -Shipped 2026-05-11 in commit =071fb5e= "feat(ai-vterm): keep emacsclient files out of the agent window". =server-start= left =server-window= nil, so =emacsclient -n= opened files in the selected window — which is the agent window when you're typing in it. Fix in ai-vterm.el: =server-window= now points at =cj/--ai-vterm-server-display=, which routes the file to a non-agent window (splitting one off the agent when it's the only window); emacsclient from anywhere else still goes through =pop-to-buffer=. Helper =cj/--ai-vterm-non-agent-window= picks the target (skips the minibuffer, dedicated windows, agent windows). 7 new ERT tests. Confirmed working — direction-agnostic, picks the "other" window whichever side the agent is on. -** DONE [#A] Optimize org-capture target building performance :perf: -CLOSED: [2026-05-11 Mon 13:05] - -15-20 seconds every time capturing a task (12+ times/day). -Major daily bottleneck - minutes lost waiting, plus context switching cost. - -Implemented 2026-05-11: cache validated =file+headline= target markers in -=org-capture-config.el= so repeated task captures into =Inbox= skip Org's -full-file headline scan. Added regression coverage in -=tests/test-org-capture-config-target-cache.el=. -** DONE [#A] Fix Slack reaction workflow (C-; S !) :bug: -CLOSED: [2026-05-11 Mon 14:08] - -Reactions via ~C-; S !~ (~slack-message-add-reaction~) have two problems: - -1. *Emoji picker only shows GitHub-style names* — without the ~emojify~ package, - ~slack-select-emoji~ falls back to a flat ~completing-read~ over 1600+ names - fetched from GitHub's iamcal/emoji-data. Common names like ~thumbsup~ and ~pray~ - are buried. A curated shortlist of common reactions would fix the UX. - -2. *CRITICAL: post-command-hook bug traps user in Slack buffer* — - ~slack-reaction-echo-description~ is added to ~post-command-hook~ (buffer-local) - in all Slack buffers. When the cursor lands on a reaction widget, it reads the - ~reaction~ text property and calls ~slack-reaction-help-text~. If the reaction - EIEIO object is malformed, the error fires on *every keystroke*, making it - impossible to switch buffers, run M-x, or even C-g. The only escape is killing - Emacs externally (~pkill emacs~). - - The fix must address this hook FIRST before any other reaction work. - Approach: advise ~slack-reaction-echo-description~ with ~condition-case~ to - silently catch errors, or remove it from ~post-command-hook~ entirely. - - Relevant code in emacs-slack: - - ~slack-buffer.el:399~ — adds hook - - ~slack-buffer.el:374~ — ~slack-reaction-echo-description~ definition - - ~slack-reaction.el:72~ — ~slack-reaction-help-text~ method - -Implemented 2026-05-11: -- Added a safe advice around ~slack-reaction-echo-description~. If malformed - reaction data errors from the buffer-local ~post-command-hook~, the hook is - removed for that buffer and a single message is shown instead of trapping - every keystroke. -- Rebound ~C-; S !~ to ~cj/slack-message-add-reaction~, which presents a short - common reaction list first and keeps an ~Other...~ fallback to upstream - ~slack-message-reaction-input~. -- Added regression coverage in =tests/test-slack-config-reactions.el=. - -*Discovered:* 2026-03-06 -** DONE [#B] Coverage audit: untested and lightly-tested modules :tests: -CLOSED: [2026-05-11 Mon 14:38] - -Snapshot of test-coverage gaps as of 2026-04-26. The existing [#A] "Continue coverage push" task already targets =keybindings.el=, =config-utilities.el=, =org-noter-config.el=, and =host-environment.el=; this entry catalogs the rest so future sessions have a working list. - -*Methodology.* 102 modules in =modules/=, cross-referenced against =tests/= using fuzzy name matching (full module name, drop =-config=/=-setup= suffix, first hyphen segment). Categorized by likely test value. - -*High-value untested (substantial logic, real test value):* -- =ai-conversations= — gptel persistence + autosave; 13 functions -- =quick-video-capture= — yt-dlp queue, org-protocol; 5 functions -- =dashboard-config= — custom commands (=cj/dashboard-only=, etc.) -- =external-open= — partially refactored; helpers covered, commands still bare -- =keyboard-compat= — terminal vs GUI Meta+Shift translation -- =help-config= and =help-utils= — interactive help and lookup commands -- =mail-config= — helpers (some covered via transcription tests; rest bare) -- =show-kill-ring= — kill-ring UI logic -- =system-commands= — shell command wrappers -- =ui-navigation= and =ui-theme= — navigation + theme switching -- =wrap-up= — init-finalize helpers - -*Lightly covered (1–2 tests, likely many uncovered functions):* -- =modeline-config= (2 tests) -- =org-agenda-config= (2) -- =org-capture-config= (2) -- =org-reveal-config= (2) -- =transcription-config= (1) — helpers tested, start/stop loop bare -- =jumper= (1) -- =keyboard-macros= (1) - -*Likely low-value (mostly use-package wrappers):* -About 28 modules are dominated by use-package + hooks + keybinds — testing them would mostly test Emacs/use-package itself. Examples: =auth-config=, =diff-config=, =dirvish-config=, =elfeed-config=, =erc-config=, =eww-config=, the =prog-*= language modules, etc. For each, review whether the file has any helper functions beyond use-package. If yes, write characterization tests. If not, document as "no unit tests appropriate" so the next audit skips it. - -*Approach.* Pick 2–3 modules per session from the high-value list. Refactor-first if needed (split interactive wrapper from pure helper per =.claude/rules/elisp-testing.md=), then write Normal/Boundary/Error coverage. Re-run =cj/coverage-report= (F7, project scope) after each batch so progress is measurable. - -*Cross-references:* -- 2026-04-22 session (not archived) — coverage v1 shipped, 59.6% baseline -- [[file:.claude/rules/elisp-testing.md][.claude/rules/elisp-testing.md]] — per-function test files, refactor-first, three required categories - -*2026-05-11 refresh.* Re-ran =make coverage= after excluding timing-sensitive -=tests/test-lorem-optimum-benchmark.el= from coverage instrumentation. The -benchmark file still runs in normal test-file/unit flows, but Undercover slows -timing assertions enough to make it unsuitable for coverage. Low-coverage means -instrumented modules below 50% executable-line coverage, plus modules missing -from SimpleCov entirely. For missing modules, first decide whether the file has -testable project logic; if it is just use-package/keybinding glue, document it -as intentionally low-value instead of forcing brittle tests. - -*** 2026-05-24 Sun @ 15:40 Refreshed against a clean make-coverage run - -The per-module percentages previously listed here were stale. This session's test-writing covered most of the originally-listed modules: =prog-python= 0%→100%, =hugo-config= 17.7%→91.7%, =undead-buffers= 5.7%→85.7%, and =selection-framework=, =keyboard-compat=, =system-utils=, =system-defaults=, =ui-navigation=, =prog-go= now sit at ~100%. Re-measured against a clean =make coverage=; only modules genuinely below ~60% remain below as gaps, with current numbers. Modules in the 60-80% band (e.g. =calendar-sync= 76%, =music-config= 77%, =ai-conversations= 74%, =calibredb-epub-config= 73%, =org-noter-config= 73%, =custom-misc= 72%, =test-runner= 72%) are adequately covered and dropped from the backlog. Several remaining low entries are low only because the uncovered lines are use-package / interactive / process glue, not untested logic — flagged inline. - -*** 2026-05-24 Sun @ 15:45 Assessed the sub-60% cluster; filled the real gaps, closed the rest - -Read each sub-60% module to separate genuine untested logic from interactive/config glue. - -Filled (new tests): -- =markdown-config.el= — =cj/markdown-html= (buffer → strapdown HTML) now tested (normal + empty buffer). Preview/server commands stay interactive-only. Commit =c6a81743=. -- =media-utils.el= — =cj/select-media-player= now tested (choice sets default; non-match leaves it). Commit =c6a81743=. -- =elfeed-config.el= — =cj/extract-stream-url= + =cj/elfeed-process-entries= covered earlier this session (32%→66%). Commit =35fa6297=. - -Assessed already-covered (pure logic tested; remaining % is interactive only — no action): -- =flyspell-and-abbrev.el= — =cj/find-previous-flyspell-overlay= and =cj/--require-spell-checker= already have Normal/Boundary/Error tests; the rest is interactive (toggle, goto-previous, then-abbrev). -- =dashboard-config.el= — navigator builders + launcher binding already tested; the rest is =cj/dashboard-only= (interactive redisplay). -- =ai-quick-ask.el= — =--initial-text=, =--extract-response=, =--seed-text= already tested; the rest is the interactive ask/dismiss/continue flow. -- =prog-general.el= (10%) and =restclient-config.el= (50%) — LSP/use-package config and interactive new-buffer/open-file; no pure logic to cover. -- =vc-config.el= (7.9%) and =quick-video-capture.el= (50%) — pure logic already tested (git-clone path derivation; video URL dynamic-binding + capture-template registration); uncovered lines are magit/difftastic/git-timemachine config and interactive toggles. - -Net: the coverage backlog is cleared — every module's testable logic is covered; the residual low percentages are interactive/config/process code that the testing rules say not to chase. - -** DONE [#B] Review all config and pull library functions into system-lib file :refactor: -Superseded by =PROJECT [#B] Consolidate shared utility helpers= (the structured version of this, with =docs/specs/utility-consolidation-spec-doing.org= as the spec and =docs/design/utility-inventory.org= as the config-wide audit -- 30 candidate helpers across all modules, decided 11 Migrate / 3 Leave / 13 Defer). The system-lib extractions shipped 2026-05-10: =c75e36f= (=cj/executable-find-or-warn= from mail-config), =f1e8f08= (=cj/shell-quote-argument-readable= from dev-fkeys), =57e558c= (=cj/process-output-or-error= + =cj/git-output-or-error= from coverage-core), =aa72245= (=cj/file-from-context= from system-utils), plus the earlier =8e8152e= (=cj/log-silently=) -- each with its own test file. The rest of the 11 Migrate items landed as new =-lib.el= modules in the same marathon (=cj-cache-lib.el=, =cj-org-text-lib.el=, =external-open-lib.el=, =cj-window-geometry-lib.el=, =cj-window-toggle-lib.el=). The 13 deferred candidates remain tracked under the Consolidate-shared-utility-helpers PROJECT, not here. -** DONE [#C] Clean up calibredb-epub-config.el :refactor:bug: -CLOSED: [2026-05-11 Mon 14:55] - -1. *Remove ~:defer 1~ from calibredb use-package* — loads calibredb 1 second after - startup even though ~:commands~ and ~:bind~ already handle lazy loading. Free - startup time. - -2. *Double rendering on EPUB open* — ~cj/nov-apply-preferences~ calls - ~(nov-render-document)~ explicitly, but it runs as a ~nov-mode~ hook which fires - after nov already renders. Every EPUB open renders twice. - -3. *visual-fill-column-width doesn't adapt on resize* — calculated once at open - time based on window size. Resizing or splitting the window won't recalculate - text width. Consider hooking ~window-size-change-functions~ or - ~window-configuration-change-hook~. - -4. *~calibredb-search-page-max-rows 20000~* — effectively disables pagination. - Could slow down the search buffer if library grows large. Monitor or lower. - -5. *Anonymous lambda for zathura keybinding* — ~("z" . (lambda ...))~ won't show - a name in which-key or describe-key. Replace with a named function. - -*File:* modules/calibredb-epub-config.el - -Implemented 2026-05-11: removed the timed calibredb load, removed the explicit -=nov-render-document= call from the =nov-mode= hook to avoid double rendering, -made Nov text width recalculate after window configuration changes, lowered -=calibredb-search-page-max-rows= from 20000 to 500, and replaced the anonymous -zathura binding with =cj/nov-open-external=. Added focused helper coverage in -=tests/test-calibredb-epub-config.el= for the adaptive width calculation and -named external-open command. -** DONE [#C] Update email setup script for the work account :chore: -CLOSED: [2026-05-11 Mon 14:21] - -Follow-up to the deepsat mu4e work shipped 2026-04-27. The mu4e config (=modules/mail-config.el=), =.mbsyncrc=, =.msmtprc=, and the encrypted password file (=.config/.dmailpass.gpg=) all gained a third account. There is an "email setup script" (per Craig's mention while wrapping up that work) that needs the equivalent updates so a fresh machine bootstraps with all three accounts. Craig will name the specific script when picking this up. - -Likely shape: -- Wherever the script writes / templates =.mbsyncrc=, add the dmail block (5-channel layout, mirroring the gmail block). -- Wherever it writes =.msmtprc=, add the dmail SMTP account (passwordeval against =~/.config/.dmailpass.gpg=). -- Ensure the encrypted password file exists or is sourced correctly during setup. - -Implemented 2026-05-11: updated =scripts/setup-email.sh= so the setup flow -handles the deepsat/dmail account alongside gmail and cmail. The script now -creates =~/.mail/dmail=, passes =craig.jennings@deepsat.com= to =mu init=, -and installs/validates =~/.config/.dmailpass.gpg= using the same encrypted-file -pattern as gmail. While there, the credential bootstrap was made explicit: -gmail and dmail keep encrypted =.gpg= files because mbsync/msmtp decrypt them at -use time, while cmail is decrypted to the plaintext ProtonBridge password file. -** DONE [#C] Stand up packaging CI for personal Elisp packages :ci:feature: -CLOSED: [2026-05-11 Mon 14:08] - -Get =chime=, =org-msg=, and =wttrin= covered by automated package-quality checks. Three pieces, all aimed at the same set of repos, so tracked together: - -1. *melpazoid* — MELPA-submission validator. Run against each package; gives a pre-submission checklist so packages don't bounce on basics. -2. *package-lint* — elisp-specific package linter. Catches header issues, autoload problems, version-spec drift. Can be run locally as part of =make lint= and in CI. -3. *elisp-check GitHub Action* — zero-config CI workflow that wraps the above plus byte-compile and basic tests. One =.github/workflows/elisp.yml= per package. - -Order of execution: package-lint first (most actionable, fastest feedback), then elisp-check (CI wiring), then melpazoid (heavier; only matters if/when submitting to MELPA). -** DONE [#D] Optimize lorem-optimum performance and liber-primus.txt size :perf: -CLOSED: [2026-05-11 Mon 14:17] - -Lorem-optimum text generation is generally slow but doesn't completely break workflow. -Two benchmark tests were disabled (marked :slow) because they take MINUTES instead of seconds. - -**Current State:** -- Tests disabled to unblock test suite (DONE 2025-11-09) -- Performance is acceptable for daily use, but could be better -- liber-primus.txt may be too large for optimal performance - -**Investigation:** -1. Profile lorem-optimum to find bottlenecks -2. Check if liber-primus.txt size needs optimization -3. Optimize performance to get tests under 5 seconds -4. Re-enable benchmark tests once performance is acceptable - -**Related Files:** -- modules/lorem-optimum.el (needs profiling and optimization) -- tests/test-lorem-optimum-benchmark.el (tests disabled with :tags '(:slow)) -- liber-primus.txt (corpus file, may need size optimization) - -Implemented 2026-05-11: optimized generation hotspots in =modules/lorem-optimum.el= -by avoiding repeated string/list appends, caching random Markov keys as a vector, -and hardening title generation while preserving empty-chain behavior. Re-enabled -the benchmark tests in =tests/test-lorem-optimum-benchmark.el= by removing their -=:slow= tags and added a title-generation regression test in -=tests/test-lorem-optimum.el=. Checked =assets/liber-primus.txt= directly; it is -36,475 bytes / 5,374 words, so no corpus shrink was needed. The benchmark file -now runs all 10 tests in under one second, with 100K-word learning measured under -200 ms on this machine. -** DONE [#D] Migrate lsp-eldoc-hook to eldoc-documentation-functions :chore:quick: -CLOSED: [2026-05-11 Mon 14:12] - -=modules/prog-lsp.el:68= sets =lsp-eldoc-hook= to nil. Byte-compile flags it as obsolete since lsp-mode 9.0.0; replacement is =eldoc-documentation-functions=. Find the lsp-mode-supplied entry there and remove it (or set the variable buffer-locally per the new API). Discovered 2026-04-26 during refactor audit on the file-watch-ignored-extras change. - -Implemented 2026-05-11: replaced the obsolete =lsp-eldoc-hook= assignment with -=cj/lsp--disable-eldoc-hover=, installed from =lsp-managed-mode-hook=. The helper -removes =lsp-eldoc-function= from buffer-local -=eldoc-documentation-functions= after lsp-mode adds it. Covered in -=tests/test-prog-lsp--add-file-watch-ignored-extras.el=. -** DONE [#B] Simplify mail attachment save workflow :feature: - -Saving attachments out of mu4e is currently a multi-step dance via =mu4e-view-save-attachments= + embark + vertico. The flow documented in =modules/mail-config.el:10-17= goes: - -#+begin_quote -After running =mu4e-view-save-attachments=: -- invoke =embark-act-all= in the completion menu, then RET to save all -- OR TAB (=vertico-insert=), comma each file to mark, RET to save selected -#+end_quote - -That's four keystrokes for "save all to default dir" and N+2 for "save the one I want." Both common cases should be one keystroke. - -Proposed shape: -- =cj/mu4e-save-all-attachments= → save every attachment in current message to a sensible default dir (=~/Downloads/= or per-thread). One keystroke. -- =cj/mu4e-save-attachment-here= → completing-read on attachment names; save selected one. One keystroke + selection. -- Bind both under =C-; e= (the existing email map already has =a= and =d= for attach/delete in compose). - -Open question: should the "save all" target be a fixed dir, prompt every time, or use the directory of an associated org-noter / project context? Flagged for design decision when this lands. - -Decision: save all should prompt every time. - -*Files:* =modules/mail-config.el= (add helpers, wire into mu4e-view-actions and the =C-; e= keymap). - -Implemented 2026-05-11: added direct mu4e view attachment save commands in -=modules/mail-config.el=. =cj/mu4e-save-all-attachments= prompts once for a -directory and saves every attachment-like MIME part. =cj/mu4e-save-attachment-here= -prompts for a directory, then uses =completing-read= to save one attachment. -Both reuse mu4e's MIME part metadata, uniquify hook, path joiner, and -=mm-save-part-to-file= save primitive instead of driving the existing -multi-select completion UI. Duplicate filenames are disambiguated by part index. -Bound under =C-; e S= and =C-; e s= with which-key labels. Covered by -=tests/test-mail-config-attachments.el=. - -Extended 2026-05-11: added =cj/mu4e-save-some-attachments= on =C-; e m=. It -prompts for the destination directory, opens a dedicated =*mu4e attachments*= -selection buffer, and lets the user mark rows with RET, mark all with =a=, -unmark all with =u=, save marked with =s=, and quit with =q=. The selection -buffer shows labels, MIME types, and approximate sizes while reusing the same -attachment save helpers. - -Committed and pushed 2026-05-11 as =1aa8d0f= "feat(mu4e): simpler attachment-save commands on C-; e S/s/m"; 18 ERT tests in =tests/test-mail-config-attachments.el=. (Two small UX follow-ups — `entry-at-point' user-error outside a row, and clearing marks / auto-quit after save — are tracked under "Post-batch review follow-ups (2026-05-11)".) -** DONE [#B] EPUB text renders full-width: visual-fill-column margins not applied in nov-mode :bug: -*** Resolved 2026-05-12 -Fixed in =b7c6b2c= "fix(nov): center the EPUB text by setting window margins directly" -- took the "preferred" plan below: `nov-text-width' is now a column count (~80% of the window's natural width) so nov's `shr' fills the text itself, and `cj/nov-update-layout' centers the block with `set-window-margins' directly (plus `set-window-fringes ... t' to push the fringes off the reading area). `visual-fill-column' is dropped from nov entirely -- its margin-setting still mysteriously never applied, but that's moot now. `+'/`=' / `-'/`_' re-flow and re-center; a buffer-local `kill-buffer-hook' resets the margins/fringes. The text-width math factored into `cj/nov--natural-window-width' + `cj/nov--text-width'. Remaining nit: see "EPUB text is slightly left-of-center" below. -*** Problem -Opening an EPUB renders the text filling 100% of the window width, not the configured ~80%. =modules/calibredb-epub-config.el=, =cj/nov-apply-preferences= (on =nov-mode-hook=). - -Before the 2026-05-12 work it was the opposite — a too-narrow ~third-of-the-window strip — caused by a feedback loop (=cj/nov--text-width-for-window= computed from =window-body-width=, which is post-margin, so each =cj/nov-update-layout= pass shaved the column by another margin fraction, bottoming out at =cj/nov-min-text-width= = 40). Commit =1c5c8bd= "fix(nov): rework the EPUB reading-width layout" fixed the loop (width now computed from the window's *natural* column count, idempotent) and split out a pure =cj/nov--text-width= helper with a regression test; =4d9a206= set the default =cj/nov-margin-percent= to 10 (= 80% text); both also re-added =b3b537f='s =(nov-render-document)= for the cold open, made =cj/nov-update-layout= a command, and bound =+= / === / =-= / =_= in =nov-mode-map= to adjust the width live (clamp 0..25, i.e. text 50%..100%). The *width computation* and the *loop* are fixed. The *margin application* is not — hence 100%. - -*** Why 100% specifically -=cj/nov-apply-preferences= sets =(setq-local nov-text-width t)=. With =nov-text-width= = t, =nov-render-html= renders the text *unfilled* — it swaps =shr-fill-line= for =nov-fill-line=, which only indents, never wraps — so the buffer holds one long logical line per paragraph, and =visual-line-mode= is relied on to wrap it visually at the window's *text-area* width. =cj/nov-update-layout= is supposed to narrow that text area by turning on =visual-fill-column-mode= with =visual-fill-column-width= set to ~80% of the window's columns and letting =visual-fill-column--adjust-window= set the left/right *window display margins*. The margins never get set, so the text area stays the full window width → text wraps at 100%. - -*** Diagnostics captured (Craig's running Emacs, in the EPUB buffer, 2026-05-12) -=M-: (list :margin cj/nov-margin-percent :body-w (window-body-width) :vfc-w visual-fill-column-width :vfc-mode (bound-and-true-p visual-fill-column-mode) :vfc-feat (featurep 'visual-fill-column) :wmargins (window-margins) :ntw nov-text-width)= → - =(:margin 10 :body-w 152 :vfc-w 121 :vfc-mode t :vfc-feat t :wmargins (nil . nil) :ntw t)= -So: the new code IS loaded (=cj/nov-margin-percent= 10), =visual-fill-column= IS loaded, =visual-fill-column-mode= IS on, =visual-fill-column-width= IS correct (121 = 80% of 152) — but =(window-margins)= is =(nil . nil)=. =M-x cj/nov-update-layout= (which calls =visual-fill-column--adjust-window=) does NOT change it; =M-: (condition-case e (progn (cj/nov-update-layout) (window-margins)) (error e))= → =(nil . nil)= (no error caught, margins still nil). So =visual-fill-column='s margin-setting path (=visual-fill-column--adjust-window= → =visual-fill-column--set-margins= → =set-window-margins=) is not landing in nov-mode buffers. - -*** Why it doesn't apply — UNKNOWN -Code-reading =visual-fill-column-2.7.0= didn't pin it down. =visual-fill-column--adjust-window= does =(with-selected-window window (visual-fill-column--reset-window window) (when visual-fill-column-mode (... (visual-fill-column--set-margins window))))=. For the result to be =(nil . nil)=, either =--set-margins= isn't reached (the =(when visual-fill-column-mode ...)= check is false in whatever buffer =with-selected-window= makes current) or it computed left=right=0 (=set-window-margins window 0 0= → =(window-margins)= = =(nil . nil)=). =--set-margins= computes 0/0 only when =total-width= (≈ window-width) ≤ =visual-fill-column-width= (121) — and window-width is 152, so it shouldn't. Candidate causes not yet ruled out: (a) the =default= face is remapped to "Merriweather" :height 180 in nov buffers (via =face-remap-add-relative= in =cj/nov-apply-preferences=), and =set-window-margins='s units (canonical frame-font columns) vs. the remapped 18pt buffer columns may be confusing the column math; (b) =--adjust-window= being invoked on the wrong window (it defaults to =(selected-window)=, not the EPUB's window — relevant when nov-mode-hook runs before =find-file= switches the window, and possibly later); (c) a =visual-fill-column= 2.7.0 / Emacs 30 regression with =nov-fill-line=-style rendering; (d) something resetting the margins after they're set. - -*** Plan forward — preferred: stop delegating the width to visual-fill-column -Set =nov-text-width= to a *computed integer* instead of =t=, so nov's =shr= fills the rendered text to that width itself — no dependence on =visual-fill-column='s window margins working at all. =visual-fill-column= then only *centers* the already-narrow block (if it works; if it still doesn't, the text is left-aligned at ~80%, which is acceptable). Specifically: -- =cj/nov-apply-preferences=: =(setq-local nov-text-width (cj/nov--text-width-for-window))= (integer) instead of =t=. -- =cj/nov-update-layout=: recompute and =setq-local= both =nov-text-width= and =visual-fill-column-width=, then call =(nov-render-document)= so =shr= re-flows the text at the new width (currently it only re-sets the vfc width). Still keep the =visual-fill-column-mode= + =--adjust-window= calls for centering. -- =+= / =-= keep working: they adjust =cj/nov-margin-percent= then call =cj/nov-update-layout=, which now re-renders. -- =cj/nov-min-text-width= (40) stays the absolute column floor. -TDD test-first. Touches =modules/calibredb-epub-config.el= + =tests/test-calibredb-epub-config.el=. ~25 lines. - -*** Alternatives considered -(1) Keep =nov-text-width= = t + =visual-fill-column= and keep poking at *why* the margins don't apply — needs more in-Emacs diagnostics (e.g. trace =visual-fill-column--set-margins=, check =(window-margins)= right after =(set-window-margins win 15 16)=, check whether a stray window param clamps it). Higher uncertainty. -(2) Left-align at the computed width with no centering at all (drop =visual-fill-column= from nov entirely) — simpler, but loses the centered look Craig wanted. -Preferred is the =nov-text-width=-as-integer approach because it's robust regardless of what =visual-fill-column= does. -** DONE [#B] Post-batch review follow-ups (2026-05-11) :refactor:tests: -Minor items found while reviewing the 2026-05-11 commit batch (a70bb98..2b88c6a). The major fix (org-capture cache-key consistency) and the coverage gaps were already handled in commits =fc94e5b= / =e0e0ecd= / =2b88c6a=; these are the leftovers. - -*** DONE [#B] Give the benchmarks a real home (`make benchmark' or `:tags '(:perf)') :tests:perf: -The 2026-05-11 lorem-optimum perf work (=7f353e9=) dropped the `:slow' tags from the benchmark tests so they run in every `make test', and one (`benchmark-learn-100k-words') gained an absolute wall-clock threshold (`(should (< time 5000.0))'). Then =1f4c692= excluded `test-lorem-optimum-benchmark.el' from `make coverage' because undercover's instrumentation breaks those thresholds. That's a fragmented policy and the thresholds are machine-dependent (a slower CI runner or older laptop could blow 5s). Pick one: (a) restore `:tags '(:perf)' on the benchmark tests and add a `make benchmark' target that runs them, or (b) replace the absolute thresholds with relative checks ("100K is no more than ~20x slower than 10K") that catch O(N^2) regressions without depending on the machine. Either way `make test' should stop running absolute-time benchmarks by default. - -*** DONE [#B] Verify Nov EPUB renders at the right width on first open :bug: -There WAS a regression, deeper than =b3b537f=: `cj/nov--text-width-for-window' computed the column from `window-body-width' (post-margin), so `cj/nov-update-layout' (on `window-configuration-change-hook') shrank the column on every pass — a feedback loop bottoming out at `cj/nov-min-text-width' (40 cols) regardless of `cj/nov-margin-percent'. Fixed 2026-05-12 in =1c5c8bd= "fix(nov): rework the EPUB reading-width layout": width now from the window's natural column count (idempotent), pure `cj/nov--text-width' helper + regression test, `cj/nov-margin-percent' default 12 (~76% text), `b3b537f's `(nov-render-document)' re-added for the cold open, `cj/nov-update-layout' made a command, and `+'/`='/`-'/`_' added in `nov-mode-map' to adjust the width live (50%..100%). Visual confirm in real Emacs still pending Craig's restart. - -*** DONE [#B] Surface `cj/slack-message-add-reaction' errors outside a Slack buffer :ux: -`cj/slack-message-add-reaction' (C-; S !, added in =bbd1b73=) silently no-ops when `slack-current-buffer' is nil — e.g. if the binding fires outside a Slack buffer. The `when-let*' chain just bails with no feedback. Add a `user-error "Not in a Slack buffer"' (and the same for `slack-buffer-team' returning nil) so the misuse surfaces instead of being swallowed. - -*** DONE [#B] Rename `cj/lsp--disable-eldoc-hover' to `cj/lsp--remove-eldoc-provider' :refactor: -The function (added in =96d5d6a=) removes one specific provider — `lsp-eldoc-function' — from the buffer-local `eldoc-documentation-functions'. If lsp-mode ever adds another eldoc provider, the current function wouldn't catch it; the name promises more than it does. Rename to match what it actually does and update the `add-hook' callsite + the regression test. - -*** DONE [#B] Add `bats' test infra and cover `scripts/setup-email.sh' helpers :tests: -The 2026-05-11 email-setup work (=eddc103=) added `install_encrypted_password' and `decrypt_password' — cleanly factored (filenames in, file-or-`exit 1' out) but untested, since the repo has no shell-test infrastructure. With a temp `$PASSWORD_DEST_DIR' and mocked `gpg'/`cp', they'd test cleanly. Add `bats' (or pick an alternative), wire a `make test-shell' target, and cover the two helpers plus the dest-exists-skip and missing-source-fails paths. - -*** DONE [#B] Split the mu4e attachment workflow out of `mail-config.el' :refactor: -The 2026-05-11 mu4e attachment commit (=1aa8d0f=) added ~247 lines to `mail-config.el' for a self-contained attachment-save UI (helpers + three commands + a `special-mode'-derived selection buffer). None of it depends on the rest of `mail-config'. As that file grows, moving this into `modules/mu4e-attachments.el' (or `mail-attachments-lib.el', matching the `-lib.el' convention) would keep both files easier to read. The seam is clean. - -*** DONE [#B] Clear marks (or auto-quit) after `cj/mu4e-attachment-selection-save-marked' :ux: -After saving the marked attachments, the `*mu4e attachments*' buffer (=1aa8d0f=) stays open with the same marks intact — pressing `s' again re-saves the same set silently. Decide what the workflow wants: auto-`quit-window' after a successful save, or clear the marks and stay so the user can save another batch. Right now it does neither. -** DONE [#D] Create print function for dirvish bound to uppercase P :feature: - -Add a print function that works on printable files (PDF, txt, org, etc.) and bind it to uppercase P in dirvish-mode. Should detect file type and use appropriate print command (lpr for text files, print dialog for PDFs, etc.). -** DONE [#D] Collapse the duplicated per-file test loop in the Makefile :chore: -=test-unit=, =test-integration=, and =coverage= each carry a near-identical ~40-line shell loop (run each file in its own Emacs, count passes, collect failures, print a summary box). The three drifted once already (the =:perf= tag filter had to be added in three places). Extract a single =define=d shell function or a helper recipe parametrized by test list + extra =-l= args + label, and have the three targets call it. Cosmetic — the Makefile works — so low priority. Noticed 2026-05-12 while adding =make benchmark=. -** DONE [#A] Add Telegram Messaging -https://github.com/zevlg/telega.el -Make sure there is a setup script to run, so that the docker container can be installed post emacs dotfiles repository clone on a fresh install -also, let's add an icon to the dashboard for this. perhaps this is the beginning of the third row? If so, add a child task to review and balance the dashboard icons - -Shipped this session: -- =modules/telega-config.el= -- =use-package telega= with - =telega-use-docker t=; launcher on =C-; G= (=C-; t= and =C-; m t= - were both taken). -- Dashboard Row 3 added with the Telegram icon; dashboard-mode-map =g= - key launches =telega=. -- =scripts/setup-telega.sh= -- verifies docker presence + daemon - reachability; pulls =$TELEGA_DOCKER_IMAGE= when set, otherwise - announces =M-x telega-server-build= for the in-Emacs build path. - 7 bats tests in =tests/test-setup-telega.bats= (docker stubbed). -- Auth (phone + verification code) is interactive on first =M-x telega= - -- not scripted. - -*** DONE [#A] Add =scripts/setup-telega.sh= for TDLib docker container :feature: -Pull or build the telega TDLib container so a fresh-clone install can -run telega without a system-wide TDLib build. Mirror the -=scripts/setup-email.sh= pattern: =main()= wrapped in a -=BASH_SOURCE == 0= guard so the script is sourceable for bats tests; -bats test file =tests/test-setup-telega.bats= with =docker= stubbed. - -*** DONE [#A] Review and balance dashboard icon layout :refactor: -CLOSED: [2026-05-14 Thu] -Adding the Telegram icon started a third row that has only one entry. -Decide whether to (a) leave it asymmetric and let the row fill in as -new launchers arrive, (b) move an existing icon down to balance 5/5/2 -or similar, or (c) reorganize by category (work / read / chat / play). - -Picked (c) -- the categories actually exist and a 4/4/4 grid -balances cleanly: -- Row 1 Work: Code / Files / Terminal / Agenda -- Row 2 Read & Learn: Feeds / Books / Flashcards / Music -- Row 3 Communication: Email / IRC / Slack / Telegram - -Drive-by fix in the same commit: Music had an icon but no -`dashboard-mode-map' keybinding, so the visual launcher couldn't be -fired without the mouse. Added =m=. Reordered the existing -`define-key' calls to mirror the row layout so reading the keymap -top-to-bottom matches the icons left-to-right. -Surfaced when Telegram landed in Row 3 alone. -** DONE [#B] Add VERIFY and DOING blocks to the main agenda view :feature: - -The main agenda "d" command (=cj/main-agenda-display=, F8) currently -renders four blocks: OVERDUE -> HIGH PRIORITY UNRESOLVED -> SCHEDULE --> PRIORITY B. Insert two new blocks around SCHEDULE so a glance at -the daily view also surfaces what's in flight and what's waiting on a -manual check: - -- Above SCHEDULE: all tasks with TODO state VERIFY (header: - =VERIFICATION=). -- Below SCHEDULE: all tasks with TODO state DOING (header: - =IN-PROGRESS=). - -Resulting block order: - - OVERDUE -> HIGH PRIORITY -> *VERIFICATION* -> SCHEDULE -> *IN-PROGRESS* -> PRIORITY B - -Decisions: -- *Scope*: same as the other blocks -- every entry in - =org-agenda-files=, no per-project filter. -- *Scheduled / deadlined entries*: included. A VERIFY task with a - scheduled date for today appears in both the VERIFICATION block and - the SCHEDULE block. Mirrors the HIGH PRIORITY block's behavior. -- *Habit / PROJECT skips*: skip habits via - =cj/org-skip-subtree-if-habit=. Don't skip PROJECT-keyword entries - (the =(todo "VERIFY")= and =(todo "DOING")= match is keyword-exact - so PROJECT parents wouldn't appear anyway, and a PROJECT in VERIFY - state would be deliberate). - -Implementation locations: -- =modules/org-agenda-config.el= -- two new entries inside - =org-agenda-custom-commands= "d" block, each a =(todo "STATE" ...)= - with =org-agenda-overriding-header=, the shared - =cj/--main-agenda-prefix-format=, and the habit skip-function. -- =modules/org-agenda-config.el= -- two header defvars - (=cj/main-agenda-verify-title= / =cj/main-agenda-doing-title=) for - symmetry with =cj/main-agenda-overdue-title= etc. - -Regression coverage: -- Extend =tests/test-org-agenda-config-skip-functions.el= with - structural assertions: the "d" command has six blocks in the - expected order, the new VERIFICATION / IN-PROGRESS blocks reference - the shared prefix-format symbol, carry the right - =org-agenda-overriding-header=, and run the habit skip. -** DONE [#A] Org Agenda fixes :bug: -*** 2026-05-13 Wed @ 13:05:21 -0500 Skip CANCELLED entries from main agenda SCHEDULE -see the following screenshot -/home/cjennings/pictures/screenshots/2026-05-13_071428.png - -Fix shipped on main: commit =8e57950=. Added an org-agenda-skip-function -to the SCHEDULE block of the "d" command in =org-agenda-custom-commands= -that filters entries with TODO state CANCELLED. Scope is deliberately -narrow -- DONE and FAILED scheduled tasks still render. - -Tests in =tests/test-org-agenda-config-skip-functions.el= (Normal + -Boundary) lock in the configuration form on the agenda block and -verify the other blocks aren't accidentally carrying the same skip. -*** DONE [#A] Refactor: extract org-agenda-prefix-format literal :refactor: -=modules/org-agenda-config.el= currently inlines =" %i %-15:c%?-15t% s"= -across four blocks of =org-agenda-custom-commands= (overdue, hi-pri, -schedule, priority-B). Extract into a defvar (e.g. -=cj/--main-agenda-prefix-format=) and reference it from each block. -Surfaced during the audit for the CANCELLED-schedule fix. - -Fix: new =cj/--main-agenda-prefix-format= defvar in -=modules/org-agenda-config.el=; all four blocks of the "d" command now -reference the symbol instead of inlining the literal. Regression test -in =tests/test-org-agenda-config-skip-functions.el= walks the blocks -and asserts each =org-agenda-prefix-format= entry resolves to the -shared symbol -- so a future tweak to one block can't silently diverge -from the others. -*** 2026-05-13 Wed @ 13:27:39 -0500 Clear dedicated before toggling window split -Reproduction steps -- open an org file (I was using this projects's todo.org file -- hit the f8 button to open the agenda view. it opens fine. -- toggle-window-split ->>> The agenda displays on both panes after the toggle. -see snapshot below -/home/cjennings/pictures/screenshots/2026-05-13_071603.png - -Fix shipped on main: commit =97f0f8e=. Root cause was the dedicated -=*Org Agenda*= window (set via =display-buffer-alist= rule) rejecting -the internal =set-window-buffer= swap. The non-dedicated buffer never -crossed and both panes ended up showing the agenda. - -=modules/ui-navigation.el= now clears dedicated on both windows at the -top of =toggle-window-split= before the swap. The toggle is an -explicit layout change, so preserving per-window dedicated through it -would just re-trigger the same wedge on the next invocation. - -Tests in =tests/test-ui-navigation--toggle-window-split.el= (5 tests, -Normal + Boundary) cover the no-dedicated baseline, the bug-trigger, -post-toggle cleared state, and the 1-window / 3-window no-op cases. -Verified red against the unfixed code (the bug-trigger test errored -=Window is dedicated to '*test-toggle-b*'=) before applying the fix. - -Live verification pending: =M-x load-file modules/ui-navigation.el=, -then walk through F8 + M-S-t in a fresh session. -*** DONE [#A] Enhancement: replace todo indicators with project name -In the overdue section, the high priority section, and the priority B section, each of the entries has a todo: indicator, which is the name of the file. -This is not useful. Based on how I'm using emacs, every entry is likely to come from a file named todo.org. -A much preferrable option would be to have the project's name there instead. -so, for instance this todo.org file would show "emacs.d" as the project name in place of todo. - -see snapshot below for an example of the current state. -/home/cjennings/pictures/screenshots/2026-05-13_071840.png - -Fix: =cj/--org-todo-category-from-file= + -=cj/--org-set-todo-category= in =modules/org-agenda-config.el= -hook =org-category= buffer-locally to the parent directory's -basename (with a single leading dot stripped, so =.emacs.d= reads -as =emacs.d=) whenever a todo.org file opens. Explicit -=#+CATEGORY:= still wins. 14 tests in -=tests/test-org-agenda-config-category.el= cover normal / -boundary / error paths; full =make test-unit= green. -** DONE [#A] Save journal buffer after marking a task DONE :bug: -CLOSED: [2026-05-14 Thu] - -When a task transitions to a done state, =cj/org-roam-copy-todo-to-today= -in =modules/org-roam-config.el= refiles a copy of the heading into the -day's roam journal (creating the file if missing) -- example: -=/home/cjennings/sync/org/roam/journal/2026-05-14.org=. The journal -buffer is left modified-but-unsaved, so closing Emacs always prompts -about open unsaved buffers with no obvious source. - -Function intends to save via two routes: -- =org-after-refile-insert-hook= let-bound to =#'save-buffer= -- a - single-function value rather than a list. =run-hooks= calls a bare - function value, so this should fire, but verify it does in the - capture+refile context (and that it runs in the target buffer, not - the source). -- The =:config= block of =use-package org-refile= advises =org-refile= - =:after= with =org-save-all-org-buffers=. That only runs once - =org-refile= is loaded; if the DONE transition fires before - org-refile's =:defer .5= elapses, the advice isn't attached yet. - -Fix candidates: -- Drop the let-binding and call =(save-buffer)= explicitly in the - target buffer after the =org-refile= call, before - =save-window-excursion= unwinds. Deterministic, doesn't depend on - hook timing. -- Or eager-load =org-refile= so the =:after= advice attaches before any - DONE transition can fire. - -Test: mark a TODO done from a non-journal buffer, then check -=buffer-modified-p= on the dated journal buffer. Should be nil. -** DONE [#B] Extend dired/dirvish =T= to transcribe videos, not just audio :feature: -CLOSED: [2026-05-14 Thu] - -Today =T= on an audio file in dired/dirvish triggers -=cj/transcribe-audio-at-point= and only accepts files matching -=cj/audio-file-extensions= (=cj/--audio-file-p= rejects anything -else with a =user-error=). Want the same one-key flow on video -files -- so a =.mp4= or =.mkv= recording can be transcribed without -hand-extracting the audio track first. - -Likely shape: -- New =cj/video-file-extensions= in user-constants.el (mp4, mkv, - mov, webm, avi, m4v, ...). -- =cj/--video-file-p= sibling of =cj/--audio-file-p=. -- =cj/--start-transcription-process= (or a wrapper) detects video, - shells out to ffmpeg to extract the audio track to a temp file - (=ffmpeg -i in.mp4 -vn -acodec copy out.m4a= or similar; pick a - codec the backend accepts), then transcribes the temp file and - cleans up. -- =cj/transcribe-audio-at-point= accepts both audio and video via - =(or (cj/--audio-file-p f) (cj/--video-file-p f))=; the - surrounding pipeline knows when to insert the ffmpeg step. - -Open design questions: -- Keep the function named =transcribe-audio-at-point= (treats video - as "audio-bearing") or rename to =transcribe-media-at-point= and - add an alias? Rename probably cleaner. -- ffmpeg availability check + =cj/executable-find-or-warn= pattern - on first use. -- Where the temp audio file lives -- alongside the video (visible), - or =temporary-file-directory= (clean). Probably the latter for - videos the user doesn't want to clutter. -- Do we keep the temp audio after transcription, or always delete? - The log file already retains diagnostic info; extracted audio is - derivable. Default to delete; offer a custom to keep. - -Test surface: =cj/--video-file-p= happy/edge cases, the ffmpeg -extract step (stub =call-process=), and the dispatch in -=cj/transcribe-audio-at-point= against a video path. -** DONE [#C] Surface org narrowing + sparse-tree under =C-; O= :refactor: -CLOSED: [2026-05-14 Thu] -Final layout flatter than the original proposal: no =n= or =s= -sub-prefixes. Lowercase letters create / narrow / sparse-tree; -the same letter capitalized cancels. `n' / `N' = narrow / widen. -`s' / `S' = match-sparse-tree / show-all. `t' / `T' = -show-todo-tree / show-all (both capitals point at the same -`org-show-all' so the mental model is "capital cancels the -lowercase I just ran"). `R' = `org-reveal' (no lowercase pair -- -`r' is the table-row sub-prefix); F2 (the old reveal binding) is -freed up. Sibling-stepping is on `>' / `<' at the top level. - -Four new ERT assertions in -=tests/test-org-config-keymap-ownership.el= lock the shape. - -The narrowing and sparse-tree commands already exist in -=modules/org-config.el=, but they're bound only inside the -=:bind (:map org-mode-map ...)= block and scattered across `C-c' -shortcuts -- nothing in `cj/org-map' (`C-; O') surfaces them, so -which-key never shows them and discoverability is poor. - -Existing bindings worth promoting (org-config.el ~line 141-150): -- =C-\\= =org-match-sparse-tree= -- =C-c N= =org-narrow-to-subtree= -- =C-c >= =cj/org-narrow-forward= -- =C-c <= =cj/org-narrow-backwards= -- =C-c <ESC>= =widen= -- =<f2>= =org-reveal= (the reveal-narrowed-context command, - not org-reveal-config.el) - -Proposal: - -Add a sub-menu under `C-; O': - -- `C-; O n' -- narrow operations (sub-prefix) - - `n s' narrow to subtree - - `n e' narrow to element - - `n >' narrow forward sibling - - `n <' narrow backward sibling - - `n w' widen - -- `C-; O s' -- sparse-tree operations (sub-prefix) - - `s s' org-match-sparse-tree (by tag/property/todo match) - - `s t' show all TODOs - - `s p' show entries with a priority - - `s r' org-reveal (open the surrounding context of point) - -Add the which-key labels alongside. Keep the existing `C-c' -bindings as-is for muscle memory. - -Open question: should `cj/org-narrow-forward' / -`cj/org-narrow-backwards' have their own sub-letters under `n', or -just be under `n >' / `n <' as written above? The arrow-symbol -keys read naturally as "next/previous" so probably keep them. -** DONE [#B] F9 toggle should restore single-window layout for AI-vterm :bug: - -When the AI-vterm buffer is the only window in the frame (e.g. after =C-x 1=) and -F9 is pressed, =cj/ai-vterm= buries the buffer (correct), but the next F9 -redisplays the agent in a split rather than restoring the single-window full-frame -layout. F9 should toggle off/on while preserving the lone-window state. - -Fix: new =cj/--ai-vterm-last-was-bury= flag in =modules/ai-vterm.el=. -The toggle-off branch sets it to t when =one-window-p= is true (bury -path) or nil when =delete-window= runs. =cj/--ai-vterm-display-saved= -checks the flag at toggle-on: if t and the frame is still single-window, -it replaces the selected window's buffer in place via =set-window-buffer= -rather than splitting via =display-buffer-in-direction=. Flag is -consumed (cleared) by either branch so it never stays stale. - -5 tests in =tests/test-ai-vterm--single-window-toggle.el= cover: -flag set on bury, flag cleared on delete-window, flag respected only -when still one-window, flag not set when bury didn't run, and the -end-to-end roundtrip. Full =make test-unit= green. -** DONE [#B] AI-vterm scrollback history should replace agent buffer in place :feature: - -When viewing the scrollback history of an AI-vterm buffer, the history view should -replace the live agent buffer in the same window rather than splitting or popping -a separate window. Goal: read past output without losing the agent's frame slot, -then snap back to the live buffer when done. - -Decisions on the open questions: -- *Trigger*: reused the existing =cj/vterm-tmux-history= command (=C-; x h=). - No new command -- it already captures the tmux pane and runs from any - vterm buffer including agents. -- *Round-trip*: =q= / =<escape>= / =C-g= already restore the origin in - the same window via =cj/vterm-tmux-history-quit=. Same key as the - scrollback mode's other exits. -- *F9 integration*: deferred. Pressing F9 in history mode now treats the - history buffer as non-agent (its name is =*vterm tmux history: ...*=, - not =agent [...]=) so dispatch falls through to redisplay-recent + a - saved-direction split. A user who wants to toggle agent off should - press =q= first, then F9. Filed as a follow-up if it bites. - -Fix: =modules/vterm-config.el= -- one line. =pop-to-buffer buffer= -became =switch-to-buffer buffer= so the history view replaces the origin -in the selected window instead of going through display-buffer's split -logic. Quit was already in-place via =set-window-buffer=. - -New test in =tests/test-vterm-tmux-history.el= asserts the selected -window's buffer becomes the history buffer with no extra window -created (=one-window-p= still t). Existing tests dropped their -=pop-to-buffer= stub since =switch-to-buffer= works directly in batch. -Full =make test-unit= green. -** DONE [#B] Add ERT coverage for modules below 70% :tests: -CLOSED: [2026-05-14 Thu] - -Coverage snapshot from =make coverage= on 2026-05-14 (post-push): -=5958/6861= executable lines covered (=86.8%=) across 73 tracked module files. - -All tracked modules now sit at 70% or above. The two stragglers -(=system-defaults.el= and =system-commands.el=) were resolved by -attacking the instrumentation pattern rather than adding more tests: - -- =system-defaults.el= 8.3% -> 100%: switched the helper-functions - test from per-test =(load ...)= reloads inside =cl-letf= to a - single top-level =(require 'system-defaults)= wrapped in stubs, - so undercover sees one load instead of N reloads. - -- =system-commands.el= 69.4% -> 100%: switched =cj/system-cmd='s - =(interactive (list (read-shell-command ...)))= to the equivalent - string spec =(interactive "sSystem command: ")=, which lets - undercover instrument the function body that was previously - showing as 0 hits, plus added one test that captures and invokes - the =run-at-time= lambda body directly. - -Lesson for future coverage work: when ERT tests exercise a function -but the body shows 0 hits, suspect undercover/edebug instrumentation -failing on a specific Lisp form (=interactive= with a destructured -spec, backquote-destructured =pcase-let=, etc.), not the tests. - -*** DONE [#B] Add ERT tests for =modules/prog-python.el= (21/21, 100.0%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/selection-framework.el= (3/3, 100.0%) :tests: -*** DONE [#B] Add ERT tests for =modules/keyboard-compat.el= (29/29, 100.0%) :tests: -*** DONE [#B] Add ERT tests for =modules/prog-webdev.el= (21/21, 100.0%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/calibredb-epub-config.el= (95/133, 71.4%) :tests: -*** DONE [#B] Add ERT tests for =modules/system-defaults.el= (12/12, 100.0%) :tests: -CLOSED: [2026-05-14 Thu] -Rewrote =tests/test-system-defaults-functions.el= to call -=(require 'system-defaults)= once at top level (with the -side-effecting primitives stubbed via =cl-letf= wrapping the -require) instead of looping per-test =(load ...)= reloads inside -=cl-letf=. Undercover only saw the first load, so the function -bodies showed as uncovered even though every test ran them. Loading -once -- with the same stubs -- fixed the gauge and pulled coverage -to 12/12. Added two more tests to exercise the previously-unhit -list-without-comp guard and the non-string-message format branch. -*** DONE [#B] Add ERT tests for =modules/ui-navigation.el= (46/48, 95.8%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/prog-go.el= (24/27, 88.9%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/system-commands.el= (51/51, 100.0%) :tests: -CLOSED: [2026-05-14 Thu] -The =interactive= form on =cj/system-cmd= was =(interactive (list -(read-shell-command "...")))= -- a destructured list form. Edebug- -based undercover instrumentation didn't see past it, so the function -body registered 0 hits even though the tests called it directly. -Switched to the equivalent string spec =(interactive "sSystem -command: ")= and the body instrumented as expected. Added one more -test that captures the =run-at-time= lambda inside -=cj/system-cmd-restart-emacs= and invokes it directly so the inner -=call-process-shell-command= branch registers as covered. -*** DONE [#B] Add ERT tests for =modules/external-open.el= (31/33, 93.9%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/org-webclipper.el= (59/59, 100.0%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/system-utils.el= (26/26, 100.0%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/org-reveal-config.el= (68/81, 84.0%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/coverage-elisp.el= (19/19, 100.0%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/org-noter-config.el= (72/99, 72.7%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/ai-config.el= (160/191, 83.8%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/slack-config.el= (70/74, 94.6%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/org-roam-config.el= (80/80, 100.0%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/custom-text-enclose.el= (145/145, 100.0%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/dirvish-config.el= (174/185, 94.1%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/hugo-config.el= (88/96, 91.7%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/org-refile-config.el= (50/51, 98.0%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/org-contacts-config.el= (64/79, 81.0%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/transcription-config.el= (150/162, 92.6%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/music-config.el= (213/278, 76.6%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/mail-config.el= (14/19, 73.7%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/custom-buffer-file.el= (167/212, 78.8%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/org-agenda-config.el= (103/104, 99.0%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/host-environment.el= (53/57, 93.0%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/custom-ordering.el= (101/101, 100.0%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/ui-theme.el= (39/40, 97.5%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/custom-comments.el= (317/358, 88.5%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/ui-config.el= (28/31, 90.3%) :tests: -*** DONE [#B] Add ERT tests for =modules/custom-whitespace.el= (80/82, 97.6%) :tests: -*** DONE [#B] Add ERT tests for =modules/jumper.el= (97/99, 98.0%) :tests: -*** DONE [#B] Add ERT tests for =modules/test-runner.el= (160/222, 72.1%) :tests: -CLOSED: [2026-05-14 Thu] -*** DONE [#B] Add ERT tests for =modules/browser-config.el= (62/76, 81.6%) :tests: -** DONE [#A] Fix Python tree-sitter font-lock query syntax error :bug: -CLOSED: [2026-05-14 Thu] - -Diagnosed 2026-04-26 — paused at /start-work Gate 2. Root cause was system-level, not in =.emacs.d=: Emacs 30.2 + tree-sitter library 0.26.x predicate-syntax mismatch. Emacs sent =#match= (no =?= suffix), tree-sitter 0.26 rejected anything but =#match?=. Affected every =:match=, =:equal=, =:pred= predicate in every treesit-aware mode, not just Python. - -Full investigation, reproduction, and fix-option analysis in: - -[[file:docs/python-treesit-predicate-mismatch.txt][docs/python-treesit-predicate-mismatch.txt]] - -Resolved 2026-05-14 by an upstream emacs Arch-package revision bump (=30.2-2= → =30.2-3=, shipped 2026-05-03) — most likely carrying a downstream patch to =treesit.c='s predicate translation. Bug no longer reproduces: the exact failing query runs cleanly via =treesit-query-capture=, and =font-lock-ensure= on a real Python file under =python-ts-mode= completes with no =treesit-query-error=. No local override applied to =modules/prog-python.el=. Matches option A from the investigation's fix-options ("WAIT FOR UPSTREAM EMACS FIX"). -** DONE [#C] EPUB text is slightly left-of-center (shr word-wrap shortfall) :bug: -CLOSED: [2026-05-14 Thu 23:39] -(2026-05-12) Visual review of the reading-width rework is done -- it's good. Not sure I actually need this nit fixed; the left-of-center bias is minor and the `+'/`-' keys let me nudge it. Parking here until I decide it bothers me enough. - -After =b7c6b2c=, the EPUB text block is centered with `set-window-margins' at `(natural - nov-text-width) / 2' each side -- but the *rendered* text is a bit narrower than `nov-text-width' columns, because `shr' wraps at word boundaries, so the typical line ends a few columns short of the fill width. The text is left-aligned within its `nov-text-width'-wide fill region, so the unused tail of that region adds to the right margin -- the block reads as shifted left of center. Adjusting `cj/nov-margin-percent' (the `+'/`-' keys) re-flows and happens to look better at some widths (probably the line-ending pattern lands tighter), which is the same effect, not a real difference. - -Plan: in `cj/nov-update-layout', after the render, measure the actual widest line (`(save-excursion (goto-char (point-min)) (let ((m 0)) (while (not (eobp)) (end-of-line) (setq m (max m (current-column))) (forward-line 1)) m))') and center on *that* instead of on `nov-text-width'. Or, cheaper but coarser: bias the left margin by a small fudge (a column or two). The measure-the-text approach is correct; do it if it's not too slow on big chapters (it scans the buffer once per render -- the buffer's already in memory, so likely fine). =modules/calibredb-epub-config.el=, =tests/test-calibredb-epub-config.el=. -** DONE [#B] Write spec on what's needed for music-config not to depend on EMMS -CLOSED: [2026-05-15 Fri] -What if we were writing this as it's own package and couldn't use EMMS. What would that look like? -The spec should be in docs/ -Another task should be created to implement the spec -Spec written in [[id:423bc355-18d3-4e39-9e7a-f768b865d95b][Design: music-config Without EMMS]]. -** DONE [#B] Update gptel models :chore: -CLOSED: [2026-05-14 Thu] -Anthropic side: bumped Opus 4.6 → 4.7 (current frontier); Sonnet 4.6 -and Haiku 4.5 stay (still current). Default model setq also bumped -to =claude-opus-4-7= in both places (=cj/ensure-gptel-backends= and -the =use-package gptel :config= block). - -OpenAI side: bigger refresh. Old menu (=gpt-4o=, =gpt-5= original, -=gpt-4.1=, =o1=) was all in the cohort retired from ChatGPT on -2026-02-13 -- still callable via API but no longer the path forward. -New menu: =gpt-5.5= (current flagship), =gpt-5.4-mini= (fast/cheap), -=o3= (reasoning). - -Stale docstring example in =cj/gptel--current-model-selection= -also bumped to match. - -gptel's bundled =:models= list only goes through May-2025 model IDs -but the constructor passes whatever string you supply straight to the -API, so newer model names work fine without a gptel upgrade. -** DONE [#B] Add gptel toggle to M-F9 :refactor: -CLOSED: [2026-05-15 Fri] -Rebound =M-<f9>= from =cj/ai-vterm-pick-buffer= to =cj/toggle-gptel= -in both the global keymap and =vterm-mode-map=. The pick-buffer -command and its helper =cj/--ai-vterm-pick-buffer-candidates= were -deleted entirely along with the candidates test file. - -F9 family after this change: -- =<f9>= ai-vterm toggle (unchanged) -- =C-<f9>= ai-vterm project picker (unchanged) -- =M-<f9>= gptel *AI-Assistant* window toggle (NEW) - -Two existing test files updated: -=test-ai-vterm--f9-in-vterm.el= (binding assertions flipped to the -new function). -=test-ai-vterm--pick-buffer-candidates.el= deleted. - -Module commentary + the =cj/ai-vterm= docstring updated to describe -the new M-F9 behavior. - -*** 2026-05-15 Fri @ 02:21:00 -0500 Add explicit ai-vterm -> ai-config command boundary for cj/toggle-gptel -=make compile= warned that =cj/toggle-gptel= was not known to be -defined when =modules/ai-vterm.el= was byte-compiled. Added an -interactive autoload declaration in =ai-vterm.el= alongside the -other cross-module declarations: - -#+begin_src elisp -(autoload 'cj/toggle-gptel "ai-config" nil t) -#+end_src - -The dependency is now explicit, =make compile= is clean, and -requiring =ai-vterm= in isolation leaves =cj/toggle-gptel= fboundp -as an autoload sigil pointing at =ai-config=. Added a regression -test in =test-ai-vterm--f9-in-vterm.el=: -=test-ai-vterm-toggle-gptel-autoloaded-without-ai-config=. Verified -with =make compile= (no warning) and -=make test-file FILE=test-ai-vterm--f9-in-vterm.el= (5/5 pass). -** DONE [#B] Modify C-; b p :feature: -CLOSED: [2026-05-15 Fri] -- (EWW) copy EWW url when in an EWW buffer. -- (calibre) copy path to an epub or pdf or other document if those are shown in docview or pdfview - -Shipped this session: =cj/copy-buffer-source-as-kill= replaces the -old =cj/copy-path-to-buffer-file-as-kill= (kept as a =defalias= for -backwards compat). Dispatch alist =cj/buffer-source-functions= keys -on =major-mode= → thunk; =buffer-file-name= is the fallback. -Bindings: =C-; b p= now copies whatever is the right "source" for -the current mode. which-key relabeled "copy buffer source" (was -"copy file path"). - -First-batch dispatches: =eww-mode= (eww URL), =elfeed-show-mode= -(entry link), =dired-mode= / =dirvish-mode= (file at point), -=doc-view-mode= / =pdf-view-mode= (covered by the fallback to -=buffer-file-name=). 10 new ERT tests in -=tests/test-custom-buffer-file-copy-buffer-source.el= cover the -dispatch paths + the alias + the keymap. - -Deferred to a follow-up task: =mu4e-view-mode=, =org-mode= at a -heading, =help-mode=, =Info-mode=, =magit-log-mode= / -=magit-commit-mode= / =magit-status-mode=, =xref--xref-buffer-mode= -/ =grep-mode= / =compilation-mode=, =image-mode=, =archive-mode=. -These need format decisions (Message-ID vs link vs subject, id link -vs CUSTOM_ID vs heading text, etc.) before implementation. -** DONE [#C] Extend cj/buffer-source-functions to more modes :feature: -CLOSED: [2026-05-15 Fri] -Followup to =Modify C-; b p=. The first batch covered eww, -elfeed-show, dired/dirvish, and doc-view/pdf-view (via the -buffer-file-name fallback). These modes still need a decision + -implementation: - -- =mu4e-view-mode= → Message-ID, =mu4e:msgid:...= link, or - Subject + From? -- =Info-mode= → an org-style =[[info:(manual)Node][label]]= link - -Each one is a small addition to =cj/buffer-source-functions= in -=modules/custom-buffer-file.el= plus a test. Pick a format per -mode, then implement. - -*** 2026-05-15 Fri @ 02:21:00 -0500 Make Info buffer-source output match the documented org link format -Updated the =Info-mode= thunk in =cj/buffer-source-functions= -(=modules/custom-buffer-file.el=) to return the full org bracket -link =[[info:(manual)Node][(manual) Node]]= instead of the bare -target =info:(manual)Node=. Label format =(manual) Node= keeps the -manual name and node name both grep-friendly in note files. - -Existing test -=test-copy-buffer-source-info-mode-formats-as-org-info-link= on a -=.info.gz= file now asserts the bracket form. Added a new boundary -test -=test-copy-buffer-source-info-mode-handles-uncompressed-info-file= -for plain =.info= input so the suffix-stripping branch is locked -in. Verified with -=make test-file FILE=test-custom-buffer-file-copy-buffer-source.el= -(15/15 pass). - -*** 2026-05-15 Fri @ 00:11:47 -0500 Brainstorm: additional buffer-source ideas - -Today =C-; b p= invokes =cj/copy-path-to-buffer-file-as-kill=, which only -handles file-visiting buffers and errors otherwise. The proposed -extension turns it into a dispatcher: ask the current buffer "what's -your source?" and copy that, falling back to =buffer-file-name=. - -Grouping ideas by yield (most useful first) so an implementation can -prioritize: - -*Likely highest-leverage (matches Craig's daily workflows):* -- =eww-mode= → =(eww-current-url)= (already in task body). -- =elfeed-show-mode= → entry URL via =(elfeed-entry-link - elfeed-show-entry)=. Closes the loop for "I'm reading this article, - let me share it / open it in browser." -- =mu4e-view-mode= / =mu4e-headers-mode= → either the Message-ID as a - =mu4e:msgid:...= link or the From + Subject as plain text. Useful - for citing emails in org notes. -- =org-mode= on a heading → the heading's =CUSTOM_ID= or =ID= as a - full =[[id:...][title]]= link. Already partly covered by - =org-store-link=; the value here is "give me the link form even - outside an org-store flow." -- =dired-mode= / =dirvish-mode= → =(dired-get-filename)= for the file - at point, not the dired buffer's =default-directory=. Subtly - different from current behavior because dired *is* file-visiting in - a sense. -- =doc-view-mode= / =pdf-view-mode= → the underlying file path. Often - IS =buffer-file-name=, but explicit dispatch makes the behavior - predictable. Calibre integration (task body) is a special case of - this -- calibre wraps the path through a different lookup. - -*Useful for occasional workflows:* -- =help-mode= → the symbol being described (=help-xref-following= or - parsing the *Help* buffer header). Pairs with /describe-function/ - /describe-variable/. -- =Info-mode= → an org-style =[[info:(manual)Node][label]]= link. -- =magit-log-mode= / =magit-commit-mode= → the commit SHA at point, - optionally as a clickable form for the remote. -- =magit-status-mode= → the project root (or repo URL via - =vc-git-repository-url=). -- =xref--xref-buffer-mode= / =grep-mode= / =compilation-mode= → the - =file:line= location at point. -- =image-mode= → the image file path. -- =archive-mode= (tar/zip) → =archive-file-name= plus the entry name. - -*Probably skip:* -- =vterm-mode= / =eshell-mode= → no meaningful "source"; would just - copy the buffer name. Edge case at best. -- =w3m-mode= → covered by EWW for Craig; w3m use is rare here. -- =calc-mode= → "current value" isn't really a "buffer source"; better - served by a dedicated calc keybinding. - -*Implementation shape:* - -A dispatch alist mapping major-mode → thunk that returns a string -(or nil to fall through), with =buffer-file-name= as the final -fallback. Something like: - -#+begin_src emacs-lisp -(defvar cj/buffer-source-functions - '((eww-mode . (lambda () (eww-current-url))) - (elfeed-show-mode . (lambda () (elfeed-entry-link elfeed-show-entry))) - (dired-mode . (lambda () (dired-get-filename nil t))) - ...)) - -(defun cj/copy-buffer-source-as-kill () - (interactive) - (let* ((handler (alist-get major-mode cj/buffer-source-functions)) - (source (or (and handler (funcall handler)) - (buffer-file-name) - (user-error "Buffer has no copyable source")))) - (kill-new source) - (message "Copied: %s" source))) -#+end_src - -Rename the command (=cj/copy-buffer-source-as-kill=) since it's no -longer specifically about a file path. Keep =C-; b p= binding so -muscle memory survives. -** DONE [#C] Rebind org-noter insert-note to =n= (so it's =C-; n n=) :refactor: -CLOSED: [2026-05-15 Fri] - -The org-noter prefix =C-; n= currently has =i= for insert-note and =n= -for sync-next-note. Move insert-note onto =n= -- it's the most-used -action in a noter session and deserves the doubled prefix letter. - -Current bindings in =modules/org-noter-config.el= (=cj/org-noter-map=): -- =i= -> =cj/org-noter-insert-note-dwim= -- =n= -> =org-noter-sync-next-note= -- =p= -> =org-noter-sync-prev-note= -- =.= -> =org-noter-sync-current-note= - - -Proposed bindings -- n -> =cj/org-noter-insert-note-dwim= -- > -> =org-noter-sync-next-note= -- < -> =org-noter-sync-prev-note= -- =.= -> =org-noter-sync-current-note= - -Update the =which-key= labels in the same module and any test that asserts the keymap shape. -** DONE [#D] Dedup the doubly-defined functions in calibredb-epub-config.el :cleanup: -CLOSED: [2026-05-15 Fri] -=make compile= flags =calibredb-epub-config.el= for defining =cj/calibredb-clear-filters= (line ~79) and =cj/nov-jump-to-calibredb= (line ~277) twice each — the later definition silently shadows the earlier. Find which copy is current, delete the stale one. Pre-existing; noticed 2026-05-12 while fixing the Nov text-width loop. - -Diagnosis: there was no actual duplicate. Only one =(defun ...)= -of each name in the source. The "defined multiple times" warning -fired because use-package's =:bind= expansion makes the -byte-compiler count the referenced symbol as a definition when the -target function is defined in the same file -- then sees the actual -=defun= later and warns about a redefinition. - -Fix: reorder so each =defun= appears /before/ the =use-package= -block that references it via =:bind=. Concrete moves: - -- =cj/calibredb-clear-filters= moved above =(use-package calibredb - ...)=. -- =cj/nov--metadata-get= + =cj/nov--file-path= + - =cj/nov-jump-to-calibredb= (the entire jump-to-calibredb cluster) - moved above =(use-package nov ...)=. Helpers had to move - alongside the public function so the byte-compiler doesn't emit - free-function warnings for them. - -After: both "defined multiple times" warnings are gone. All unit -tests still pass. Net line count unchanged (just reordered). -** DONE [#B] Convert <cj structure template to universal yasnippet :feature:refactor: -CLOSED: [2026-05-15 Fri] - -Today =<cj= + TAB only expands in org-mode, via =org-structure-template-alist= in =modules/org-babel-config.el:144=. The expansion is the literal text: - -#+begin_example -#+begin_src cj: comment - -#+end_src -#+end_example - -A Claude skill scans for this exact marker across files using a Python helper, so the marker needs to be insertable identically in any buffer (elisp, shell, plain text, anything) regardless of major mode. Language-aware variants (per-mode comment syntax) would break the script. - -*** 2026-05-15 Fri @ 12:58:08 -0500 Wired yasnippet for universal availability - -In =modules/prog-general.el= replace =:hook (prog-mode . yas-minor-mode)= with =(yas-global-mode 1)= in =:config=, so yasnippet activates in every buffer rather than only =prog-mode= ones. Also add a hook that turns on =fundamental-mode= as an extra mode in every buffer so the universal snippet table is always consulted: - -#+begin_src emacs-lisp -(add-hook 'yas-minor-mode-hook - (lambda () (yas-activate-extra-mode 'fundamental-mode))) -#+end_src - -Acceptance: =M-: yas-minor-mode= returns =t= in =org-mode=, =text-mode=, =fundamental-mode=, and any =prog-mode= buffer. =yas-extra-modes= contains =fundamental-mode= in every buffer. - -*** 2026-05-15 Fri @ 12:58:08 -0500 Created the <cj fundamental-mode snippet - -Create =snippets/fundamental-mode/cj-comment-block= (or similar filename) with: - -#+begin_example -# -*- mode: snippet -*- -# name: cj-comment-block -# key: <cj -# -- -#+begin_src cj: comment -$0 -#+end_src -#+end_example - -Acceptance: in a scratch buffer, in a =.el= buffer, in a =.sh= buffer, in an =org= buffer — typing =<cj= and hitting TAB expands to the three-line block with the cursor on the empty middle line. - -*** 2026-05-15 Fri @ 12:58:08 -0500 Removed the org-tempo cj entry - -Once the yasnippet handles every mode, the =org-structure-template-alist= entry at =modules/org-babel-config.el:144= becomes redundant in org-mode and creates a TAB-handler ordering question. Remove the line: - -#+begin_src emacs-lisp -(add-to-list 'org-structure-template-alist '("cj" . "src cj: comment")) -#+end_src - -Verify =<cj= + TAB still expands in =org-mode= afterwards (now via yasnippet rather than org-tempo). - -*** 2026-05-15 Fri @ 15:08:48 -0500 Audited existing per-mode snippets for cross-mode use - -Walked =snippets/c-mode/=, =/emacs-lisp-mode/=, =/eshell-mode/=, =/html-ts-mode/=, =/org-mode/=, =/sh-mode/=. Read the body of every snippet. Conclusion: no movers — all 28 existing per-mode snippets contain mode-specific syntax (C =int main=, elisp =defun=, shell =printf= / =[ -f $1 ]=, HTML tags, org =#+STARTUP:= / =:PROPERTIES:= drawers, etc.) and belong where they are. =snippets/fundamental-mode/= correctly holds only the universal =cj-comment-block= marker. -** DONE [#B] Move lsp-file-watch-ignored-directories to global .emacs.d config :chore:refactor: -CLOSED: [2026-05-15 Fri] SCHEDULED: <2026-04-27 Mon> - -Shipped 2026-04-26 in commit 781b46e. Implementation: =cj/lsp-file-watch-ignored-extras= (thirteen patterns) and =cj/lsp--add-file-watch-ignored-extras= in =modules/prog-lsp.el=, called from the lsp-mode use-package =:config=. Seven ERT tests in =tests/test-prog-lsp--add-file-watch-ignored-extras.el=, all green. - -Manual verify (tomorrow): restart Emacs, open =~/code/deepsat/orchestration_dashboard_mvp/backend/test_mission_image_api.py=, watch for the file-watch prompt. Expected: no prompt, or count well below the previous 1905. If still prompting at ~1905, iterate on the pattern list. - -After verification: drop the redundant =lsp-file-watch-ignored-directories= entry from the deepsat MVP's =.dir-locals.el= here and on velox. - -Setting =lsp-file-watch-ignored-directories= via the project's =.dir-locals.el= doesn't apply at the buffer level. Confirmed via =M-: lsp-file-watch-ignored-directories= in a Python buffer — value is the lsp-mode default, not the 7 patterns we wrote in dir-locals. The safety prompt was answered with =!= and the dir-locals are otherwise live (the projectile commands take effect). - -Fix: move the seven patterns into the lsp config module as a global default with =setq-default= or per-pattern =add-to-list=. The patterns are project-agnostic build/cache directories — safe as defaults for any project. - -Patterns to add: -- =[/\\\\]node_modules\\'= -- =[/\\\\]\\.ruff_cache\\'= -- =[/\\\\]dist\\'= -- =[/\\\\]coverage\\'= -- =[/\\\\]test-results\\'= -- =[/\\\\]playwright-report\\'= -- =[/\\\\]tf[/\\\\]\\.terraform\\'= - -After landing: =M-x lsp-workspace-shutdown=, reopen a Python file, confirm the directory count drops well below the default threshold of 1000 (currently 1905). Then remove the redundant entries from the deepsat MVP's =.dir-locals.el= here and on velox. - -Discovered 2026-04-26 testing dashboard MVP F-key setup. -** DONE [#C] Investigate sqlite finalizer error on init :bug: -CLOSED: [2026-05-15 Fri] - -=*Messages*= shows =finalizer failed: (wrong-type-argument sqlitep nil)= during init. A package is finalizing an sqlite handle that's already nil — indicates a teardown bug somewhere. Likely culprits: forge, magit-todos, or any package using the sqlite backend. - -Investigation order: -1. =M-x toggle-debug-on-message= with a regex matching =finalizer failed=. -2. Restart Emacs to capture the backtrace. -3. Check =modules/git-config.el= (forge) and any other sqlite-using module. - -Single occurrence per session, no visible impact yet. Track in case it grows. - -Discovered 2026-04-26 in =*Messages*=. - -Resolution 2026-05-15: confirmed gone. Live session (2h uptime): no -=finalizer= / =sqlitep= / =wrong-type-argument sqlite= match in -=*Messages*= (3966 bytes) or =*Warnings*=. Fresh namespaced daemon -(=emacs --daemon=sqlite-verify=): forced =forge= load, ran 10 GC -cycles with =sit-for= pauses, =sqlite-available-p= and -=forge-database-file= both confirmed live -- still zero hits across -1282 bytes of =*Messages*=. If it recurs, arm -=toggle-debug-on-message= on the regex =finalizer failed= to capture -a backtrace. -** DONE [#A] org-element--list-struct issue when using gptel magit :bug: -CLOSED: [2026-05-16 Sat] -Launch Emacs -Stage a file using magit -Commit using magit -Use gptel magit to generate a commit message -Commit the file ->>> commit is successful -Stage another file using magit -Commit using magit -Use gptel magit to generate a commit message -Commit the file ->>> error org-element--list-struct: Tab width in Org files must be 8, not 4. Please adjust your ‘tab-width’ settings for Org mode -** DONE [#A] transient-setup error when running gptel magit :bug: -CLOSED: [2026-05-15 Fri] -When running gptel magit during a commit message on this machine, I get the following error consistently: -transient-setup: Cannot open load file: No such file or directory, gptel-magit -** DONE [#C] Implement flycheck modeline customization :feature: -CLOSED: [2026-05-16 Sat] - -Spec: [[id:76979608-956e-474f-90a8-8d0c958101a0][docs/specs/flycheck-modeline-customization-spec-implemented.org]] (Option 4 / hybrid). - -=modules/flycheck-config.el= got two new =:custom= lines: -=flycheck-mode-line-prefix= → "🐛", =flycheck-mode-success-indicator= → -" ✓". =flycheck-mode-line-color= stays default-t so counts pick up -=error= / =warning= faces automatically. - -=modules/modeline-config.el= got one new =(:eval ...)= form in -=mode-line-format=, placed between the recording indicator and -=cj/modeline-vc-branch=. Two guards: =(mode-line-window-selected-p)= -gates to the active window; =(bound-and-true-p flycheck-mode)= prevents -the call from firing in buffers where flycheck hasn't loaded. - -=tests/test-modeline-config-flycheck-segment.el= -- 3 smoke tests -asserting the segment is present and both guards are in place. The -existing modeline tests stay green. -** DONE [#B] Gptel Work :refactor:cleanup:feature: -CLOSED: [2026-05-16 Sat] - -Keep gptel as a focused side-tool for one-off conversations, impromptu help, and the rewrite-region code helper. Workflow stays distinct from the dedicated Claude-Code agents launched via F9, so per-project agent sessions don't get cluttered with general-purpose chat. - -In scope: -- The =cj/ai-keymap= (=C-; a=) commands in =modules/ai-config.el=. -- The save/load/delete + autosave flow in =modules/ai-conversations.el=. -- The local-tools surface in =gptel-tools/= and the loader =cj/gptel-load-local-tools=. -- gptel-magit's three triggers (M-g in git-commit, =g= in magit-commit transient, =x= in magit-diff transient). - -Out of scope: the F9 =ai-vterm= Claude-Code launcher (=modules/ai-vterm.el=) — separate module, working well. - -Closing event log: - -- Rewrote =gptel-tools/update_text_file.el= in pure Elisp + wired into =cj/gptel-local-tool-features=; 48 ERT tests. -- Split gptel-magit wiring into per-feature =with-eval-after-load= blocks (=git-commit=, =magit-commit=, =magit-diff=); rewrote the lazy-loading test to inspect =after-load-alist= directly. -- Added 36 ERT tests for =ai-conversations.el= (helpers, autosave hook, interactive save/delete). -- Added 52 ERT tests for the other five gptel-tools files; small refactor on =read_buffer.el= and =write_text_file.el= to extract testable helpers. -- =cj/gptel-autosave-toggle= + =[AS]= mode-line indicator, bound to =C-; a A=. -- =cj/gptel-quick-ask= one-shot Q&A buffer with =q= / =escape= / =c= bindings (new module =ai-quick-ask.el=), bound to =C-; a q=. -- Directive-picker wrappers around =gptel-rewrite= (=ai-rewrite.el=); =C-; a r= picks directive + rewrites, =C-; a R= redoes with a different directive. -- Dired-style saved-conversations browser (=ai-conversations-browser.el=) with RET/l/d/r/g/q bindings, bound to =C-; a b=. -- Shortlist design doc at =docs/design/gptel-tools-shortlist.org= for additional gptel tools (7 ADOPT, 2 DEFER, 1 SKIP); live community-tool survey remains as follow-up work for Craig. - -*** 2026-05-16 Sat @ 01:17:58 -0500 Rewrote update_text_file.el and wired it into cj/gptel-local-tool-features - -I rewrote =gptel-tools/update_text_file.el= in pure Elisp. The previous -version shelled out to sed for everything, had a stray quote terminator -at EOF, produced literal backslash-n where actual newlines were -expected, and prompted via =y-or-n-p= redundantly with gptel's own -=:confirm t= flag. - -The five operations (=replace=, =append=, =prepend=, =insert-at-line=, -=delete-lines=) split into pure string transforms that test without -touching the disk. The file-level wrapper validates the path, enforces -the 10MB size limit, takes a timestamped backup, and writes atomically. -No backup is created when the operation is a no-op. - -=tests/test-update-text-file.el= covers Normal / Boundary / Error per -operation plus the wrapper -- 48 tests green. Added =update_text_file= -to =cj/gptel-local-tool-features= so gptel exposes it on next restart. - -*** 2026-05-16 Sat @ 01:31:03 -0500 Split the magit wiring into per-feature with-eval-after-load blocks - -Root cause: =magit.el= calls =(provide 'magit)= BEFORE its -=(cl-eval-when (load eval) ...)= block requires =magit-commit= and -=magit-stash=. A single =with-eval-after-load 'magit= fires while -those transient prefixes are still undefined, and -=transient-append-suffix= silently no-ops on missing prefixes -(documented behavior unless =transient-error-on-insert-failure= is -set). Two of three triggers failed silently because of this; only -M-g worked, because =git-commit= IS required before the provide. - -Fix: replace the single =with-eval-after-load 'magit= with three -per-feature blocks (=git-commit=, =magit-commit=, =magit-diff=). Each -hooks the exact dependency the wiring needs. - -The existing lazy-loading test was rewritten to check -=after-load-alist= registration directly rather than driving the -hooks via =provide= -- in Emacs 30 batch mode, =provide= does not -fire registered =eval-after-load= callbacks; only an actual =load= -does. Inspecting the registration is stronger evidence anyway: the -guard against the regression is "no entry for =magit=, entries for -=git-commit=, =magit-commit=, =magit-diff=," which is exactly what -the test asserts. - -*** 2026-05-16 Sat @ 01:33:20 -0500 Added ERT coverage for ai-conversations.el - -=tests/test-ai-conversations.el= covers every helper in the module -plus the interactive entry points. 36 tests across Normal / Boundary / -Error categories: slug normalization, timestamp decoding, file -enumeration (existing topics, latest-for-topic, candidate ordering for -both =newest-first= and =oldest-first=), the save-buffer/strip-headers -round-trip, the autosave-after-send + autosave-after-response hooks, -the install-once guard for the post-response hook, and the -save/delete interactive entry points exercised via =cl-letf= stubs. -Per-test temp directories; no writes outside them. - -*** 2026-05-16 Sat @ 01:39:11 -0500 Added ERT coverage for the gptel-tools .el files - -Five new test files cover the five remaining gptel tools beyond -=update_text_file= (which was tested with its rewrite): - -- =tests/test-gptel-tools-read-buffer.el= -- 5 tests for the new - =cj/read-buffer--get-content= helper extracted from the - =gptel-make-tool= lambda. -- =tests/test-gptel-tools-write-text-file.el= -- 10 tests for the - helpers extracted from =write_text_file.el= (validate-path, - backup-name, ensure-parent, run with normal/overwrite/error - paths). -- =tests/test-gptel-tools-read-text-file.el= -- 12 tests for the - pre-existing helpers: =cj/validate-file-path=, - =cj/get-file-metadata=, =cj/check-file-size-limits=, - =cj/detect-binary-file=, =cj/handle-special-file-types=. -- =tests/test-gptel-tools-list-directory-files.el= -- 15 tests for - the =list-directory-files--*= helpers (mode-to-permissions for - files/dirs/executables, get-file-info, extension filter, formatter, - recursive vs flat listing, error path). -- =tests/test-gptel-tools-move-to-trash.el= -- 10 tests for the - =gptel--move-to-trash-*= helpers (unique-name generation with and - without extension, path validation gating HOME and /tmp, critical - directory rejection, perform on files and directories). - -Two small refactors landed first to make the tooling testable: -=read_buffer.el= and =write_text_file.el= had their main bodies -inlined into the =gptel-make-tool= lambdas; I extracted them into -=cj/read-buffer--get-content= and =cj/write-text-file--run= (plus -=--validate-path=, =--backup-name=, =--ensure-parent=) following the -Internal/Wrapper split documented in =elisp-testing.md=. - -52 new tests, all green. - -*** 2026-05-16 Sat @ 02:01:48 -0500 Wrote the gptel-tools shortlist design doc - -[[file:docs/design/gptel-tools-shortlist.org][docs/design/gptel-tools-shortlist.org]] covers each of the candidates -called out in the task body plus a few obvious adjacents. Decisions: - -- *ADOPT* (7): =search_in_files=, =git_status= / =git_log= / - =git_diff= (three tools), =web_fetch=, =search_emacs_help=, - =find_file_by_name=, =take_screenshot=. Each gets a sketch in the - doc (args, validation, implementation outline). -- *DEFER* (2): =run_shell_command= (huge surface, click-fatigue - risk; ADOPT-bucket tools cover most legit use cases), =org_capture= - (needs UX design for template pre-fill and round-trip). -- *SKIP* (1): =eval_elisp= (code execution from a model is too - dangerous even with confirm-each-call). - -Follow-up work surfaced in the doc: - -1. *Live community survey* -- walk the gptel README's tool examples, - MELPA =gptel-tool-*=, GitHub =gptel-make-tool= search, - karthink's gptel repo. I couldn't do live web research from - this session; that pass remains for Craig to do or to delegate. -2. *Per-tool implementation sub-tasks* -- each ADOPT entry deserves - its own [#B] under =Gptel Work= when Craig reviews this shortlist. -3. *Sandboxing convention* -- decide whether =web_fetch= needs an - allowlist of outbound URLs, and the same call for - =run_shell_command= if it's promoted from DEFER. - -Three open questions called out for review at the bottom of the -doc. - -*** 2026-05-16 Sat @ 01:54:34 -0500 Added directive-picker wrappers around gptel-rewrite - -New module =modules/ai-rewrite.el= with two commands: - -- =cj/gptel-rewrite-with-directive= (=C-; a r=, replacing the bare - =gptel-rewrite= binding): completing-read on a directive name from - =cj/gptel-rewrite-directives=, then rewrite the active region. -- =cj/gptel-rewrite-redo-with-different-directive= (=C-; a R=): replay - the prior region with a different directive (markers are saved - buffer-local so the region survives accept/reject of the first - rewrite). - -Open-question answer: the directive is injected via a one-shot -=let=-binding on =gptel-rewrite-directives-hook= (an abnormal hook -that gptel-rewrite already supports for per-call system messages), -not by mutating =gptel-directives= globally. No advice on -=gptel-rewrite= and no state to clean up after the call returns. - -Directives ship inline as a =defcustom= alist with the six names -called out in the task body (=terse=, =fix-grammar=, -=refactor-readability=, =add-docstring=, =explain-as-comment=, -=shorten=) so customization is straightforward without a separate -file layer. - -9 tests in =tests/test-ai-rewrite.el= cover the defcustom shape, -the wrapper (normal path, no-region error, unknown-directive -error, last-state recording), and the redo (replays prior region, -errors when no previous, excludes the current directive from the -re-pick prompt). =gptel-rewrite= stubbed for tests so no rewrite -UI fires. - -*** 2026-05-16 Sat @ 01:59:44 -0500 Built the saved-conversations browser - -New module =modules/ai-conversations-browser.el= + -=cj/gptel-browse-conversations= entry point bound to =C-; a b= -(which-key labelled "browse conversations"). Opens a dired-style -=*GPTel-Conversations*= buffer in =cj/gptel-browser-mode= (a -=special-mode= derivative). - -Each row shows date, time, topic slug, and a preview of the most -recent message (configurable length via -=cj/gptel-browser-preview-length=, default 60 chars). Rows sort -newest first. - -Bindings in the browser: -- =RET= / =l=: load the conversation (delegates to - =cj/gptel-load-conversation= with the file pre-selected via a - =cl-letf= stub on =completing-read= so the user isn't prompted - twice), then bury the browser window. -- =d=: delete the file under point after =y-or-n-p= confirmation, - re-render. -- =r=: rename the file under point; preserves the timestamp, - slugifies the new topic, refuses unchanged input and existing - targets. -- =g=: refresh. -- =n= / =p=: next / previous row. -- =q=: quit-window. - -21 tests in =tests/test-ai-conversations-browser.el= cover the -helpers (topic parsing, header stripping, preview shaping for -truncate / short / empty cases, row-for-file with both -conversation and non-conversation filenames, rows enumeration, -render output for empty and populated cases, newest-first sort, -rename-target preservation of timestamp + slug, rename-target -error on missing timestamp) and the file-touching actions (delete -with y, cancel with n, rename, rename-on-empty-line error). - -*** 2026-05-16 Sat @ 01:46:55 -0500 Added cj/gptel-quick-ask one-shot command - -New module =modules/ai-quick-ask.el=. Bound to =C-; a q= via -=cj/ai-keymap= (which-key labelled "quick ask"). - -=cj/gptel-quick-ask=: read a prompt in the minibuffer, create the -=*GPTel-Quick*= buffer in =cj/gptel-quick-mode= (a special-mode -derivative with =q= / =escape= / =c= bindings), insert "Q: <prompt>" -and the response marker, then call =gptel-request= with =:stream t= -streaming into the buffer. - -=cj/gptel-quick-dismiss= (=q= / =escape=): delete the window and -kill the buffer. Idempotent when the buffer is absent. - -=cj/gptel-quick-continue= (=c=): extract the prompt and response, -seed them into =*AI-Assistant*= under proper org headings (matching -=cj/gptel--fresh-org-prefix= shape), display the side window, -dismiss the quick buffer. - -13 tests in =tests/test-ai-quick-ask.el=: -- Pure helpers: initial-text shape, extract-response (normal / - multi-line / no-marker / empty), seed-text shape (with and without - response). -- =ask=: creates the buffer in the right mode with the prompt - recorded, calls =gptel-request=, errors on empty prompt. -- =dismiss=: kills the buffer, no-op when absent. -- =continue=: seeds =*AI-Assistant*= with both prompt and response, - dismisses the quick buffer, errors when called outside a quick - buffer. - -=gptel-request= stubbed in tests so no network call happens. - -*** 2026-05-16 Sat @ 01:41:51 -0500 Added cj/gptel-autosave-toggle + [AS] mode-line indicator - -=cj/gptel-autosave-toggle= flips =cj/gptel-autosave-enabled= in the -current GPTel buffer. Bound to =C-; a A= via =cj/ai-keymap= -(which-key labelled "toggle autosave"). When autosave is OFF and no -filepath is configured, the command prompts to save the conversation -first so a save target exists. When autosave is ON, the command -turns it off. - -=cj/gptel-autosave-mode-line-format= surfaces " [AS]" in the -mode-line when autosave is on, blank when off. Installed via a -=gptel-mode-hook= so every GPTel buffer picks it up. The install -helper is idempotent. - -6 new tests in =tests/test-ai-conversations.el= cover the enable / -disable paths, the no-filepath prompt path, the -not-a-gptel-buffer error path, the mode-line format evaluation, and -the install idempotence. -** CANCELLED [#D] Add status dashboard for dwim-shell-command processes :feature: -CLOSED: [2026-05-16 Sat 11:12] - -This was closed because all of the dwim commands finish before this would be necessary. - -Create a command to show all running dwim-shell-command processes with their status. -Currently, there's no unified view of multiple running extractions/conversions. - -**Current behavior:** -- Each command shows spinner in minibuffer while running -- Process buffers created: `*Extract audio*`, etc. -- On completion: buffer renamed to `*Extract audio done*` or `*Extract audio error*` -- No way to see all running processes at once - -**Recommended approach:** -Custom status buffer that reads `dwim-shell-command--commands`. -Can add mode-line indicator later as enhancement. -** CANCELLED [#D] Track ELPA upstream byte-compile warnings (esxml, poetry) :chore: -CLOSED: [2026-05-16 Sat 11:13] - -Fixed the esxml issue in the config. not using poetry any longer - -Two ELPA packages emit byte-compile warnings on =make compile= that aren't fixable in this repo: - -1. =elpa/esxml-20250421.1632/esxml.el= — =Warning: Unknown type: attrs= and =Unknown type: stringp= (a defcustom =:type= spec). -2. =elpa/poetry-20240329.1103/poetry.el= — =Warning: Case 'X will match 'quote'= for four cases (=post-command=, =projectile=, =project=, =switch-buffer=). Quoted symbols inside =pcase= clauses — should be unquoted upstream. - -No action in this repo. Revisit when packages update. File upstream issues if warnings linger past a few months. - -Discovered 2026-04-26 in =*Messages*= during compile. -** DONE [#B] ai vterm sizing :feature: -CLOSED: [2026-05-20 Wed] -if on a laptop, ai vterm should come up from the bottom 75% -if on a desktop, ai vterm should come from the right side 50% - -Shipped =feedb78= "feat(ai-vterm): default to bottom-75% on laptop, right-50% on desktop". Host-aware defaults via =cj/--ai-vterm-default-direction= / =cj/--ai-vterm-default-size= (branch on =env-laptop-p=); defcustoms =cj/ai-vterm-desktop-width= (0.5) + =cj/ai-vterm-laptop-height= (0.75). 6 new tests. Laptop path confirmed live; desktop path unit-tested, manual GUI check pending until next at a desktop. -** DONE [#C] Dashboard buffer too long :bug: -CLOSED: [2026-05-20 Wed] -The dashboard often opens scrolled — content is partly above the visible -window, the bottom half of content sits in the middle of the screen, and -the actual bottom of the buffer is empty lines. The banner image + the -three navigator rows + several explicit newlines push the content too -high. Even the smallest screen would fit the content if the gratuitous -empty lines were trimmed. - -Shipped =4ac1b81= "fix(dashboard): trim padding newlines and reset -window-start on open". Trimmed the startupify padding from five -newlines to two and added =set-window-start= to =point-min= in -=cj/dashboard-only=; characterization test in -=tests/test-dashboard-config.el=. Opens at the top now, verified live. -** DONE [#C] org-contacts-files nil error at launch :bug:quick: -CLOSED: [2026-05-21 Thu] -Root cause: =org-contacts-files= was set via the deferred =:custom=, so it was still nil when the agenda-finalize anniversaries hook fired at launch. Fixed by setting it eagerly at require time + guarding the wrapper. Shipped =099a771=. -Launch emits: - -: [org-contacts] ERROR: Your custom variable 'org-contacts-files' is nil. - -Surfaced 2026-05-21. =org-contacts-files= isn't set (or is set after org-contacts loads / to an empty value), so org-contacts has no contacts file to read. Fix: point =org-contacts-files= at the intended contacts org file before org-contacts initializes. -** DONE [#B] Verify + commit ai-vterm graceful close (C-S-<f9>) :test:quick: -CLOSED: [2026-05-21 Thu] -Verified live (M-f9 closes the agent + tmux session, confirm guard works). Shipped =c38683f=; also consolidated the F9 family onto ai-vterm (M-f9 = close). -Triggered by: 2026-05-20 ai-vterm close command. - -=cj/ai-vterm-close= is built but uncommitted (WIP in -=modules/ai-vterm.el= + new =tests/test-ai-vterm--close.el=, 7 tests -passing, clean-load smoke OK). It kills the agent's tmux session, then -its vterm buffer + window, after a =y-or-n-p= confirm. Bound =C-S-<f9>= -globally and in =vterm-mode-map=. Needs live verification before commit: - -- Launch an agent (F9), press =C-S-<f9>=: the confirm prompt fires, - the vterm buffer + window go away, and =tmux ls= shows the - =aiv-<name>= session gone. -- No-agent case: =C-S-<f9>= → "No AI-vterm agent buffers to close". -- Confirm guard: answer =n= → the agent stays. -- Confirm the =C-S-<f9>= chord actually reaches Emacs (PGTK/Wayland); - pick a different key if a layer swallows it. - -Once verified, =/review-code= + commit -=feat(ai-vterm): add graceful agent close on C-S-<f9>=. -** DONE [#B] gptel fork not loading: gptel-make-anthropic void :bug: -CLOSED: [2026-05-22 Fri] -:PROPERTIES: -:LAST_REVIEWED: 2026-05-22 -:END: -=cj/toggle-gptel= (and gptel chat generally) errors with: - -: cj/ensure-gptel-backends: Symbol's function definition is void: gptel-make-anthropic - -Surfaced 2026-05-21 (was hit via =M-f9=, which used to run =cj/toggle-gptel=). =gptel-make-anthropic= being void means gptel isn't loaded (or didn't load cleanly) at the point =cj/ensure-gptel-backends= runs. Lead suspect: the 2026-05-18 switch to the local fork via =:load-path "~/code/gptel"= + =:ensure nil= in =modules/ai-config.el= — if the fork doesn't load, none of the =gptel-make-*= constructors are defined. Check that =~/code/gptel= is on the load-path and loads (the prior session also trashed =elpa/gptel-0.9.9.4=, so elpa is no longer a fallback), then confirm =cj/ensure-gptel-backends= runs after gptel is available rather than before. - -Note: =M-f9= no longer triggers this — the F9 family was consolidated onto ai-vterm, so =M-<f9>= now runs =cj/ai-vterm-close= (permanent). =cj/toggle-gptel= lost its binding in the process; once gptel loads cleanly, decide on a new key for it (or leave it unbound). -** DONE [#C] make test-name aborts on gptel-dependent test files :tests:quick: -CLOSED: [2026-05-22 Fri] -:PROPERTIES: -:LAST_REVIEWED: 2026-05-22 -:END: -=make test-name TEST=<pattern>= loads *every* test file before ERT applies the name selector, so an unrelated file that fails to load takes the whole run down. Currently =tests/test-gptel-tools-*.el= (and likely the transcription tests) error at load with =Symbol's function definition is void: gptel-make-tool= because gptel isn't available in batch, aborting with Error 255 even when the selected tests have nothing to do with gptel. - -Surfaced 2026-05-21 while running the calendar-sync suite — had to fall back to loading the calendar-sync test files directly. Fix options: guard the gptel-dependent test files to skip cleanly when gptel is absent (e.g. =(when (require 'gptel nil t) ...)= or an ert skip), stub =gptel-make-tool= in a shared testutil, or have =test-name= load only files whose names match the pattern instead of all of them. - -Resolution (2026-05-22): the diagnosis above was wrong. The =test-gptel-tools-*.el= files already stub =gptel-make-tool= and =(provide 'gptel)= when gptel is absent, so they load fine in batch. The real abort was =tests/test-system-defaults-functions.el= leaking =default-directory=: it requires =system-defaults=, which runs =(setq default-directory user-home-dir)= at load, and =test-name= then resolved every following relative =-l tests/X.el= against the wrong directory. Fixed in 4fbe435f — =test-name= passes absolute paths to =-l=, and the test contains the leak with a =let=-binding around the require. -** DONE [#C] Consolidate auth-source secret-funcall idiom :refactor: -CLOSED: [2026-05-22 Fri] -:PROPERTIES: -:LAST_REVIEWED: 2026-05-22 -:END: -Fixed: extracted =cj/auth-source-secret-value= (host + optional user → secret or nil) into =system-lib.el= (a leaf, so calendar-sync stays off ai-config/gptel). All four callers delegate; ai-config layers its required-secret error on top. Dropped the now-dead =(require 'auth-source)= from the three delegating modules. f6e5885b. -The auth-source lookup + funcall-the-secret block is duplicated four times: =calendar-sync--calendar-url= (calendar-sync.el), =cj/auth-source-secret= (ai-config.el), =cj/--auth-source-password= (transcription-config.el), and =cj/--slack-token= (slack-config.el). All share =(let ((secret (plist-get (car (auth-source-search ...)) :secret))) (if (functionp secret) (funcall secret) secret))=. - -Surfaced 2026-05-21 by the code review on the calendar auth-source work — flagged as the fourth copy. Extract one low-level helper into a leaf module both can load (=system-lib.el= or =auth-config.el=), then delegate all four to it. Note the semantics differ: =cj/auth-source-secret= forces =:user "apikey"= and =error=s on miss, while the calendar helper wants a no-user lookup that returns nil on miss — so the shared primitive needs optional user + nil-on-miss, with the erroring/required-user behavior layered on top where needed. Don't make calendar-sync depend on ai-config (it drags in the gptel stack). -** DONE [#B] Keybinding: rewrite TODO+priority as sorted timestamp :feature:quick: -CLOSED: [2026-05-22 Fri] -:PROPERTIES: -:LAST_REVIEWED: 2026-05-22 -:END: - -*** 2026-05-22 Fri @ 08:35:05 -0500 Approach (revised): finalize-task command, journal-aware + depth-aware -Bound =C-; O d= (=cj/org-map=, d = "date"). Command =cj/org-finalize-task=: -1. Guard: in org-mode, on a heading carrying a non-done todo keyword (else =user-error=). -2. =completing-read= over =org-done-keywords= (dynamic — tracks =org-todo-keywords=; default DONE). -3. =(let ((org-log-done nil)) (org-todo STATE))= — fires the journal-copy hook (=org-roam-config= copies the whole subtree to today's daily under "Completed Tasks"). =org-log-done= is bound nil so the command owns the CLOSED line; the hook keys off =org-state=, not =org-log-done=, so the copy still fires. -4. Dispatch per todo-format (capture the keyword BEFORE the transition): - - level >= 3, OR keyword was VERIFY → dated rewrite: strip keyword + =[#X]= cookie, prepend =(format-time-string "%Y-%m-%d %a @ %H:%M:%S %z")=, keep tags. Done as a text edit, not via =org-todo=, so the hook doesn't double-fire. - - level <= 2 and not VERIFY → close in place: keep the chosen done keyword, add a date-only =CLOSED: [YYYY-MM-DD Day]= line. -Tests: ERT in org temp-buffers with the journal hook bound to nil; the pure transform helper tested directly with an injected TIME for a deterministic stamp. Commit: =feat(org-config): ... with tests=, direct to main. -** DONE [#C] Reconcile duplicate org-log-done setting :refactor: -CLOSED: [2026-05-22 Fri] -=modules/org-config.el= and =modules/org-roam-config.el= both set =org-log-done=, so the effective value was load-order-dependent. Set it once in =cj/org-todo-settings= to ='time= (the dated-completion workflow wants a CLOSED timestamp on every TODO->DONE) and dropped the org-roam duplicate. Fixed in 5f8e1bc7. -Triggered by: 2026-05-22 L56 finalize-task work. -** DONE [#C] Always save the daily after a journal task-copy :feature: -CLOSED: [2026-05-22 Fri] -=cj/org-roam-copy-todo-to-today= (=org-roam-config.el=) only saved today's daily in the refile branch. Pulled the save into =cj/--org-roam-save-daily=, which now runs on both paths and writes only when the buffer is modified, so a crash or shutdown never loses a freshly-copied task. Fixed in f07ce74d. -Triggered by: 2026-05-22 L56 finalize-task work. -** DONE [#B] Collapse dashboard navigator + keymap duplication :refactor: -CLOSED: [2026-05-22 Fri] -:PROPERTIES: -:LAST_REVIEWED: 2026-05-22 -:END: -Fixed: extracted a single =cj/dashboard--launchers= table; =cj/dashboard--navigator-rows= and =cj/dashboard--bind-launchers= derive the icon rows and the keybindings from it. Behavior-preserving (verified by tests + a live dashboard check). 5 ERT tests in test-dashboard-config-launchers.el. -Triggered by: 2026-05-18 Dashboard buffer too long refactor audit. - -=modules/dashboard-config.el= inlines 12 launcher commands twice — once -as anonymous lambdas inside =dashboard-navigator-buttons= (lines -128-189) and once as anonymous lambdas inside the -=dashboard-mode-map= =define-key= block (lines 200-218). Adding a -13th launcher requires editing two places, and the icon-row order and -keymap order drift independently. - -Refactor sketch: a single =defconst cj/dashboard--launchers= holding -=(KEY ICON-FAMILY ICON-NAME LABEL TOOLTIP COMMAND)= tuples, then -derive both =dashboard-navigator-buttons= (grouped 4-per-row) and the -keybindings from that list with a small helper. -** DONE [#C] Dashboard banner subtitle off-center :bug:quick: -CLOSED: [2026-05-22 Fri] -:PROPERTIES: -:LAST_REVIEWED: 2026-05-22 -:END: -The banner subtitle "Emacs: The Editor That Saves Your Soul" renders off-center relative to the dashboard width. - -Surfaced 2026-05-21. Fixed: dashboard-banner-title-offset 5 → 3 (5 over-shifted left). Verified centered via off-screen capture. -** DONE [#C] Dashboard navigator icons and section titles uncolored :bug:quick: -CLOSED: [2026-05-22 Fri] -:PROPERTIES: -:LAST_REVIEWED: 2026-05-22 -:END: -The navigator icons and the "Projects", "Bookmarks", and "Recent Files" section titles render in the default face. They should pick up colors from the Dupre color theme instead. - -Surfaced 2026-05-21. Fixed: set dashboard-items-face to steel+2 so the navigator (icons + labels) and the list items pick up a theme color; section titles stay blue via dashboard-heading. Root cause found while debugging: the navigator is rendered with a dashboard-items-face OVERLAY (overlays beat text properties), so the per-button dashboard-navigator face is inert — the nav and the items are painted by the same face, dashboard-items-face. Separating their colors would require overriding that overlay; tracked as a follow-up. -** DONE [#B] ai-vterm popup adds a third split instead of taking a half :bug:next: -CLOSED: [2026-05-25 Mon] -F9 raises ai-vterm in a new split rather than reusing the existing window layout. With the frame already split vertically (two side-by-side windows), F9 produces three columns with ai-vterm wedged in the center; expected: ai-vterm occupies the right half. Same failure horizontally — when the frame is split top/bottom and ai-vterm rises from the bottom, it should take the bottom half instead of adding a third row. - -Repro: split the frame in two (vertically or horizontally), press F9. -Likely area: ai-vterm's display/window-placement rule splits the selected window unconditionally instead of reusing the target half (display-buffer-alist / side-window config). -** DONE [#B] projectile open todo in other window :bug:next: -CLOSED: [2026-05-25 Mon] -Opening the project todo via C-c C-p t should always open in the other window if the window is split. -** DONE [#C] Make elfeed-config tests byte-compile-safe :test: -CLOSED: [2026-05-25 Mon] -The =cj/elfeed-process-entries= tests in =tests/test-elfeed-config-helpers.el= only pass when =elfeed-config= loads as interpreted source. The byte-compiled function inlines the =elfeed-entry-link= struct accessor, so the function stubs are bypassed and the inlined accessor type-checks a real =elfeed-entry=. The batch test environment has no elfeed package, so the tests can't build real structs either. Rewrite the tests (define a stand-in =elfeed-entry= cl-struct, or make elfeed loadable in batch) so they survive byte-compilation. This blocks annotating elfeed-config with its load-graph header (the last unclassified init module). - -** DONE [#C] Manually verify cj/org-finalize-task journal copy :test: -CLOSED: [2026-05-25 Mon 08:33] -Confirm the live behavior the unit tests mock out. In a real Emacs (org-roam loaded), run =C-; O d= on a level-3 sub-task and on a level-2 task. Expect the sub-task to flip to a dated entry, the level-2 to keep its keyword and gain a date-only CLOSED line, and in both cases a copy to land in today's daily under "Completed Tasks". -Triggered by: 2026-05-22 L56 finalize-task work. -** DONE [#C] Org TODO-keyword colors not dupre-themed :bug: -CLOSED: [2026-05-25 Mon] -Fixed in 32cfe216: org-todo-keyword-faces and org-priority-faces now point at named dupre-org-* faces (closest palette color per keyword) with dimmed variants for unfocused windows. Root cause was that dupre defined its own faces only via custom-theme-set-faces, never defface, so they failed when applied directly; added a defface registration block for all dupre faces. -The org TODO/DOING/DONE (and other keyword) colors don't match the dupre palette — they're showing default org colors rather than dupre tones. Likely needs changes in two places: the org keyword faces in the theme (=org-todo=, =org-done=, =org-headline-done=, and friends in =themes/dupre-faces.el=) and any =org-todo-keyword-faces= mapping set in the org config (=org-config.el= / =org-capture-config.el=), which may hardcode non-dupre colors. Reconcile both so keyword colors come from the palette. -Triggered by: 2026-05-25 auto-dim theming work. - -** DONE [#C] Make standalone byte-compile load paths match module dependencies :tests:cleanup: -CLOSED: [2026-05-25 Mon] -Resolved: added =make compile-file FILE== (load path = modules + themes + tests + package-initialize) as the documented single-file compile command, plus =-L themes= on =make compile=. Bare =emacs -Q= stays unsupported by design; the documented command resolves local compile-time deps. Verified dashboard-config.el (undead-buffers) and dupre-faces.el (dupre-palette) both compile. The parallel PostToolUse byte-compile hook also wants =-L themes=, but =.claude/hooks/validate-el.sh= is rulesets-owned (synced at startup, so a local edit reverts), so that fix is routed to the rulesets inbox rather than committed here. -Bare =emacs -Q --batch --eval '(byte-compile-file "modules/dashboard-config.el")'= fails because =undead-buffers= is not on the load path, even though normal init/test loading succeeds. Decide whether standalone compile checks should use the project test harness/load path, or whether modules with compile-time local dependencies should add explicit load-path setup or lighter declarations. - -Acceptance: -- =dashboard-config.el= can be byte-compiled through the documented local command without missing =undead-buffers=. -- The fix generalizes to other modules with local compile-time dependencies instead of special-casing only dashboard. -- Document the intended command in the Makefile/test docs if the answer is "use the harness, not bare =emacs -Q=". - -Triggered by: 2026-05-25 dashboard transparency and vterm auto-dim work. -** DONE [#C] latex-config WIP state :refactor: -CLOSED: [2026-05-25 Mon] -The =init.el= require for =latex-config= carried a bare "WIP need to fix" comment with no detail on what was broken. Retired that comment while classifying foundation modules; the underlying state still needs investigation. Read =modules/latex-config.el=, determine what's incomplete, and either finish it or scope a real task. - -Investigated 2026-05-25. The comment came from the original repo import (=092304d9=); no detail about the original breakage survives. The module byte-compiles clean and works. =company-auctex= is not a current bug — company is still the live framework, and its removal is already scoped under the corfu-migration spec below. Found one real defect: =cj/--latex-select-pdf-viewer= ran on every LaTeX buffer and blindly pushed onto =TeX-view-program-selection=, stacking duplicate =output-pdf= entries against its own idempotency docstring. Fixed in =b007a9b8= (remove-then-cons) and added =tests/test-latex-config.el= (the module had none) covering selection, preference order, fallback, idempotency, and default override. -** DONE [#C] Org tag column too close to the heading text :org:display: -CLOSED: [2026-05-26 Tue] -Shipped in commit 63192749: =org-tags-column= set to 0 plus a font-lock display property that right-aligns tags to the window edge, tracking width live with nothing baked into files. It was an org display setting, not pearl. The same change covers the inline "align further out" note that was queued separately. - -** DONE [#C] mu4e launch removes the window split :quick:solo: -CLOSED: [2026-05-26 Tue] -Shipped in commit 3acdb28e. Root cause was mu4e's main-view =display-buffer-full-frame= action (mu4e-window.el), not =delete-other-windows= on start. Fixed via a =display-buffer-alist= entry (mu4e's documented override point) routing =*mu4e-main*= to the current window (reuse-window then same-window), so the split survives. Registered eagerly so it applies on first launch. Tests cover registration + split preservation. - -** DONE [#C] Slack window should open in the other window when split :quick:solo: -CLOSED: [2026-05-26 Tue] -Shipped in commit 6c7f9ae2: =slack-buffer-function= set to =cj/slack--display-buffer= (=pop-to-buffer= with =inhibit-same-window= + reuse/use-some/pop-up action), so a room reuses the split's other window and never takes over the selected one. Tests cover split-placement and the selected-window-preserved invariant. - -** DONE [#B] Restore the daily-prep keybinding under Projectile :feature:keybinding: -CLOSED: [2026-05-26 Tue] -Shipped in commit 8e5efcab and verified live: =C-c p d= opens =inbox/today-prep.org= in the other window, project-scoped; deadgrep-in-dir moved to =C-c p G=, plain deadgrep dropped, deadgrep-here stays on =C-c p g=. Settled questions: lowercase d, per-project, other window via =find-file-other-window=. Tests in =tests/test-prog-general-open-project-daily-prep.el=. -=C-c p d= should open the project's daily prep (=<project-root>/inbox/today-prep.org=, a stable symlink) and no longer works. Keep it project-scoped under Projectile on purpose: the daily prep only exists in the work project, so a project-scoped opener in =projectile-command-map= is the right home, mirroring =cj/open-project-root-todo= (=C-c p t=). Filed from the work-project session 2026-05-26 — it's an Emacs-config change, so it lives here. - -Root cause: there is no daily-prep binding or opener anywhere in the config (checked the modules and the running daemon — no "prep" function). It was almost certainly eval'd live into the daemon in a past session and never written to a module, so it vanished on restart. The fix must be persisted to a module, not just eval'd live. =C-c p d= currently resolves to =cj/deadgrep-in-dir=, so the =d= slot is taken. - -Approach: mirror =cj/open-project-root-todo= at =modules/prog-general.el:175= and its =:bind (:map projectile-command-map ...)= block (lines 153-155). The prep file is in a subdir (=inbox/today-prep.org=), not the project root, so target the subdir path directly rather than =cj/find-project-root-file= (which only scans the root): - -#+begin_src emacs-lisp -(defun cj/open-project-daily-prep () - "Open inbox/today-prep.org in the current Projectile project root." - (interactive) - (if-let ((root (projectile-project-root))) - (let ((file (expand-file-name "inbox/today-prep.org" root))) - (if (file-exists-p file) - (cj/--find-file-respecting-split file) - (message "No inbox/today-prep.org in project: %s" root))) - (message "Not in a Projectile project"))) -#+end_src - -Open questions to settle when we tackle it: -- Which key? =d= is taken (=cj/deadgrep-in-dir=). Free lowercase in =projectile-command-map=: =h=, =n=, =w=, =y= (none a strong "daily prep" mnemonic). Or override =d=, or add a sub-prefix. -- Behavior outside the work project? Resolving relative to =projectile-project-root= makes it per-project; only work has a prep doc, so elsewhere it hits the "No prep" message. Acceptable, hard-scope to work, or offer to create one? -- Same window or other window? Mirror =cj/open-project-root-todo='s =cj/--find-file-respecting-split=, or plain =find-file=? -** DONE [#B] Headline indicators wrap to a second row :bug:org: -CLOSED: [2026-05-27 Wed] -Fixed 2026-05-27 (commit 822e7a37). =cj/org-tag-right-margin= raised from 5 to 9 in =modules/org-config.el:111= — sized empirically from a rendered measurement via the headless screenshot harness, not from column arithmetic (the trailing " · ▾" measures 4 cols by =string-width= but the fallback ▾ renders wider than reported and =:align-to= stretch rounds, so the real overflow exceeded the nominal count). Regression fixture checked into =tests/manual/headline-wrap/{fixture.org,README.org}=. - -Trigger had been: a heading carrying both an org-tidy =·= (hidden =:PROPERTIES:= drawer) and the fold ellipsis " ▾" (folded with subtree) wrapped past the window edge because the reservation didn't account for the indicator pair under the rendered (not nominal) width. -** CANCELLED [#B] Rework dev F-keys: compile+run (F4), test (F6), coverage (F7) :feature: -CLOSED: [2026-05-28 Thu] -:PROPERTIES: -:LAST_REVIEWED: 2026-05-22 -:END: - -Superseded by the F-key Completion task below. The 2026-05-27 audit found this ticket roughly 75% shipped (F4 dispatcher, F7 coverage, format-key migration off F6 all in); the remaining 25% (Phase 2b — per-language test discovery, "Run a test..." menu, M-F6 fast path, buffer-local last-test, "No tests found" error) is now tracked there with its own evidence-backed child tasks. - -*** TODO [#B] Format keybindings move off F6 :refactor:cleanup: -Move blacken-buffer (python), shfmt-buffer (sh), and clang-format-buffer (c) -off F6 onto the =C-; f= prefix, which already hosts format-buffer bindings. -Also remove projectile-run-project from F6 (it folds into the new F4). -Touch the per-language config modules that currently bind F6 for formatting. - -Acceptance: F6 has no remaining format-or-run bindings in any module; =C-; f= -prefix triggers the right formatter per major mode. - -Depends on: none (start here -- clears F6 before F4/F6 work lands). - -*** TODO [#B] Project-type detection helper :feature: -Single helper that returns a project-type symbol (=compiled=, =interpreted=, -=unknown=) from the current buffer's project. Uses -=projectile-project-compilation-cmd= when set, then heuristic fallbacks: -=go.mod=, =Makefile=, =Eask=, =package.json=, =pyproject.toml=, -=docker-compose.yml=. Lives near the F4 dispatcher. - -Acceptance: ERT tests cover each heuristic in isolation plus a precedence -case where projectile's cached cmd wins over the file heuristics. - -Depends on: none. - -*** TODO [#B] F4 compile+run dispatcher :feature: -Build the F4 binding per spec: plain F4 opens a completing-read whose -candidates depend on project-type (Compile / Run / Compile + Run [default] / -Clean + Rebuild for compiled; Run only for interpreted). C-F4 fast-paths to -Compile; M-F4 fast-paths to Clean + Rebuild. Both fast paths show a "not a -compiled language" message and no-op on interpreted projects. Reads -projectile's per-project compile/run commands; no Docker-specific logic. - -Acceptance: each candidate dispatches to the right projectile command; fast -paths no-op cleanly on interpreted projects; F4 bindings live in one module. - -Depends on: project-type detection helper. - -*** TODO [#B] Per-language test discovery :feature:tests: -Provide a single =cj/--tests-in-buffer= function returning a list of test -names for the current buffer's language. Tree-sitter queries for Python, -Go, TS/JS (treesit-auto already configured); built-in sexp scan for elisp -(=ert-deftest= forms). Parsing unopened test files uses with-temp-buffer + -insert-file-contents + <lang>-ts-mode + treesit-query-capture. Queries are -spelled out in the spec above. - -Acceptance: ERT tests feed each language a fixture file and assert the -expected test-name list comes back; missing grammar surfaces a clear error. - -Depends on: none (parallel-safe with F4 work). - -*** TODO [#B] F6 test dispatcher :feature:tests: -Build the F6 binding per spec: plain F6 opens completing-read with "All -tests", "Current file's tests", "Run a test..."; C-F6 fast-paths to current -file's tests; M-F6 fast-paths to "Run a test...". "Current file's tests" -runs the buffer directly if it's a test file, otherwise finds matching test -files via language conventions (elisp =tests/test-<module>*.el=, python -=tests/test_<module>.py=, etc.) and runs them aggregated. "Run a test..." -pre-selects =cj/--last-test-run= (buffer-local) and errors with "No tests -found for <buffer>" when discovery returns nothing -- no silent fallthrough. - -Acceptance: each entry point dispatches to the right runner; buffer-local -last-test memory persists per source file; no-match error fires correctly. - -Depends on: per-language test discovery. - -*** TODO [#B] F7 hand-off to dev-fkeys story :feature: -Once the coverage track ships ([[id:7d7f4486-fad7-4f0a-bd9a-775bd4cd8f7e][docs/specs/coverage-spec-implemented.org]]), -confirm F7 binds =cj/coverage-report= and lives alongside F4/F6 in the same -dev-fkeys module so the three keys read as one unit. No new coverage logic -here -- only the binding placement and a short comment block in the module -pointing at the coverage design doc. - -Acceptance: F7 invokes coverage-report; F4/F6/F7 are visibly grouped in one -module; coverage track is shipped before this lands. - -Depends on: the coverage-config track shipping; F4 and F6 sub-tasks above. - -*** 2026-05-15 Fri @ 19:16:08 -0500 Specification -Consolidate the developer F-key block into a coherent sequence. F5 reserved for debug (separate ticket). Format bindings move off F6 to C-; f. - -Menu mechanism: =completing-read= everywhere (consistent with F7 coverage scope prompt and with the vertico/consult workflow in the rest of the config). No transient definitions. - -**F4 — compile + run** - -- F4 (no modifier): completing-read with candidates filtered by project type. Detection via projectile-project-compilation-cmd and heuristic fallbacks (go.mod, Makefile, Eask, package.json, pyproject.toml, docker-compose.yml). - - Compiled project candidates: "Compile", "Run", "Compile + Run" (default), "Clean + Rebuild" - - Interpreted project candidates: "Run" only -- C-F4: fast path = Compile only. On interpreted projects, shows "not a compiled language" and no-ops. -- M-F4: fast path = Clean + Rebuild. Same "not applicable" behavior on interpreted projects. - -The dispatcher reads projectile's per-project compile/run/test commands. No Docker-specific logic in the command itself. Container workflows are configured via projectile's prompt-and-cache (or .dir-locals.el from the dev-project-setup helper). - -**F6 — run tests** - -- F6 (no modifier): completing-read top-level: - - "All tests" - - "Current file's tests" - - "Run a test..." (nested completing-read with individual tests) -- C-F6: fast path = "Current file's tests" -- M-F6: fast path = "Run a test..." - -"Current file's tests": if current buffer is a test file, run it directly. If source file, find matching test file(s) via language conventions (elisp: tests/test-<module>*.el; python: tests/test_<module>.py; etc.) and run them aggregated. - -"Run a test...": build a candidate list of individual tests, pre-select the last-chosen test for this buffer (buffer-local cj/--last-test-run), present via completing-read. Pressing RET re-runs last. Memory is buffer-local so different source files remember their own last-test. - -Candidate set for "Run a test...": -- If buffer is a test file: parse the file, return its test definitions. -- If buffer is a source file: find matching test file(s) and aggregate their test definitions. -- No matches: error out with "No tests found for <buffer>". Don't silently fall through. - -Per-language test discovery: -- Python, Go, TypeScript/JavaScript: tree-sitter queries (treesit-auto already configured, grammars auto-install) - - Python: (function_definition name: (identifier) @name (:match "^test_" @name)) - - Go: (function_declaration name: (identifier) @name (:match "^Test" @name)) - - TS/JS: (call_expression function: (identifier) @fn arguments: (arguments (string) @name) (:match "^\\(test\\|it\\)$" @fn)) - - Parsing unopened test files: use with-temp-buffer + insert-file-contents + python-ts-mode (etc.) + treesit-query-capture -- Elisp: built-in sexp navigation; scan for (ert-deftest <name> ...) forms. No tree-sitter needed. - -*F7 — coverage* (already designed in docs/specs/coverage-spec-implemented.org) - -**Required moves:** -- Move blacken-buffer (python), shfmt-buffer (sh), clang-format-buffer (c) off F6 to C-; f prefix (already the format-buffer prefix). -- Move projectile-run-project off F6 (folds into the new F4 completing-read). - -**Ordering:** -Do this after the coverage-config work ships. No churn mid-flight. -** DONE [#D] Evaluate and integrate Buttercup for behavior-driven integration tests :tests: -CLOSED: [2026-05-28 Thu] - -Evaluation landed at [[file:docs/design/buttercup-evaluation.org][docs/design/buttercup-evaluation.org]]. Verdict: not yet — ERT is enough for every project Craig owns today. Adopt Buttercup the moment a project crosses the threshold "the test reader is no longer the test author at write-time" (concrete trigger events listed in the doc). Re-read the doc when any such event fires. -** DONE [#A] f9 should toggle the entire ai-vterm split, not just the buffer -CLOSED: [2026-06-02 Tue] -F9 toggle-off now collapses the agent split (delete-window) instead of quit-restore-window, which went stale across multi-agent slot reuse and surfaced a different agent. Toggle-on reopens the exact agent that was hidden (cj/--ai-vterm-last-hidden-buffer). Sole-window toggle-off returns to the most-recent non-agent buffer. Split width preserved across the toggle. -** DONE [#C] Descriptive completing-read prompts :feature:ux: -CLOSED: [2026-06-02 Tue] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-02 -:END: -Reworded 17 picker prompts across 8 modules so each names the operation (C-f8 "Project:" → "Show agenda for project:", "F6:" → "Run tests:", the dwim-shell sub-prompts, both contact pickers, dirvish ediff, org finalize, and the custom-comments length/box-style prompts). Audited ~124 completing-read / read-* sites; the rest already named their operation. - -Audit every =completing-read= (and =read-*= picker) prompt in the config so the prompt names the operation about to happen, not just the kind of thing being chosen. The prompt is the only confirmation the user gets before committing to an action, so a generic one leaves a mis-keyed command ambiguous. - -Concrete trigger: C-f8 (project-filtered agenda) prompts just "Project". If Craig meant C-f9 (AI-vterm project picker) and hit C-f8 by accident, the bare "Project" prompt gives no signal which operation he's about to run — both pick a project, for different ends. - -Goal: each picker prompt makes the pending operation obvious, e.g. "Agenda for project: " vs "Open AI vterm for project: ". Sweep the call sites (grep =completing-read=, =read-directory-name=, =read-file-name=, =completing-read-multiple= across modules/), reword the ambiguous ones, keep the wording short. - -Filed 2026-06-02 from a C-f8/C-f9 mix-up. Priority set [#C] (UX polish) — re-grade if it deserves higher. - -** TODO [#C] Color dashboard navigator independently of list items :feature:ux: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-21 -:END: -The dashboard navigator (icons + labels) and the recentf/project/bookmark list items are both painted by =dashboard-items-face=: the navigator gets a =dashboard-items-face= overlay, and overlays beat text properties, so the per-button =dashboard-navigator= face is inert. To color the navigator independently of the items, override where that overlay is applied — advise or redefine =dashboard-insert-navigator=, or strip/replace the overlay's face. -Triggered by: 2026-05-22 dashboard color work (L105). -** CANCELLED [#C] Finish terminal GPG pinentry configuration :feature: -CLOSED: [2026-06-02 Tue] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-02 -:END: - -Superseded by "Terminal GPG pinentry Completion" below. That task's 2026-05-27 audit found the =terminal-pinentry= branch is gone (no local/remote ref, no reflog, no stash, no worktree), so the work restarts from main and is tracked there. Consolidated 2026-06-02. - -Continue work on terminal-mode GPG passphrase prompts (loopback mode). -Branch: terminal-pinentry - -Changes in progress (modules/auth-config.el): -- Use epa-pinentry-mode 'loopback in terminal -- Use external pinentry (pinentry-dmenu) in GUI -- Requires env-terminal-p from host-environment module -** DONE [#B] Emacs Manual Testing and Validation :verify: -CLOSED: [2026-06-06 Sat 13:59] SCHEDULED: <2026-05-29 Fri> -:PROPERTIES: -:LAST_REVIEWED: 2026-05-28 -:END: - -Hand-verify checklist Craig walks one item at a time after the relevant code lands. Each child names what is being verified, the exact steps to run, and the observable expected result. On pass, the child gets marked or deleted. On fail, the actual behavior gets logged under the step and the child is promoted to a top-level =TODO= bug per the verification.md handoff rule. - -Walk started 2026-05-28 (tests 1 + 2 verified — surfaced two Signel bugs along the way, both fixed before continuing). Deferred to 2026-05-29: test 3 onward needs sending an actual Signal message, too late at night to be polite about it. 2026-06-11: Craig confirmed the send half (contact send + Note-to-Self delivery) — closed as a dated entry below. Still unwalked: input-survives-incoming, dashboard, stop-teardown, refresh, font-setup-post-TTY, and the non-Signel capture/calibredb/nov children. - -*** Project-aware capture: C-c c t files into the project's Open Work -What we're verifying: inside a projectile project that has a root todo.org, C-c c t (Task) files the new entry under that project's "<Project> Open Work" heading. -- Open a file inside a projectile project whose root has a todo.org (e.g. this one, ~/.emacs.d). -- Press C-c c, then t. -- Type a short task, finish with C-c C-c. -Expected: the entry lands as a new level-2 TODO at the top of that project's "... Open Work" heading (e.g. "Emacs Open Work"), not in the global inbox. - -*** Project-aware capture: C-c c b files a [#C] bug -What we're verifying: C-c c b (Bug) behaves like the Task capture but stamps the entry [#C]. -- Inside the same project, press C-c c, then b. -- Type a short bug description, finish with C-c C-c. -Expected: a level-2 "TODO [#C]" entry lands at the top of the project's "... Open Work" heading. - -*** Nov bookmark naming: "Author, Title" instead of the raw filename -What we're verifying: bookmarking your place in an EPUB names the bookmark "Author, Title" parsed from the filename (Calibre's "<Title> - <Author>.epub"), reordered with the colon restored — not the raw filename. -- Open an EPUB in nov (m is bound to bookmark-set there). -- Press m to set a bookmark. -- Look at the default name in the bookmark prompt. -Expected: the default is "<Author>, <Title>" (e.g. "Agatha Christie, The A.B.C. Murders"; a colon where the filename had "_ "), no extension, no underscores — not the raw filename. - -*** Calibredb curated menu on ? and full dispatch on H -What we're verifying: in the calibredb buffer, ? opens the curated workflow menu and H opens calibredb's full dispatch. -- M-B to open calibredb. -- Press ?. -- Press a key for a workflow (e.g. o to open, f format filter), or q to quit the menu. -- Press H. -Expected: ? shows the curated transient (Library / Filter / Sort / Book columns with your workflows); the keys run the right calibredb commands; q quits. H shows calibredb's full menu. - -*** Calibredb description docks to the bottom 30% -What we're verifying: viewing a book's description docks it to the bottom 30% and q dismisses it. -- M-B, move to a book. -- Press ? then d (or v). -- Read the description. -- Press q. -Expected: the *calibredb-entry* detail buffer opens docked across the bottom ~30% of the frame (not full-window); q closes it and returns to the list. - -*** Project-aware capture: inbox fallback + warning -What we're verifying: outside a project (or in a project with no todo.org) the capture falls back to the global inbox; the no-todo.org case also warns. -- Open a scratch file not inside any projectile project, C-c c t, type a task, C-c C-c. Expect it under "Inbox" in the global inbox file. -- (If easy) open a file in a projectile project that has NO todo.org, C-c c t. Expect it in the global inbox AND an echo-area message naming the project. - -*** 2026-05-28 Thu @ 02:13:55 -0500 Verified: connect starts the daemon (after fix) -=C-; M SPC= → "Signel connected." in echo area; =M-x list-processes= shows =signal-rpc= running (PID 1775279, command =/usr/bin/signal-cli -a +1510...=). Two bugs surfaced and fixed during the verify: -- The =with-eval-after-load 'keybindings= binding at =signal-config.el:280= didn't take effect on a fresh Emacs restart; a live-reload of =signal-config.el= activated the =C-; M= prefix. Logged as a separate top-level TODO for follow-up (load-order or use-package interaction). -- =cj/signel--ensure-started= referenced =signel--process-name= before signel had been autoloaded — the bare forward-declared =(defvar signel--process-name)= didn't actually bind the variable. Fix: added =(require 'signel)= at the top of the function (=signal-config.el:170=) so the package loads before any of its private variables are read. New ERT test =test-signal-config-ensure-started-requires-signel= captures the bug. - -*** 2026-05-28 Thu @ 02:16:45 -0500 Verified: picker opens with contact names -=C-; M m= → minibuffer opened within ~1s, "Note to Self" pinned at the top, the 94 Signal contacts followed labeled "Name (+number)". Picker behavior matches spec. Surfaced a follow-up on the chat buffer that opens after a pick — placement + exit keys want refining; filed under L44 Signel. - -*** 2026-06-11 Thu @ 09:30:11 -0500 Verified: send delivery (contact send + Note-to-Self) -Craig walked the send half by hand and confirmed it 2026-06-11: a picked contact's chat buffer sends through =signel--send-input= and the message arrives on the recipient's phone; Note-to-Self (=C-; M s= and the picker's pinned entry) resolves to =signel-account= and lands in the phone's *Note to Self* thread. Same session, the receive/RPC side was re-verified live in the daemon: =listContacts= round-trip returned 93 contacts, =*signel-stderr*= empty, =C-; M= prefix bound. - -*** Signel: typed input survives an incoming message -What we're verifying: the clobber fix (fork commit 5ec56c0) preserves in-progress prompt input across =signel--insert-msg= when a message arrives mid-typing. -- =C-; M m=, pick a contact. -- Type a long unsent message at the prompt, do NOT press =RET=. -- From a second device or by asking someone, send yourself a Signal message that lands in this chat (or any active chat). -Expected: the incoming message renders above the prompt, the prompt redraws, and your typed text is still there at the prompt ready to send. - -*** Signel: dashboard opens -What we're verifying: =signel-dashboard= (=C-; M d=) opens the active-chats dashboard. -- Press =C-; M d=. -Expected: a dashboard buffer opens listing active chats. - -*** Signel: stop tears down the daemon -What we're verifying: =signel-stop= (=C-; M q=) deletes the process and clears the request-handler / buffer maps (the reconnect-invalidation contract from fork commit 4740d97). -- Press =C-; M q=. -- =M-x list-processes=. -Expected: echo area shows "Signel service stopped.", and =list-processes= no longer lists =signal-rpc=. - -*** Signel: refresh forces a fresh contact fetch -What we're verifying: =cj/signel-refresh-contacts= clears the cache and re-fetches via the new callback contract. -- =C-; M SPC= to reconnect if you ran the stop test above. -- =M-x cj/signel-refresh-contacts=. -- Immediately =C-; M m=. -Expected: the picker still opens cleanly with the same contact list (the refresh is silent; the picker is the visible check). If you added a contact on the phone, it now appears. - -*** Font setup reaches a GUI frame created after a TTY frame (daemon) -What we're verifying: emoji glyphs + fonts apply in a GUI frame even when the first daemon frame was a TTY. -- emacs --daemon -- emacsclient -t (TTY frame first) -- emacsclient -c (then a GUI frame) -- in the GUI frame, open a buffer with an emoji and check it renders, and M-S-f / fonts look right -Expected: emoji renders and fonts are applied in the GUI frame. - -*** ghostel migration: Claude Code TUI in a GUI frame -What we're verifying: an agent runs in ghostel with good rendering (the reason for the engine swap). -- restart Emacs (the migration changes load order + a use-package :config block) -- in a GUI frame press F9, pick a project, let Claude stream a long response (big diff or file read) -Expected: colors look right (not washed out), no flicker/strobing during the stream, box-drawing and the cursor render correctly. - -*** ghostel migration: Claude Code TUI in a TTY frame (replaces the old refuse test) -What we're verifying: D4 dropped the GUI-only guard, so F9 now launches in a terminal frame too. -- emacsclient -t (TTY frame, off the running daemon) -- in the TTY frame press F9 and pick a project -Expected: the agent launches and renders as text + color in the TTY (no echo-area refusal message); inline images are absent, which is expected. - -*** ghostel migration: F9 / C-F9 / M-F9 dispatch -What we're verifying: the agent dispatch behaves as it did on vterm. -- F9 toggles the agent window off/on; C-F9 always opens the project picker; M-F9 closes (kills the tmux session) after confirm -- press F9 from inside an agent buffer (full-frame) — it should toggle, not get swallowed by the terminal -Expected: each chord does its job from both normal and agent buffers. - -*** ghostel migration: tmux integration + C-; x menu -What we're verifying: the tmux machinery ported intact. -- launch an agent; M-x list it — runs in tmux session aiv-<project> -- second F9 on the same project reattaches (no duplicate session) -- C-; x h captures the tmux pane history into an Emacs buffer; C-; x c enters tmux copy-mode -- C-; x l clears scrollback; C-; x n / p navigate prompts -Expected: all menu commands work against the ghostel buffer; history capture + copy-mode behave as before. - -*** ghostel migration: copy-mode parity + mouse wheel -What we're verifying: copy/selection and wheel scrolling survived the engine swap. -- in a ghostel buffer enter copy-mode (C-; x c without tmux, or the tmux path with tmux); M-w copies and stays; q / C-g exit -- mouse-wheel scroll inside tmux, inside Claude Code, and inside lazygit -Expected: M-w copies without leaving; q/C-g exit; the wheel scrolls the program (this replaces the removed vterm wheel-forwarding — confirm ghostel's native SGR mouse covers it). - -*** ghostel migration: other TUIs + ssh -What we're verifying: general terminal workloads render. -- run lazygit, htop/btop, a heavy-output build, and ssh to a remote host in a ghostel terminal (F12) -Expected: each renders and behaves correctly; ssh out works (if a remote lacks xterm-ghostty terminfo, note it — ghostel-ssh-install-terminfo / ghostel-term is the lever). - -*** ghostel migration: F12 general terminal + dashboard launcher -What we're verifying: F12 manages non-agent terminals only, and the dashboard launcher uses ghostel. -- F12 opens/toggles a general terminal; confirm it does NOT grab an agent buffer; resize it, toggle off and on — geometry is preserved -- from the dashboard press t (Terminal) — opens a ghostel terminal (tooltip reads "Launch Terminal") -Expected: F12 excludes agent buffers and keeps saved geometry; the dashboard launches ghostel. - -*** ghostel migration: crash recovery -What we're verifying: the aiv- tmux session survives an Emacs crash and reattaches. -- with a live agent, kill Emacs (not the tmux session); restart Emacs; F9 → project picker -Expected: the project shows "[detached]" and reattaches to the surviving tmux session. -** DONE [#B] Color-family grouping for hue-adjacent warm colors :feature:theme-studio:research: -CLOSED: [2026-06-10 Wed] -Resolved by two independent reviews of =~/color-sorting.org= (=~/color-sorting-codex.org=, =~/color-sorting-fable.org=, Fable's harness at =~/working/color-sorting-fable/=). Both converged on lightness-conditioned complete-linkage clustering + a floored neutral threshold; implemented in commit =04b82bbe= (replacing the hue anchors). Measured F1 0.63→0.96 on the real palette: gold and olive separate, red/blue ramps stay whole, intense-red isolates, all grays/steels consolidate, and the gray+1/gray+2/white neutral-leak bugs are fixed. The only residual (pale yellow+2 lands on the olive ramp) is geometrically irreducible from the hex — see the hint-override task below. -** DONE [#B] theme-studio comprehensive previews (org/magit/elfeed/ghostel/mu4e/dashboard) :feature:theme:theme-studio: -CLOSED: [2026-06-08 Mon] -Expanded the bespoke previews to near-complete face coverage and added three new ones. org now exercises 83/88 faces (document + agenda; the 5 skipped are non-visual: org-hide, org-indent, org-clock-overlay, org-default, org-date-selected). magit 97/98 (status buffer + blame/reflog/sequence/bisect/signature sampler rows). elfeed 13/13. New bespoke previews: ghostel 19/19 (mock terminal, 16 ANSI colors + default + fake cursor), mu4e 37/37 (curated face list, not in the generated inventory; headers list + message view + compose), dashboard 8/8. So clicking a face row flashes a real preview element for nearly every face. Originally filed as just the org preview. -** DONE [#A] theme-studio theme.json -> dupre-*.el converter :feature:theme:theme-studio: -CLOSED: [2026-06-08 Mon] -Built as scripts/theme-studio/build-theme.el (sibling to build-inventory.el), emitting a single self-contained themes/<name>-theme.el deftheme (not the palette/faces/theme trio — a theme.json carries resolved per-face hex, not dupre's semantic layer). All four tiers convert: default from assignments.bg/.p, syntax categories -> font-lock/tree-sitter faces with bold/italic sets, UI passthrough, packages with :inherit/:height/weight/slant. 20 ERT tests in tests/test-build-theme.el (Normal/Boundary/Error + an end-to-end load + a WCAG-AA assertion on the round-tripped result). One mapping limitation documented: the dec (decorator) key has no independent Emacs face (Emacs renders decorators with font-lock-type-face, which ty owns), so dec is omitted and decorators follow the type color. - -The last link in the pipeline: turn a theme.json exported by the theme-studio into a real loadable Emacs theme. Elisp (per Craig), TDD — this is the correctness-sensitive piece. - -Inputs (all on disk; no chat history needed): -- theme.json contract: =scripts/theme-studio/README.md= (theme.json section) and =docs/specs/theme-studio-package-faces-spec-doing.org= (State and export policy, Relative height, Inheritance). -- Reference face layout: existing =themes/dupre-palette.el= + =themes/dupre-faces.el= + =themes/dupre-theme.el=, and =tests/test-dupre-theme.el= (WCAG-contrast helper to reuse). -- Conventions: =.claude/rules/elisp.md=, =.claude/rules/elisp-testing.md=. - -Scope: -1. Read theme.json. Set =default= from =assignments.bg= / =assignments.p=. -2. Author the syntax category -> font-lock face map (~21 keys: kw->font-lock-keyword-face, str->font-lock-string-face, fnd->font-lock-function-name-face, fnc->font-lock-function-call-face, op->font-lock-operator-face, punc->font-lock-punctuation-face, etc. incl. the Emacs-29 tree-sitter additions). Apply =bold= / =italic= sets. -3. UI faces: the =ui= keys are already real face names (region, cursor, mode-line, ...) -> near 1:1 passthrough of fg/bg. -4. Package faces: =packages= -> each face spec, writing =:inherit PARENT= for inherited faces + only the overridden attrs, =:height= when != 1.0, weight/slant. -5. Emit a deftheme file (or palette+faces+theme trio mirroring dupre's layout). - -TDD targets: old-JSON (no packages) loads; every category maps; round-trip of fg/bg/bold/italic/inherit/height into valid face specs; WCAG-contrast assertion on the result. Decide whether the converter lives under =scripts/theme-studio/= (emits to =themes/=) or =themes/=. -** DONE [#B] theme-studio tier-3 package faces :feature:theme:theme-studio: -CLOSED: [2026-06-08 Mon] -Package-specific face editing in the theme-studio: org/magit/elfeed bespoke (complete face tables + live previews) plus a generated all-package inventory so every installed package is themeable. Spec is Ready, all opens resolved: [[id:8f37a1fd-cfd3-4b25-92e5-772468092bdc][docs/specs/theme-studio-package-faces-spec-doing.org]]. Phases below run in dependency order; phases 1-5 deliver the three high-value apps, phase 6 opens the long tail, phase 7 documents. The =theme.json= -> =dupre-*.el= converter (Elisp) is a separate downstream task. - -*** 2026-06-08 Mon @ 00:17:41 -0500 Phase 1 — package state + schema landed -Added =APPS= (org starter) and =PKGMAP= ({app:{face:{fg,bg,bold,italic,inherit,height,source}}}), pure helpers (=seedPkgmap= / =packagesForExport= / =mergePackagesInto=), and wired export/import for the =packages= key with old-JSON compat. The =height= float (relative size, read off the face not cascaded through inherit) and the fixed-pitch inherits are seeded in the org starter. No UI yet (Phase 3). Verified: node-check, plus a guarded =#selftest= harness (headless Chrome) confirming seed->export->import round-trip, old-JSON merge, and inherit/height/source survival — all PASS. - -*** 2026-06-08 Mon @ 02:16:24 -0500 Phase 2 — curated app data (org/magit/elfeed) landed -Filled =APPS= with the complete own-defface sets built from embedded face-name lists + a curated seed-color map: org 88 (85 seeded, incl. org-agenda, heading heights, fixed-pitch inherits), magit 98 (64 seeded), elfeed 13 (all seeded). Long-tail faces seed to default fg. Verified: 199 faces total, no seed typos / no dupes, schema self-test PASS seeding all of them. Seeded-default aesthetics still go to Manual testing once the Phase 3 UI lands. - -*** 2026-06-08 Mon @ 02:23:56 -0500 Phase 3 — package face table UI landed -Added the "package faces" section: app selector (org/magit/elfeed), per-app face table with fg/bg dropdowns, bold/italic toggles, inherit dropdown (base faces + the app's own faces), relative-height stepper, live contrast readout on the effective (inherit-resolved) color, per-face and per-app reset, and a text filter. Refactored the fg/bg dropdown into a shared =colorDropdown= helper the ui-faces table now also uses (no =uiSelect= fork). Palette edits propagate to package faces; import/export carry them. Right pane is the generic preview (face names in their own resolved colors) until the bespoke org/magit/elfeed previews land (phases 4-5). Verified: node, headless screenshot, schema self-test PASS. - -*** 2026-06-08 Mon @ 02:27:51 -0500 Phase 4 — org preview landed -Added =renderOrgPreview()=: a mock org document painted live from the org package faces (title, headings with heights, TODO/DONE, tag, scheduled date, property drawer, inline code/verbatim, link, checkbox, quote, src block, header-row table). The preview pane dispatches on the app's preview key; org-mode gets this, others keep the generic list. Verified: node, headless screenshot, self-test PASS. - -*** 2026-06-08 Mon @ 02:30:42 -0500 Phase 5 — magit + elfeed previews landed -Bespoke =renderMagitPreview()= (status buffer: head/branches, untracked, a diff hunk with context/added/removed, recent commits with hashes/authors/keyword/tag) and =renderElfeedPreview()= (search list: filter, dated entries with feed/unread-title/read-title/tags, log lines by level). The preview label now names the app and notes generic vs bespoke. Verified: node, headless screenshots, self-test PASS. - -*** 2026-06-08 Mon @ 02:32:44 -0500 Phase 6 — generated all-package inventory landed -=build-inventory.el= (loaded into a running Emacs) groups every installed package's faces by the defining package and writes =package-inventory.json=. =generate.py= embeds it and merges each package into the dropdown as an editable generic app, leaving org/magit/elfeed bespoke. 40 apps now (3 bespoke + 37 inventory, 643 faces). Committed data artifact, refreshed by reloading the .el; never browser-side discovery. Verified: node, self-test PASS, app count + bespoke-preserved checks. - -*** 2026-06-08 Mon @ 02:34:01 -0500 Phase 7 — docs landed -Rewrote =README.md= for the full tool: three face tiers + palette, the in-page picker (with the AA/AAA mask), package faces (bespoke vs generic previews), modeled inheritance + relative height (family stays in font-config.el), the packages schema with inherit/height/source, export-vs-save, and the inventory-refresh command (=build-inventory.el=) + its loaded-config dependency. Notes =theme-studio.html= is generated. Test-surface fixtures tracked separately below. - -*** 2026-06-08 Mon @ 02:40:00 -0500 theme-studio tier 3 — test surface landed -Extended the guarded =#selftest= harness (headless Chrome) to assert the acceptance criteria against the real emitted code: old-JSON import (no =packages=), full round-trip (fg/bg/bold/italic/inherit/height/source), cleared-state export, unknown-package/face preservation, and inheritance-cycle termination — all PASS. The two DOM-coupled regressions are handled structurally: =updateColor= remaps =PKGMAP= on a palette-color edit, and =PKGMAP= stores hexes so a deleted palette color leaves package refs in the "(gone)" recoverable state. =generate.py= rebuilds =theme-studio.html= each run. -** DONE [#B] theme-studio perceptual color metrics :feature:theme:theme-studio: -CLOSED: [2026-06-08 Mon] -Spec (Ready, opens confirmed 2026-06-08): [[id:15db8ae3-fc14-49f3-9ed5-d5ff59790904][docs/specs/theme-studio-perceptual-color-metrics-spec-implemented.org]]. OKLCH model + perceptual-L/APCA readouts + pairwise ΔE, for building low-contrast themes by metric rather than by eye. All five phases shipped 2026-06-08 (commits 49342bf5, 78260018, 77c7f126, 163d3730, 22605426, 582d8a6a): colormath.js core inlined + WCAG/HSV helpers migrated; picker OKLCH/APCA readouts; palette ΔE warnings; OKLCH edit-model dials; C×L gamut plane. 17 Node tests (colormath 100/93.75/100), six browser hash gates green, inline-integrity guard. vNext deferrals (low-contrast preset, CIEDE2000) remain the two [#D] tasks below. Manual eyeballs tracked under Manual testing. -*** 2026-06-08 Mon @ 19:43:50 -0500 Color-math foundation + Node tests landed -Pure color core in =scripts/theme-studio/colormath.js= (OKLab/OKLCH, APCA-W3 0.1.9 exact constants, ΔE-OK, binary-search gamut clamp returning ={hex,clamped}=) shipped in 49342bf5; this phase finished the integration in 78260018. =generate.py= now inlines the colormath.js body into the page script (export-stripped, =COLORMATH_J= placeholder), and the page's lin/rl/contrast/rating/hsv2rgb/rgb2hsv/hex2rgb/rgb2hex copies moved into the module — =rl= reuses the canonical =lin= (0.04045 cutoff), byte-identical to the old 0.03928 form on every #rrggbb (no 8-bit channel falls between the cutoffs; verified over 200k pairs, zero contrast change). =test-colormath.mjs= gained Normal/Boundary/Error cases for the migrated helpers, a seeded hsv-rgb round-trip property test, and an inline-integrity check that the generated page carries the module body verbatim. Gate met: =node --test scripts/theme-studio/*.mjs= 15 pass, colormath.js 100% line / 93.75% branch / 100% func; =node --check= on the spliced script clean; =#selftest= + =#cursortest= PASS in headless Chrome. NOTE: =node --test <dir>= directory-globbing is broken on Node v26 (tries to load the dir as a module) — use the =*.mjs= glob form. -*** 2026-06-08 Mon @ 19:55:53 -0500 Picker OKLCH/APCA readouts landed -Phase 2 shipped in 77c7f126. Second readout row (=.pinfo2=) under the WCAG ratio: OKLCH L/C/H + signed APCA Lc against the ground color, always shown; sign convention in the APCA tooltip + README. Tables unchanged (APCA picker-only per Agreed-decision #3). =pkReadout= drives the spans from the inlined colormath functions. Gate met: =#readouttest= asserts the spans match the live computation AND the known dupre-blue OKLCH reference (L 0.591 / C 0.052 / H 252°, APCA Lc -34 on ground) with WCAG unchanged; =#selftest= + =#cursortest= still PASS; 15 Node tests green. Headless-rendered values verified against a node cross-check. Visual eyeball is the open "Perceptual readouts read well in the picker" item under Manual testing. -*** 2026-06-08 Mon @ 20:44:39 -0500 Palette ΔE warnings landed -Phase 3 shipped in 163d3730. =renderPalette= runs a pairwise OKLab ΔE over PALETTE via the pure =paletteDeltas()= (one pass → sub-threshold pairs + per-color nearest distance); warns on pairs below the named =DELTAE_MIN= (0.02), sorted closest-first, capped at 5 with "and N more"; each chip's tooltip gains its nearest-neighbor ΔE. Names go through =esc= before the warning markup. Gate met: =#deltatest= PASS (near pair fires + names itself; spread palette quiet; 7-color cluster caps at 5 ascending + overflow suffix). #readouttest/#selftest/#cursortest + 15 Node tests still green. Screenshot-verified the warning render (terracotta "too-similar colors" header + "blue / blue2 — ΔE 0.007, hard to distinguish", placed between palette and add-color controls). Pushed below. -*** 2026-06-08 Mon @ 21:05:28 -0500 OKLCH sliders + color-model control landed -Phase 4a shipped in 22605426. Picker gains an edit-model toggle (HSV/OKLCH) in its own =pkModel= state, orthogonal to =pkMode= (AA/AAA mask) — separate handlers, distinct toggle colors (blue vs gold). OKLCH mode shows L/C/H as paired range+number inputs driving =oklch2hex= → hex/swatch/readouts/HSV-cursor; out-of-gamut chroma snaps the dials to the reachable color + shows "chroma clamped to sRGB". HSV stays default; SV square still edits HSV (C×L plane is 4b); SV drag in OKLCH mode refreshes the dials. =openPicker= re-asserts the model via =setPkModel= so the toggle highlight can't drift (caught on screenshot). Gate met: =#oklchtest= PASS (color preserved on model switch; mask toggle leaves pkModel; model switch leaves pkMode; dials drive color to a known OKLCH target; out-of-gamut C raises clamp status). All 5 browser gates + 15 Node tests green; screenshot-verified the dials + toggle highlight. -*** 2026-06-08 Mon @ 21:41:49 -0500 Chroma×Lightness plane landed -Phase 4b shipped in 582d8a6a. OKLCH mode renders the SV square as a C(x)×L(y) plane at the current hue; crosshair maps to (C,L), hue strip selects H. Out-of-gamut region greyed (#15120f), AA/AAA contrast mask overlays the reachable colors. Per-cell gamut test is forward-only (=oklch2oklab=→=oklab2lrgb=→=inGamut=), never the binary search (that stays in =oklch2hex= for committing). colormath.js exports =oklab2lrgb=/=inGamut=/=lrgb2hex= with direct Node tests (one pins inGamut to oklch2hex's clamped flag). Bitmap cached on (hue+dims+mask+bg) so C/L drags reuse it; hue drags ride browser pointermove-to-frame coalescing (synchronous render measured ~7ms math/5600 cells — no explicit rAF defer; flagged if jank appears). HSV path untouched. Gate met: =#planetest= (crosshair at C/L; OOG cell grey; in-gamut cell colored). Screenshot-verified the plane (gamut-boundary shape, crosshair at C=0 for grey). NOTE for Craig: OKLCH_CMAX=0.4 matches the C dial domain, so much of the plane is gamut-grey at low-chroma hues — a tighter max fills more area but desyncs the crosshair scale from the dial; your eyeball call. -*** 2026-06-08 Mon @ 21:41:49 -0500 Test surface green across the feature -Final state: 17 Node unit tests (colormath.js 100% line / 93.75% branch / 100% func), six browser hash gates (=#cursortest=/=#readouttest=/=#deltatest=/=#oklchtest=/=#planetest=/=#selftest=), inline-integrity check, =node --check= on the spliced page, README updated. All green. NOTE: =node --test <dir>= directory-globbing is broken on Node v26 — use =node --test scripts/theme-studio/*.mjs=. -** DONE [#B] theme-studio refactor — extract app from generate.py :feature:theme-studio:refactor: -CLOSED: [2026-06-09 Tue] -Examined 2026-06-09. generate.py is 1378 lines, ~1300 of them a single triple-quoted string holding the whole app (CSS + HTML + ~1000+ lines of JS). That string is the root of every refactor here: the app logic can't be unit-tested (only =colormath.js= is, because it is the one extracted module); backslash-doubling in the string caused real bugs this session (the multi-line export strip, the =#deltatest= regex); and there is no lint, highlight, or brace-check until Chrome runs it. The rest of the directory is healthy: =colormath.js= (pure, 100/96 tested) and =build-theme.el= (13 small functions) are the model. - -Run the whole set in NO-APPROVALS mode: TDD per stage (characterization hash tests before each behavior-preserving move; node unit tests as extraction makes logic importable), commit + push at each green stage. Tooling committed at c7518d6f before starting. Order: - -DONE (2026-06-09): Stages 1-5 + 7 landed and pushed (origin/main tip dd90eca9); Stage 6 deliberately skipped (optional, works today). generate.py went 1378→~500 lines; the app now lives in real files (styles.css, app.js, app-core.js) inlined at generate time. The escaping-bug class is gone (str.replace is literal), the dedup is done (unified dropdowns/sort/clear-unlocked, shared crHtml/mkStyleButtons/effFg helpers), and the pure app logic is unit-tested (app-core.js, 18 node tests). Three new permanent gates added along the way: =#locktest=, =#sorttest=, and the app-core integrity + node suite. =make theme-studio-test= = 13 python + 43 node + spliced-check + 8 hash gates, all green. -*** 2026-06-09 Tue @ 05:01:11 -0500 Stage 1 — #locktest net + extracted styles.css/app.js -Added the =#locktest= browser gate first (commit d04f44dd): it pins, across all three tiers, that mkLockCell disables a row's control (syntax swatch div via data-locked, UI select via .disabled) and that clear-unlocked wipes unlocked rows while skipping locked ones. Proved it goes red when a lock guard is removed. - -Then extracted the =<style>= block to =styles.css= and the =<script>= body to =app.js= (commit eaf16904), inlined by =generate.py= through STYLES_CSS / APP_JS placeholders the same way =colormath.js= is. Used =ast= to pull the resolved string value so the escapes (single vs doubled backslashes) survive the move — the generated page is byte-identical to before. =generate.py= dropped 1378 → ~500 lines (the remaining bulk is the package face-data dicts; Stage 6 may data-file those). Two integrity tests guard the splice: styles.css inlines verbatim, app.js reaches the page as =fill_data= renders it; both go red if the wiring is dropped. - -Gate green: 12 python templating tests, 25 node tests, spliced-script =node --check=, all 7 hash gates. =node --check app.js= passes standalone (placeholders are valid JS identifiers). The escaping-bug class is gone — =str.replace= is literal, so the JS no longer lives inside a Python string. -*** 2026-06-09 Tue @ 05:07:10 -0500 Stage 2 — unified color dropdowns on the swatch picker -Deleted native =colorDropdown=; routed UI + package fg/bg through =mkColorDropdown= so all three tiers show real swatches (commit aee14bff). The inherit column stays a select — it picks a face name, not a color. Pulled the option-list build into a shared =ddList= helper (default + palette + "(gone)" entry), replacing the inline copy in the syntax table. Preserved value-based sort: the swatch dropdown now exposes =data-val= and =cellVal= reads it. Updated =#locktest='s UI assertion to the div lock path (data-locked). Verified via headless DOM: legbody 21 cdd / 0 select, uibody 40 cdd / 0 select, pkgbody 176 cdd + 88 inherit selects. All gates green. -*** 2026-06-09 Tue @ 05:12:00 -0500 Stage 3 — extracted crHtml + mkStyleButtons -Extracted =crHtml(r)= (the contrast→ratingColor→rating span, was copy-pasted at 5 sites; now syntax/UI/pkg cells share it — the picker readout renders differently and stays) and =mkStyleButtons(isOn,onToggle)= (the B/I/U/S loop, was near-identical in the UI + pkg tables; returns the button list for mkLockCell). Commit 62b53bc5. - -Deliberately NOT done: the syntax bold/italic buttons (2 buttons, BOLD/ITALIC dicts, in-place refresh closure — poor fit for the same helper), and a shared row scaffold (the three tables differ enough in columns/order that one would leak — premature abstraction). Node-unit-testing the pure pieces deferred to Stage 7, where app.js is made importable. - -Verified behavior-preserving by diffing the runtime-rendered DOM (Stage 2 page vs Stage 3 page in headless Chrome): the only differences are inside the inline =<script>= source, never a built tr/td/button/span — the tables build identically. All hash gates + node + python green. -*** 2026-06-09 Tue @ 05:16:33 -0500 Stage 4 — unified syntax table onto the shared sort -Deleted =srt= + =D{}= (the syntax table's own sort); pointed its headers at =srtTable('legbody',col)= so all three tables share =srtTable=/=cellVal=/=applyTableSort= (commit d947944b). Mapping is exact: the legtable color cell is a swatch dropdown whose =data-val= is the hex (what =srt= sorted on via MAP[kind]); elements cell is text; first-click stays ascending. Syntax sorts on click only — it doesn't opt into the cross-rebuild persistence the UI/pkg tables get, preserving its prior behavior. Added a =#sorttest= gate (sort was untested): syntax sorts by color asc, reverses on re-click, sorts by element name; UI + pkg still sort. asc/desc pair is self-validating. -*** 2026-06-09 Tue @ 05:20:22 -0500 Stage 5 — parameterized clear-unlocked + added effFg/effBg -Collapsed the three clear-unlocked functions into =clearUnlockedRows(items,keyFn,resetFn)= (keyFn returns a row's lock key or null to skip; resetFn does the tier-specific clear) — #locktest already guards clear-unlocked-skips-locked per tier. Replaced the 9x =||MAP['p']= / =||MAP['bg']= effective-fg/bg fallback with =effFg(v)=/=effBg(v)= across syntax/UI/pkg render paths (commit 89d079fe). Behavior-preserving: rendered DOM (script stripped) byte-identical; all gates green. Node-unit-testing the pure pieces (effFg/effBg, clearUnlockedRows) deferred to Stage 7 with the rest of the importable-app-logic suite. -*** 2026-06-09 Tue @ 06:03:04 -0500 Stage 6 — skipped (optional, deferred) -Left undone deliberately. Grouping the free module-level state into a state object is churn with no functional gain (works today), and data-filing the inline face dicts is a generate.py size win unrelated to the refactor's goal (testable logic), which Stage 7 already achieved. Can be revived from this entry + the original plan if the generate.py face dicts ever need to become data. Not blocking anything. -*** 2026-06-09 Tue @ 06:03:04 -0500 Stage 7 — extracted app-core.js + unit-tested the app logic -The coverage payoff. Pulled the pure package-face model + dropdown option list into app-core.js (nameToHex, buildPkgmap, packagesForExport, mergePackagesInto, effResolve, optList — every dep a parameter, no DOM/globals), inlined like colormath.js (strip + placeholder + integrity). app.js keeps thin wrappers (pname/seedPkgmap/ddList/pkgEffFg/pkgEffBg) passing live PALETTE/APPS/PKGMAP, so no call site changed and the built DOM is byte-identical. Added test-app-core.mjs: 18 Normal/Boundary/Error tests (name resolution, seed/export/merge round trip, inherit chain incl. a cycle terminating at null, "(gone)" entry) + inline-integrity. Node suite 25→43; python +1 integrity. Commit dd90eca9. GOTCHA found+fixed pre-commit: a code comment that contained the literal token "APP_CORE_J" got inlined by str.replace too (placeholder tokens must not appear in prose that gets templated). -** DONE [#C] M-F9 ai-vterm close removes the window split :quick:solo: -CLOSED: [2026-06-06 Sat] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-02 -:END: -Closing the ai-vterm with M-F9 while its window is in a split deletes the split too (the sibling window goes away) instead of just closing the vterm and leaving the rest of the layout intact. - -*** 2026-06-02 Tue @ 14:12:48 -0500 Audit: still a bug, distinct from the F9 collapse -The F9 toggle-off rework (38dad92) made F9 collapse the split by design, but that's the toggle path. This is M-F9 close (kills the agent process): close should leave the surrounding layout intact, not delete the sibling window. Craig confirmed it's still a bug. cj/--ai-vterm-close-buffer still calls delete-window. - -*** 2026-06-06 Sat @ 18:18:17 -0500 Fixed: close swaps the window to a non-agent buffer instead of deleting it -=cj/--ai-term-close-buffer= no longer calls =delete-window=; it swaps the agent's window to the working buffer (=cj/--ai-term-most-recent-non-agent-buffer=), then kills the agent buffer, so the split survives. F9 hide still collapses the split by design; close no longer does. Regression test =test-ai-term--close-buffer-keeps-window-split=. Commit =1a097b7e=. -** DONE [#B] theme-studio live-preview bevel thinner than Emacs :bug:theme-studio: -CLOSED: [2026-06-10 Wed] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-10 -:END: -Craig confirmed the bevel reads right 2026-06-10 after the reliefColors port (commit bb2aed2f). - -The mode-line box (3D released-button bevel) in the live buffer preview renders slimmer than the bevel Emacs actually draws. Make them match. The bevel comes from =boxCss= in app.js (~line 307), currently =inset 1px 1px 0 #ffffff33,inset -1px -1px 0 #00000066= for the released style — a 1px inset with faint translucent highlight/shadow. Emacs's released-button box is wider/stronger (it shades the highlight and shadow from the actual background color, not a flat translucent white/black). Fix: widen the bevel and derive the highlight/shadow from the box's background so it reads like Emacs. Verify side-by-side against a real Emacs mode-line. -*** 2026-06-10 Wed @ 15:22:48 -0500 Ported Emacs's relief algorithm into boxCss -Implemented =reliefColors= in colormath.js as a direct port of Emacs 30's =x_alloc_lighter_color= (xterm.c): highlight = bg x1.2 (delta 0x8000), shadow = bg x0.6 (delta 0x4000), an additive dark boost below brightness 48000/65535, and the same-color fallback (pure-black shadow lifts to #404040, as Emacs does). =boxCss= now takes the face's effective bg and derives both edges from it; pressed swaps the pair; the translucent pair survives only as a no-bg fallback. Width stays at the box's width (default 1px): dupre declares =:line-width -1=, so Emacs draws 1px lines too — the "wider" impression was the strength of the derived colors (on the dupre mode-line bg, Emacs's highlight is #71767f vs the old overlay's effective #595d63). 5 node tests with hand-computed fixtures from the C source + a new #beveltest gate (derived colors in paintUI, pressed swap, line-style passthrough). Algorithm evidence: emacs-30 xterm.c lines 9599-9665 (fetched 2026-06-10). Awaiting the side-by-side check below. -** DONE [#B] theme-studio color-harmony explainer :feature:theme-studio:docs:solo: -CLOSED: [2026-06-10 Wed] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-10 -:END: -Written 2026-06-10 as [[file:docs/design/theme-studio-color-harmony.org][docs/design/theme-studio-color-harmony.org]]: the OKLCH method (borrow hue, fix L/C per tier, constraints bound the dials), the L≈0.28/C≈0.045 background-tint tier, the fg-vs-bg role split, the worst-case floor / L_max problem (cross-referenced to the shipped ramps spec), ramp generation as shipped, and harmonic fill as the vNext application. Harmonic fill itself stays tracked in the ramps spec. - -Write an explainer in =docs/design/theme-studio-color-harmony.org= capturing the OKLCH harmony method worked out 2026-06-09: harmony is mostly calculable — work in OKLCH, borrow the hue from a semantic accent, fix lightness + chroma across a tier, and let contrast (WCAG/APCA), ΔE separation, and the sRGB gamut bound the free dials. Include the worked background-tint tier (borrow accent hue, fix L≈0.28 C≈0.045 → dim readable bg per hue) and the fg-vs-bg role split (bright accents for text, dim low-chroma tints for backgrounds). - -Two features it enables (both worth building): -1. Ramp generation (focus first): from a base color, generate its tonal ramp — base, +1/+2/+3 (lighter) and -1/-2/-3 (darker) — by stepping OKLCH lightness (and easing chroma) on a fixed hue. Term note: the whole family is a "ramp"/"tonal scale"; darker steps are "shades", lighter are "tints", gray-mixed are "tones" — so "ramp" or "scale" is the precise word, not "shades". -2. Harmonic fill: from a few chosen colors (e.g. slate blue + bg), generate a table of harmonic candidates (hue-angle schemes at matched L/C) to fill the missing palette slots. - -Open design problem to address in the explainer + the ramp feature: a background-over-text effect (highlight/region/isearch/hl-line) must stay readable for EVERY foreground that can appear on it — i.e. the worst-case (lowest) contrast across the whole set of element fg colors, not a single pair. The usable background lightness is therefore capped by the darkest/closest fg in that set. - -The v1 feature (ramp generation + background-contrast safety, with the worst-case-floor UX) is designed in [[file:docs/theme-studio-palette-ramps-spec.org][docs/theme-studio-palette-ramps-spec.org]]. Codex review incorporated 2026-06-09: both open decisions resolved (WCAG AA default target; v1 foreground set = distinct syntax hexes + default fg), v1 covered faces closed to region/hl-line/highlight/lazy-highlight/isearch, ramp defaults + function contracts pinned. Spec is Ready (Craig confirmed 2026-06-09); the v1 build is tracked under the sibling parent below. Harmonic fill (feature 2) stays vNext. This task is the explainer doc itself (=docs/design/theme-studio-color-harmony.org=, the methodology). -** DONE [#B] Telegram mark-read path for triage :bug:telega: -CLOSED: [2026-06-11 Thu] -Work's triage handoff (2026-06-11 09:20): find a reliable way to mark Telegram noise chats read — 49 unread chats keep resurfacing every sweep. Two findings from work's attempt: the plugin's documented verb =telega-chat--mark-read= doesn't exist in the installed telega (=telega-chat-toggle-read= looks right), and the dockerized telega-server reaches Ready but SIGSEGVs (exit 139) the moment =telega-chat-toggle-read= fires — reproduced twice after clean restarts. Scans still work off the cached =telega--chats= hash; no action verb can run. Candidates: call =telega--viewMessages= directly, batch via =telega-filter-read-all= in the root buffer, or bump tdlib in the zevlg/telega-server image. Deliverable: a working verb, then update the canonical =triage-intake.telegram.org= Actions section in rulesets. - -Resolved 2026-06-11: the verbs were never broken (=telega--viewMessages= verified live; =telega-chat-toggle-read= works but toggles, so guard on unread). The SIGSEGVs are spontaneous memory-corruption crashes in the zevlg/telega-server:latest musl build (11 coredumps since 2026-06-09, several with zero verb traffic) — work's correlation was timing. Also deleted 41 join-notice-only chats per Craig's standing call (unread chats 48 → 16). Canonical workflow updated (rulesets e32a7f5); resolution replied to work's inbox. Watchlist: if the spontaneous crashes worsen, pin a pre-2026-06 image digest, build telega-server natively, or report upstream with =coredumpctl= evidence. -** DONE [#B] Memory sweep into the agent KB :chore:quick: -CLOSED: [2026-06-11 Thu] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-11 -:END: -One-time Phase 1.5 sweep from the rulesets agent-KB rollout (handoff 2026-06-10): read this project's harness memory dir, classify each fact against ~/.claude/rules/knowledge-base.md inclusion criteria (KB-worthy / stays local / stale-delete), propose the batch to Craig, write approved facts one-node-per-file under ~/org/roam/agents/ (pull first, commit + push after), then reply to rulesets' inbox with counts. - -Resolved 2026-06-11: 7 memories swept. 3 promoted (no-make-frame-in-live-daemon, proton-bridge cert mismatch, open-images-with-imv — roam commit a915760, pushed); 3 stayed local per Craig (commit-flow waiver is per-project; both theme items held); 1 deleted (numbered-options, superseded by the canonical interaction.md rule). Counts replied to rulesets' inbox. -** DONE [#A] theme-studio contrast cell uses the wrong fg/bg pair :bug:theme-studio:solo: -CLOSED: [2026-06-11 Thu] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-10 -:END: -The contrast readout on every item with two color selections (a fg AND a bg — the UI faces table and the package faces table) is computing the wrong pair. It needs to contrast the face's selected fg against the face's selected bg, not how the bg contrasts with the currently-selected (ground) bg. - -Investigation start: the two-color contrast cells are =paintUI= (UI faces, app.js ~line 740) and =buildPkgTable= (package faces, app.js ~line 430), both currently calling =contrast(effFg(fg), effBg(bg))= where =effFg(v)=v||MAP['p']= and =effBg(v)=v||MAP['bg']=. Reproduce a face that has BOTH a fg and a bg set, confirm the displayed ratio, and check whether it's actually evaluating selected-fg vs selected-bg or falling through to the ground bg. Fix so a two-color face always rates its own fg-on-bg. (Single-color contexts — the picker/palette-chip/plane checks that rate a color against the ground — are correct and out of scope.) Add a characterization gate (a #contrasttest hash gate) pinning fg-vs-bg for a two-color face. -*** 2026-06-10 Wed @ 14:40:22 -0500 Diagnosed and fixed at the root, shared with the preview-bg bug -The ratio computation was already correct (gate-verified: both tables rate a two-color face's own fg-on-bg). What made it READ wrong: (1) =applyGround= blanketed every =.ex= cell — including the per-face preview cells — with the ground bg, so the preview showed fg-on-ground-bg next to a ratio for fg-on-face-bg; (2) a ground-bg change never repainted the UI/package tables, leaving ground-dependent ratios stale. Fix: =applyGround= now blankets only the code panes and =#legbody= example cells and repaints UI faces through =paintUI=; the ground-bg handler also rebuilds the package table/preview. New #contrasttest assertions pin two-color fg-on-bg (both tables), preview-bg survival, ratio stability, and ground-dependent re-rating. Suite green. Awaiting Craig's repro check (manual-test child under the Manual testing parent). -** DONE [#B] theme-studio UI-faces preview cell ignores the face bg :bug:theme-studio:quick:solo: -CLOSED: [2026-06-11 Thu] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-10 -:END: -In the UI faces table, the preview cell for a face with its own bg renders with the ground bg instead. Repro: set mode-line fg=black, bg=blue — the preview cell should be black text on blue, but shows black on black (the live buffer mode-line is fine). Root cause: =applyGround= (app.js:300) blankets EVERY =.ex= element's background to =MAP['bg']=, and the preview cell =cP= shares =className='ex'= (app.js:753), so it clobbers the per-face bg =paintUI= sets (app.js:739) — runs on load and on every ground change. Fix: stop applyGround from touching the UI-face preview cells (scope its =.ex= selector to the code/example cells, give the preview cell its own class, or re-run paintUI after). The contrast cell shares the same staleness, so confirm both. -*** 2026-06-10 Wed @ 14:40:22 -0500 Fixed by the applyGround scoping under the contrast-cell task -Same root cause as the [#A] contrast-cell task, fixed there in one change: =applyGround= scopes its blanket to =#legbody .ex= + the code panes and repaints UI faces through =paintUI=. #contrasttest pins the preview-bg survival. Awaiting the same repro check. -** DONE [#B] cj/undo-kill-buffer off-by-one on plain invocation :bug:quick:solo: -CLOSED: [2026-06-12 Fri] -Fixed in =modules/ui-navigation.el=: indexing is now =(nth (1- arg) ...)=, so a numeric prefix is 1-based and plain M-S-z re-opens the most-recently-killed file (was opening the second). Rewrote the two undo-kill tests to exercise the real no-prefix path (arg=1 -> first) and a 1-based numeric prefix; both red against the bug, green after. Full suite: no new failures (the 4 pre-existing dupre-theme failures are the separate task below). Live-reloaded into the daemon. -** DONE [#B] dashboard-config setq wipes recentf-exclude list :bug:quick:solo: -CLOSED: [2026-06-12 Fri] -Fixed in =modules/dashboard-config.el=: extracted the EMMS exclusion into =cj/--dashboard-exclude-emms-from-recentf= (the =:config= side-effect was not reachable for a test) and switched =setq= to =add-to-list=, so the five exclusions system-defaults adds earlier in init order survive. Two ERT tests in =tests/test-dashboard-config-recentf-exclude.el= (preserves prior entries / adds the pattern); the preservation test was red before, green after. Live-reloaded into the daemon and restored the five wiped entries in the running session. -** DONE [#B] org-roam dailies template writes FILETAGS and TITLE on one line :bug:quick:solo: -CLOSED: [2026-06-12 Fri] -Fixed in =modules/org-roam-config.el=: extracted the dailies head into the =cj/--org-roam-dailies-head= defconst (so it is unit-testable, the value was unreachable inside the use-package =:custom= form) and gave it real newlines — =#+FILETAGS: Journal\n#+TITLE: %<%Y-%m-%d>\n=. Two ERT tests in =tests/test-org-roam-config-dailies-head.el= assert FILETAGS and TITLE sit on separate lines and the head ends in a newline (both red before, green after). Live-reloaded into the daemon. Open follow-up for Craig: existing malformed daily files (with the run-together first line) are data, not code — sweep them by hand if desired. -** DONE [#B] drill-refile clobbers global org-refile-targets with an invalid spec :bug:quick:solo: -CLOSED: [2026-06-12 Fri] -Fixed in =modules/org-drill-config.el=: =cj/drill-refile= now =let=-binds =org-refile-targets= (the session-wide value survives) and supplies =(directory-files drill-dir t "\\.org$")= as the file list instead of the bound =drill-dir= symbol (org reads a bound symbol as a directory string, which yielded nothing). Rewrote the stale test (it asserted the buggy =(assoc 'drill-dir ...)=) into two: targets are a real .org file list, and the global is not clobbered. Both red before, green after. Live-reloaded into the daemon. - -Follow-up 2026-06-12 (Codex review): the first fix reinvented file-listing with a raw =directory-files= call, bypassing the shared validated entry point =cj/--drill-files-or-error= — no missing/unreadable-dir =user-error=, silent fall-through on an empty dir, and it included leading-dot =.org= files the rest of the module excludes. Re-routed through =cj/--drill-files-or-error= + =expand-file-name=; the test was rewritten into three (validated-helper targets, no global clobber, =user-error= on a missing dir). -** CANCELLED [#B] M-S- launcher keys dead: eww, elfeed, calibredb unreachable :bug:quick:solo: -CLOSED: [2026-06-13 Sat] -Not a bug. The audit used =key-binding=, which ignores =key-translation-map=, so it read the M-S- launcher chords as dead. They work in GUI: =keyboard-compat.el= installs a =key-translation-map= entry (=M-E -> M-S-e=, etc.) in GUI frames, so Meta+Shift+letter reaches eww/elfeed/calibredb. The "fix" =4a1ecf64= bound =M-E= directly and broke them instead; reverted here. The real console-reachability problem (the chords are dead outside GUI) is the subject of [[id:540bf06b-16b8-46c6-b459-c40d1b9c795d][the keybinding-console-safety spec]]. -** DONE [#B] Signel Client Open Work -CLOSED: [2026-06-12 Fri] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-12 -:END: -Parent task for the Emacs Signal client bring-up. Engine: signal-cli (linked secondary device). Front end: a fork of signel at =~/code/signel=, wired through =modules/signal-config.el=. Design: [[id:0cabd6ee-c458-47b5-a8af-3ee054b25821][docs/specs/signal-client-spec-doing.org]]. - -Closed 2026-06-12: the bring-up shipped (dated history below). The open signel/signal-cli issues moved to [[file:~/code/smoke/todo.org][the smoke todo]] (smoke is the evolved Signal package) and are tracked there flat (the three open children here — handle-error leak, link-with-QR, groups in picker — moved in that pass). Work on =modules/signal-config.el= stays in this file. - -*** 2026-06-12 Fri @ 07:34:05 -0500 Signel notify-only-for-unviewed-conversation shipped -Wire =cj/signal--should-notify-p= (done) into signel's =signel--handle-receive= notify block (signel.el:277), route through Craig's notify script instead of bare =notifications-notify=, and gate sound behind a defcustom that defaults off. Spec addendum (the four notify details + wiring architecture) accepted 2026-06-11 — see [[id:0cabd6ee-c458-47b5-a8af-3ee054b25821][signal-client-spec-doing.org]] "Notification slice". - -Built 2026-06-11 (TDD; fork commit e263367, dotemacs 9afc6128): =signel-notify-function= customization point in the fork; =cj/signel--notify= + =cj/signal--format-notify-body= + =cj/signel-notify-sound= in signal-config.el, wired in =:config= with a load-time =cj/executable-find-or-warn=. 17 new ERT tests green; full launch smoke clean; live-reloaded into the daemon and a synthetic toast fired through the script path. The two manual checks moved to the Manual testing and validation parent. - -*** 2026-05-26 Tue @ 20:06:58 -0500 Decided: fork signel rather than depend on it -signel is on MELPA but stale (one-author v0.1, all commits in a Jan-2026 burst, unattended tracker, no PRs). The spec needs internal edits (notify behavior, input-clobber fix), which are clean in a fork and hacky via advice, and a dead upstream means no divergence cost. Rejected: adopt-from-MELPA + advice, build-from-scratch, signal-cli-rest-api (Docker), MCP-tool, ERC bridge. Full rationale in the design doc. - -*** 2026-05-26 Tue @ 20:06:58 -0500 Linked as secondary device; contact parser verified against live shape -Installed signal-cli 0.14.4.1 (AUR; imported AsamK's signing key FA10826A... to clear the makepkg verification). Linked the account via QR. Built and unit-tested the pure helper layer in =modules/signal-config.el= (contact-list parsing, notify-when-not-viewing predicate) with =tests/test-signal-config.el=. Confirmed the live =listContacts= shape: givenName/familyName are top-level in 0.14, not under profile as first assumed; corrected the parser and verified it produces a picker entry for all 94 real contacts. Sent a request to archsetup to add signal-cli to the standard install. - -*** 2026-05-27 Wed @ 22:08:40 -0500 Shipped initiate-message workflow: picker + Note-to-Self + keymap -=cj/signel-message= (=C-; M m=) names contacts via =completing-read= over the cj-owned =cj/signel--contact-cache=, with "Note to Self" pinned first. =cj/signel-message-self= (=C-; M s=) sends straight to =signel-account=. Daemon guard =cj/signel--ensure-started= auto-starts the daemon when =signel-account= is set and =user-error='s with the remedy when it isn't; on start it pre-warms the cache. =cj/signel--fetch-contacts= rides the new RPC callback contract (=signel--send-rpc= with success-callback), the result feeds =cj/signal--parse-contacts=, and =cj/signel-refresh-contacts= (=C-; M no leaf=) clears + refetches. Cold-cache invocations =accept-process-output= up to =cj/signel-fetch-timeout= seconds (3s default) and =user-error= on timeout so a wedged daemon can't hang Emacs. Prefix keymap =cj/signel-prefix-map= bound under =C-; M= via =keybindings.el='s =cj/custom-keymap=: m / s / d / q / SPC. 15 new ERT tests in =tests/test-signal-config.el= cover ensure-started branches, fetch contract, cache empty-vs-failure, refresh, picker happy-path + cold-cache resolves + cold-cache timeout, message-self, and the prefix map bindings. - -*** 2026-05-27 Wed @ 21:55:57 -0500 Added JSON-RPC success-result dispatch in the signel fork -Fork commit 4740d97 added =signel--request-handler-map= (id → success callback), extended =signel--send-rpc= with an optional =success-callback= that registers under the new request id, and gave =signel--dispatch= a result branch that invokes the callback and removes the handler. Error responses also remhash the handler entry, and =signel-start= / =signel-stop= both =clrhash= the map so reconnect is reliably empty. Backward-compatible: existing callers that don't pass a callback hit the same code path as before. Five ERT tests in this project (=tests/test-signel-rpc-dispatch.el=, dotemacs commit bfec0eab) lock the contract: Normal (result invokes callback + cleanup, send-rpc registers), Boundary (unknown id is a no-op), Error (error response cleans up handler), reconnect (=signel-stop= empties the map). Refactor audit surfaced a separate pre-existing leak in =signel--handle-error= (request-buffer-map entries aren't removed on error); filed as the [#C] follow-up below. - -*** 2026-05-27 Wed @ 22:08:40 -0500 Shipped clobber fix for both insert paths -Fork commit 5ec56c0 added =signel--pending-input= (capture from input-marker to point-max) and =signel--restore-input= (re-insert after the redrawn prompt; nil-safe), and wired both into =signel--insert-msg= (the receive path) and =signel--insert-system-msg= (the error path). A mid-type send now survives both an incoming message and a system-error insertion. Four ERT tests in =tests/test-signel-input-preservation.el= cover the helpers (typed text, empty) and both insert paths via a temp =signel-chat-mode= buffer. - -*** 2026-05-27 Wed @ 22:08:40 -0500 use-package wired with C-; M keymap and local account config -=use-package signel :load-path "~/code/signel" :ensure nil= already wired earlier with =signel-auto-open-buffer nil=. Account source is =signel-account= set from =cj/signal-private-config-file= (=signal-config.local.el=, gitignored) loaded in =:config=, decided in the workflow spec. Keymap prefix =C-; M= attached via =with-eval-after-load 'keybindings= so the binding survives load-order. - -*** 2026-06-06 Sat @ 12:29:24 -0500 Fixed C-; M load-order bug via canonical register-prefix-map -Root cause: signal-config.el was the only feature module that violated the prefix-registration contract documented in =keybindings.el:41-45=. Every other prefix map uses =(require 'keybindings)= + a top-level =(cj/register-prefix-map "X" map)=; signal-config had neither, mutating =cj/custom-keymap= directly through a =(with-eval-after-load 'keybindings (when (boundp 'cj/custom-keymap) ...))= form. The =boundp= guard turned a load-order miss into a SILENT no-op — no error, the binding just never happened — which is why a live-reload (keybindings definitely loaded by then) papered over it. -Fix: added =(require 'keybindings)= at the top of signal-config.el and replaced the guarded form with =(cj/register-prefix-map "M" cj/signel-prefix-map "signal messages")=, matching the 25+ other prefix maps. -Verified: (1) new contract test =test-signal-config-prefix-map-registered-under-c-semi-m= asserts =C-; M= resolves to =cj/signel-prefix-map= (35/35 green); (2) full =emacs --batch= init.el launch — the exact failing scenario — now shows =C-; M= bound; (3) clean byte-compile; (4) live-reloaded into the daemon, binding confirmed. No unit-level red was possible: the =boundp= guard is robust under all standard test timings, which is the CLAUDE.md launch-only-failure class. - -*** 2026-05-28 Thu @ 03:09:18 -0500 Chat buffer docks bottom 30% and C-c C-k cancels -=display-buffer-alist= entry in =modules/signal-config.el= matches =^\*Signel: = chat buffers and routes them through =display-buffer-at-bottom= with =window-height . 0.3=, so the chat docks to the bottom 30% of the frame. The signel fork's =signel-chat= switched from =switch-to-buffer= to =pop-to-buffer= so the rule can apply (=switch-to-buffer= ignores =display-buffer-alist=). =C-c C-c= was already bound to =signel--send-input= in the mode; =C-c C-k= now binds =signel--cancel-input=, a new fork helper that clears the editable region between =signel--input-marker= and =point-max= and then calls =quit-window=. Buffer stays alive so chat history above the marker survives revisits; cleared input means the next visit lands on a fresh prompt. Five ERT tests in =tests/test-signel-cancel-input.el= (clears pending, empty-area no-op, quit-window called, buffer preserved, keymap binding) and two new tests in =tests/test-signal-config.el= (entry shape + regex match set). Dotemacs commit 998e9c7a, fork commit df02d79. -** DONE [#C] Project-aware bug capture via C-c c t :feature: -CLOSED: [2026-06-12 Fri] -Relocated from the global capture inbox 2026-06-06. When inside a projectile project, C-c c t (Task) files into that project's root todo.org under the "<Project> Open Work" header. If the project has no todo.org, fall back to the global inbox-file and warn naming the project. - -Implemented 2026-06-06 in =modules/org-capture-config.el=: a shared project-aware =function= capture target (=cj/--org-capture-project-location=) used by =C-c c t= (Task, files a top-level TODO) and a new =C-c c b= (Bug, files a top-level TODO [#C]). Matches an existing top-level "... Open Work" heading (so ~/.emacs.d hits "Emacs Open Work") and creates "<Capitalized project> Open Work" only when absent. Outside a project / no todo.org -> global inbox under "Inbox" (with a warning in the no-todo.org case). 15 ERT tests in =tests/test-org-capture-config-project-target.el=; daemon e2e confirmed a real capture lands a second-level TODO entry prepended under Open Work. Manual verify filed under the Manual testing and validation parent. NOTE: the matching "<Project> Resolved Work" header for the wrap-up workflow is a separate concern, not handled here. -** DONE [#A] theme-studio: 2D gallery color picker for assignment dropdowns :feature:studio: -CLOSED: [2026-06-15 Mon] -Replaced the per-face color dropdown (mkColorDropdown popup in app.js) with a 2D grid in the palette-panel shape: galleryModel(cur,palette,ground) in app-core.js (pure; reuses columnsFromPalette) returns a default chip, an optional (gone) cell, and rows = ground strip then one row per family (members dark->light, one selected). 5 node tests + #gallerytest browser gate. Trigger and ‹ › step buttons unchanged; applies to all three tiers. From the roam inbox 2026-06-15. -** DONE [#C] theme-studio: palette display toggle for base colors vs full palette :feature: -CLOSED: [2026-06-15 Mon] -Added an arrow control on the palette: right collapses each column to its base color (ground steps collapse to bg/fg too), down shows the full spans. #paltoggletest covers it. Commit 5ab506d9. -** DONE [#A] theme-studio: flag gone color assignments with a distinctive border :feature:studio: -CLOSED: [2026-06-15 Mon] -Swatches whose assigned color resolves to "(gone)" now carry a solid red outline (distinct from the dashed unused-tile flag). #gonetest covers it. Commit 0529189a. -** DONE [#A] theme-studio: flag unused palette tiles and columns :feature: -CLOSED: [2026-06-15 Mon] -usedPaletteHexes reverse-lookup over syntax/ui/package assignments + ground; a tile referenced nowhere gets a dashed outline, an all-unused column gets a dashed box. Biased safe (never flags a used color). Node tests + #unusedtest. Commit 7e7b871f. -** DONE [#C] theme-studio: equalize style and box button cluster sizing :refactor:quick:studio: -CLOSED: [2026-06-15 Mon] -Shrank .sbtn from 26x24 to the 17x15 box-button size (font 13px), so the style and box clusters match and the row returns to roughly its pre-cluster height. Commit 44128931. -** DONE [#A] Face and font diagnostic popup at point :feature: -CLOSED: [2026-06-15 Mon] -Read-only popup diagnosing why text at point paints as it does (face stack by source, merged attributes, real font vs declared family, theme/config/inherit provenance). Spec: [[id:98f065cf-8bd5-46a0-ac24-da94d66855ad][face-font-diagnostic-popup-spec-implemented.org]]. Building in modules/face-diagnostic.el: pure core cj/--face-diagnosis-at returns the report plist; cj/describe-face-at-point renders it into a read-only help buffer. From the roam inbox — "do this one first." -*** 2026-06-15 Mon @ 12:19:41 -0500 Phase 1 — core read model + buffer classifier landed -modules/face-diagnostic.el: cj/--face-diagnosis-at returns groups 0-2 (buffer classification, character context, face stack by source) via small pure helpers. 17 ERT tests (tests/test-face-diagnostic.el), byte-compile clean. Not yet wired into init.el; the interactive command and keybinding land in Phase 4. -*** 2026-06-15 Mon @ 12:26:52 -0500 Phase 2 — merged attributes + real font landed -cj/--face-diag-merged-attributes folds the ordered, remap-expanded spec stack ("computed"); cj/--face-diag-real-font reports font-at or "unavailable" under batch. Settles spec decision #7 (hand-fold, tested on overlay-over-text-prop, default-remap, and face-symbol fixtures). 23 ERT tests total, byte-compile clean. -*** 2026-06-15 Mon @ 12:30:30 -0500 Phase 3 — provenance trace landed -cj/--face-diag-provenance returns per-face provenance: themes from theme-face, config from saved/customized-face, the :inherit chain, and the attributes still unspecified that fall to the default. Version-sensitive internals sit behind small tolerant accessors. 30 ERT tests total, byte-compile clean. -*** 2026-06-15 Mon @ 12:37:16 -0500 Phase 4 — render + popup wiring landed -cj/describe-face-at-point renders the diagnosis into the read-only *Face Diagnosis* buffer (cj/face-diagnostic-mode), with region-scan mode and an out-of-scope banner; required in init.el; live-verified in the daemon (it already surfaces the auto-dim remaps). Command name settled as cj/describe-face-at-point. Deferred to follow-up: clickable face-name buttons (plain text for now) and the module-header allowlist entry; the keybinding is Craig's to pick. -** DONE [#B] dwim-shell: zip overwrites its own name, backup timestamp never expands, dired menu key dead :bug:quick:solo: -CLOSED: [2026-06-13 Sat] -From the 2026-06 config audit, =modules/dwim-shell-config.el=: -- =:338= — single-file zip is =zip -r '<<fne>>.<<e>>' '<<f>>'= — reconstructs the input filename as the archive ("Zip file structure invalid"; directories produce =foo.=). Should be ='<<fne>>.zip'= like the tar-gzip sibling. -- =:549= — backup destination single-quotes =$(date ...)= so the substitution is literal: =foo.txt.$(date +%Y%m%d_%H%M%S).bak=. Move it outside the quotes or format-time-string in Elisp. -- =:932= — dired-mode binding "M-S-d" is unreachable (Meta+Shift+d generates M-D); the dirvish binding two lines down is correctly "M-D". Fix + the stale commentary at dirvish-config.el:30. -Fixed 2026-06-13: zip single-file template now ='<<fne>>.zip'=; backup uses =format-time-string= in Elisp (real =YYYYMMDD_HHMMSS= stamp, dropped the now-unneeded =date= util); dired key M-S-d→M-D + dirvish-config.el:30 doc corrected. Both command strings extracted into top-level builders (=cj/dwim-shell--zip-single-file-command=, =cj/dwim-shell--dated-backup-command=) so they're unit-testable without the dwim-shell-command package — the command defuns live in its use-package :config, which the batch harness doesn't load. 2 builder tests green in make; live daemon confirms all three (backup stamp, .zip, dired M-D). Real backup/zip run + the dired keypress are a VERIFY. -** DONE [#B] ERC: double mention notifications + tautological server list :bug:quick:solo: -CLOSED: [2026-06-14 Sun] -From the 2026-06 config audit, =modules/erc-config.el=: -- =:281= — =erc-modules= includes the built-in =notifications= module AND :config adds =cj/erc-notify-on-mention= to the same hook — every mention fires two desktop notifications. Pick one path (keep the custom one, slated for messenger unification). -- =:100= — =cj/erc-connected-servers=: inside =with-current-buffer=, the free =erc-server-process= is the buffer's own local value, so the eq test is tautologically true — returns ALL ERC buffers (channels, dead connections). Use =erc-server-buffer-p= + =erc-server-process-alive=. -- =:238= — =user-whole-name= read at load but =user-constants= only required at compile time (same trap as auth-config/keyboard-macros). -Fixed 2026-06-14: removed =notifications= from =erc-modules= (kept the custom =cj/erc-notify-on-mention=, so one notification per mention); rewrote =cj/erc-connected-servers= to filter on =(erc-server-buffer-p)= + =(erc-server-process-alive)= instead of the tautological self-eq; moved =user-constants= to a runtime require. New test-erc-config-connected-servers.el (live-server-only + empty cases) 2 green; module byte-compiles. erc-config not reloaded into the daemon (live IRC session) — takes effect on restart. VERIFY for the one-notification + real-server-list behavior. -** DONE [#B] help-config: three defects in one small file :bug:quick:solo: -CLOSED: [2026-06-13 Sat] -From the 2026-06 config audit, =modules/help-config.el=: -- =:67= — =cl-return-from= inside a plain =defun= (no cl-block): declining the save prompt signals "No catch for tag" instead of canceling. =cl-defun= or restructure. -- =:108= — =:hook (info-mode . info-persist-history-mode)= is dead twice: Info's hook is =Info-mode-hook= (capital I), and =info-persist-history-mode= doesn't exist anywhere. Implement the intent or delete. -- =:111= — auto-mode-alist maps .info to an interactive command that KILLS the buffer mid find-file — programmatic =find-file-noselect= of any .info destroys buffers and pops Info windows. Drop the entry; keep the explicit command. Zero test coverage on this module (the two broken paths are exactly the untested ones). -Fixed 2026-06-13: (1) extracted the save/cancel/open decision into a pure =cj/--info-open-plan= and routed =cj/open-with-info-mode= through it — no more =cl-return-from=, declining cancels cleanly; (2) deleted the dead =:hook= and the empty =:preface=; (3) dropped the destructive =auto-mode-alist= .info entry (kept =cj/open-with-info-mode= as an M-x command and =cj/browse-info-files= on C-h i). New test-help-config.el covers the planner (open / save-then-open / cancel) — 3 green; module loads clean. Stale daemon state (the .info auto-mode entry + the bogus info-mode-hook entry) cleared by hand so the running session is correct without a restart. Interactive Info open + find-file-no-longer-destructive are a VERIFY. -** DONE [#B] markdown live preview clobbered by markdown-mode :bug:quick:solo: -CLOSED: [2026-06-13 Sat] -=modules/markdown-config.el:54= defines bare =markdown-preview=, which markdown-mode redefines the moment the first .md loads — the impatient-mode live preview is dead and F2 silently runs the package command (agent verified in the live daemon). Also =:61= guards on =(boundp 'httpd-process)=, a variable that doesn't exist in simple-httpd — use =(httpd-running-p)=. And the =:config= =(setq imp-set-user-filter 'markdown-html)= at line 41 is doubly dead (function-not-variable, symbol names nothing) — delete. Rename to =cj/markdown-preview=, rebind F2. From the 2026-06 config audit. -Fixed 2026-06-13: renamed the defun to =cj/markdown-preview= and rebound =<f2>=; guard is now =(httpd-running-p)=; deleted the dead =(setq imp-set-user-filter 'markdown-html)= (impatient-mode use-package is now =:defer t= only). Added a guard test (server-down → user-error); 4/4 green; live daemon confirms =cj/markdown-preview= defined and guarding. Browser-render check is a VERIFY. -** DONE [#B] modeline runs synchronous git on the redisplay path, unguarded :bug:solo: -CLOSED: [2026-06-14 Sun] -=modules/modeline-config.el:173,154,145= — the mode-line :eval calls vc-backend/vc-state/vc-working-revision (synchronous git) on TTL expiry; a slow or unmounted filesystem stalls ALL redisplay. The cache key computes =file-truename= on every render (the "one stat per refresh" comment is wrong), and nothing is condition-case-wrapped, so a signal lands inside the mode-line eval. Defer the truename behind the TTL check; wrap the fetch in condition-case caching nil. From the 2026-06 config audit. -Fixed 2026-06-14 (Approach A): dropped =file-truename= from =cj/modeline-vc-cache-key= (key is now =(file show-remote)=, no per-render stat; a moved symlink is caught at the next TTL refresh when vc-backend resolves the link fresh). Wrapped =cj/modeline-vc-fetch= in =condition-case ... (error nil)= so a git signal on a slow/unmounted FS degrades to no-VC-info instead of breaking redisplay. Rewrote the two truename cache-key tests to assert the cheap key; added a fetch-swallows-vc-errors test. 9 modeline vc tests green; live daemon confirms the 2-element key and nil-on-error fetch. -** DONE [#B] org-faces: custom header-row face layer + theme-studio app :feature:theme-studio:spec: -CLOSED: [2026-06-15 Mon] -Named, theme-agnostic faces for org TODO keywords and priorities, wired via org-todo-keyword-faces / org-priority-faces, plus a dedicated theme-studio "org-faces" app beside elfeed and mu4e. Spec: [[id:35578114-8c29-43af-97a2-fdfea01a802e][org-faces-spec-implemented.org]]. All four decisions resolved (prefix org-faces-, real defface defaults, auto-dim repointed to org-faces-*-dim, all 10 keywords). Phase 1 (modules/org-faces-config.el + 5 ERT tests), Phase 2 (auto-dim-config.el repoint), Phase 3 (theme-studio org-faces app) all landed and verified; the build-theme round-trip is confirmed mechanically. Residual visual check is a VERIFY under Manual testing and validation. -** DONE [#B] slack-config lifecycle gaps :bug:quick:solo: -CLOSED: [2026-06-14 Sun] -From the 2026-06 config audit, =modules/slack-config.el=: -- =:265= — w / @ / # bound to commands neither autoloaded nor in :commands — void-function before slack loads. Add to :commands. -- =:246= — =cj/slack-close-all-buffers= reads =slack-current-buffer= (declared but unbound) without the boundp guard its sibling has — void-variable on C-; S Q before slack loads. -- =:259= — raw =global-set-key= for C-; S bypasses =cj/register-prefix-map= (signal/erc use it); invisible to the keybindings registry and the planned unification enumeration. -Fixed 2026-06-14: added =slack-message-write-another-buffer=, =slack-message-embed-mention=, =slack-message-embed-channel= to =:commands= (w/@/# now autoload); guarded =cj/slack-close-all-buffers= with =buffer-local-boundp= (no void-variable on C-; S Q before slack loads); switched =global-set-key= to =(cj/register-prefix-map "S" cj/slack-keymap "slack")= (+require keybindings). New test-slack-config-close-all.el green; module loads, C-; S registered in the registry. Not reloaded into the live daemon (active slack session) — restart to apply. VERIFY for the pre-load key safety. -** DONE [#B] theme-studio color columns :feature:studio: -CLOSED: [2026-06-13 Sat] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-11 -:END: -Show the palette as hue-grouped strips (dark→light) over the existing flat, individually-editable palette. Grouping is by OKLCH hue from the hex, so renaming a color never moves it. A per-strip count control generates a symmetric ramp (N → base ±N) from the strip's most-saturated color; regenerate is authoritative, repointing surviving-step references by lightness rank and leaving removed-step references a visible "(gone)". The ground strip is synthesized from the bg/fg assignments and pinned first; the standalone ramp panel is removed. Designed in [[file:docs/theme-studio-color-families-spec.org][docs/theme-studio-color-families-spec.org]]. Codex-reviewed Ready 2026-06-10 after response folded: pivoted from name-derived families to hex-derived families over a flat palette, which designs out the name-grammar/import-inference and chip-ownership blockers. All review findings dispositioned; both open decisions resolved. Builds on and supersedes the palette-ramps v1 ramp UI. - -All six phases landed 2026-06-10 (commits ebe18d51, 74db9a52, 111687b0, e7ae18c4, 77783126, f6ab0001, 9daeff15, and the Phase 6 commit); =make theme-studio-test= green (98 node tests, 16 browser gates). Code-complete and self-verified. The hue-adjacent warm-color grouping limitation is filed as a separate research task (=~/color-sorting.org=). Remaining: the manual aesthetic/fidelity sign-off under the Manual testing parent (hue grouping reads right, regenerate-replace reads as deliberate, removed-step "(gone)" is clear). Mark this DONE once that passes. -Retired 2026-06-13: the current implementation no longer uses color-derived hue families. Palette entries carry stable structural column ids, generated colors stay in their originating column, renames do not move tiles, and =#columntest= / =#roundtriptest= pin the behavior. -*** 2026-06-10 Wed @ 01:17:45 -0500 Family model core landed -Phase 1 (commit =ebe18d51=, grouping reworked in =77783126=). =familiesFromPalette=, =regenFamily=, =rankByLightness=, =stepRepointPlan= in app-core.js, pure and hex-derived. Grouping started as gap-clustering + flat neutral threshold; after the design discussion it became nearest-hue-anchor bucketing (no single-linkage chaining) + a lightness-scaled neutral threshold (pale tints keep their hue, mid grays go neutral). regenFamily handles n=0 without ramp()'s clamp; stepRepointPlan maps survivors / lists removed by signed lightness rank. 20 node tests including the green/yellow split and the no-chaining case. Open: hue-adjacent warm colors still merge — research task above (=~/color-sorting.org=). -*** 2026-06-10 Wed @ 01:17:45 -0500 Family sort core landed -Phase 2 (commit =74db9a52=). =sortFamilies=/=sortFamilyMembers=: neutrals first, then chromatic by base hue (rounded so a hue hair doesn't outrank lightness), ties by base lightness then hex; members dark→light. Display-only; stored palette order untouched. 4 node tests. -*** 2026-06-10 Wed @ 01:17:45 -0500 Family-strip rendering landed -Phase 3 (commit =111687b0=, columns =e7ae18c4=). renderPalette restructured into the pinned ground strip + hue-sorted family columns (top→bottom dark→light), chips keep per-chip rename/remove/select, move-arrows/drag dropped. #familytest gate locks the structure + rename-stays-in-strip. Existing palette flows stay green. -*** 2026-06-10 Wed @ 01:17:45 -0500 Count control + regenerate landed -Phase 4 (commit =f6ab0001=). Per-chromatic-strip count input (0-4); setting N regenerates the family as base ±N, repointing survivor references by lightness rank and leaving removed-step references on their now-gone hex. Also fixed the neutral-threshold curve to taper at both lightness ends (symmetric Munsell) so chroma-eased dark/light extremes keep their hue. #counttest gate covers count up/down + the survivor/removed reference behavior. -*** 2026-06-10 Wed @ 01:17:45 -0500 Base edit + retire ramp panel landed -Phase 5 (commit =9daeff15=). Editing a family base recolors the whole family (shared =regenFamilyInPlace= with the count control); editing a ground swatch writes the bg/fg assignment. The standalone ramp panel (button, panel, JS, CSS, #ramptest) is removed — fan a color via its column's count instead. #baseedittest gate covers base-edit recolor + reference follow + the bg-swatch edit. -*** 2026-06-10 Wed @ 01:17:45 -0500 Warnings, seeding, export, README close-out landed -Phase 6 (commit =c175e2be=). Export stays a flat palette and import needs no reconstruction (#roundtriptest: export→import→export byte-identical). =seedPkgmap= reads the flat palette unchanged. The too-similar warning stays on the full palette — the planned ramp-step exemption was dropped after analysis: ramp steps are a stepL apart (well above the ΔE threshold) so they never warn, and exempting same-family pairs would hide genuine near-duplicates (caught by #deltatest). README documents families, the ground strip, the count control/regenerate, removed-step references, and the ramp-panel removal. -** DONE [#B] theme-studio delete entire color column :feature:quick:solo:studio: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-13 -:END: -Add a column-level delete affordance to the palette. Deleting a normal color column removes the base color and every generated/imported tile in that column from the screen and from =PALETTE=. Ground remains pinned and non-deletable. Existing assignments that referenced removed tiles should follow the current deleted-color behavior: they remain on the old hex and appear as recoverable =(gone)= values rather than silently repointing. - -Acceptance notes: add a browser gate proving a column delete removes all entries with that stable =columnId=, leaves other columns alone, leaves ground non-deletable, and preserves any references to deleted hexes as gone values. - -Shipped 2026-06-13 in commit =2cf730d5=: normal column headers have a delete button, ground has no delete affordance, deleted names feed =lastGone= for recovery, and =#columntest= pins the behavior. -** DONE [#B] theme-studio palette ramps + contrast safety v1 :feature:studio: -CLOSED: [2026-06-13 Sat] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-10 -:END: -The v1 build from [[file:docs/theme-studio-palette-ramps-spec.org][theme-studio-palette-ramps-spec.org]] (Ready, Codex-reviewed). Two coupled features: a ramp generator (one base color → harmonized tonal ramp) and background-contrast safety (worst-case floor over a face's foreground set + safe-lightness guidance). - -All five phases + the README close-out landed 2026-06-09 (commits 1d51a332, 9da6c663, e7021bfe, 1d8b9f9e, 843bbf08, 23926837); =make theme-studio-test= green (78 node tests, 12 browser gates). Code-complete and self-verified. Remaining: the aesthetic and real-Emacs-fidelity sign-off under the Manual testing parent below (does a ramp harmonize, does the safe band read clearly, does a "safe" tint actually read behind real syntax). Mark this DONE once that passes. -Retired 2026-06-13: this parent is no longer active planning work. The useful pieces are already in the current tool, and later structural-column work replaced the standalone ramp workflow. -*** 2026-06-09 Tue @ 18:40:20 -0500 Ramp generator core landed -Phase 1 (commit =1d51a332=). =ramp(baseHex, {n, stepL, chromaEase})= in app-core.js → ={steps: [{hex, clamped, offset}], adjusted}= or ={steps: [], error: 'bad-hex'}=. Holds the OKLCH hue, steps lightness by =stepL=, quadratic chroma-ease toward the extremes, gamut-clamps each step; knobs clamp to range with the clamped knob named in =adjusted= (n=2/stepL=0.08/chromaEase=0.5 defaults). 10 node tests (mid/near-white/near-black bases, hue-hold, chroma ease, knob clamping, malformed hex), suite 55→65, =make theme-studio-test= green. The app-core integrity stripper now drops =import= lines too. -*** 2026-06-09 Tue @ 19:06:46 -0500 Ramp UI in palette landed -Phase 2 (commit =9da6c663=). A "ramp" button opens a panel that generates from the current color and previews the steps (named per source swatch, clamp badge on out-of-gamut steps); the n/stepL/chroma-ease controls default to 2/0.08/0.5. Click a step or "add all" to insert adjacent to the source in -n..+n order; name collisions skip (no overwrite), hex duplicates add with a flag. New #ramptest gate pins count, ordered insertion, collision skip, and the clamp badge. Verified headless + screenshot. -*** 2026-06-09 Tue @ 18:53:16 -0500 Foreground-set + floor + L_max core landed -Phase 3 (commit =e7021bfe=). =fgSetFor=, =floor=, =lMax= and the =COVERED_FACES= constant in app-core.js, all pure and explicit-state. fgSetFor returns {set:[{hex,label}]} or a structured reason ('out-of-scope'/'empty'); floor returns {ratio, limitingHex, limitingLabel}; lMax scans L from black to bracket the dark-side crossing then binary-searches it (tol 0.001), status ok/none/all/clamp. 13 node tests including the keyword-blue #67809c fixture and lMax's none/all/clamp branches. Suite 65→78, =make theme-studio-test= green. -*** 2026-06-09 Tue @ 19:06:46 -0500 Worst-case contrast readout landed -Phase 4 (commit =1d8b9f9e=). The five covered overlay faces show the worst-case floor over their foreground set (live syntax colors + default fg) and name the limiting foreground; a syntax-color edit repaints them. Out-of-scope faces keep the single-pair cell; an empty set reads "no fg set". Verdict is WCAG AA by default. New #contrasttest gate pins the readout, the keyword-blue limiting case, the single-pair fallback, and the no-set string. -*** 2026-06-09 Tue @ 19:06:46 -0500 Safe-lightness picker guidance landed -Phase 5 (commit =843bbf08=). The OKLCH picker gets a "safe for" selector over the covered faces; the C×L plane shades the lightness band too light to keep that face readable, with the L_max ceiling (via =lMax= at the current chroma) as the band's lower edge. A too-dark foreground shades the whole plane. New #safetest gate pins band-shows-for-covered-face and hides-when-none. Verified headless + screenshot. -*** 2026-06-09 Tue @ 19:06:46 -0500 README + test-surface close-out landed -Commit =23926837=. README documents the ramp controls and defaults, the worst-case floor / limiting foreground, the five covered faces, the safe-lightness guidance, and WCAG-drives-PASS-FAIL with APCA as a diagnostic; the browser-gate list is updated. =make theme-studio-test= carries all new node tests and the #ramptest/#contrasttest/#safetest gates. All acceptance criteria met. -** DONE [#B] theme-studio preview face mislinks (org, erc, flycheck) :bug:quick:solo:studio: -CLOSED: [2026-06-13 Sat] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-11 -:END: -Found by Craig 2026-06-11 during the manual-test walk (org case), then a full audit of all 20 bespoke previews confirmed three mislinks; the rest are clean: - -1. app.js:564 (org) — "Heading three" carries data-face org-headline-todo on a line with no TODO keyword; org-headline-todo's docstring says it applies to the part of the headline after the TODO keyword. Fix: add an org-todo keyword span mirroring the DONE line at app.js:563 (stars = org-level-3, keyword = org-todo, text = org-headline-todo). -2. app.js:765-766 (erc) — swapped: craig's own message text is erc-default-face and bob's is erc-input-face. erc-input-face is "ERC face used for your input"; swap them. -3. app.js:720 (flycheck) — swapped: brackets carry flycheck-delimited-error and the content flycheck-error-delimiter. In flycheck's delimiters highlighting style the delimiter strings get error-delimiter and the enclosed text gets delimited-error; swap them. - -Pin with a browser-gate assertion that these preview elements link the right faces (e.g. the org headline-todo span sits after an org-todo span; the erc my-message line uses input-face). -Fixed 2026-06-13: org heading three now has an =org-todo= keyword before =org-headline-todo=, flycheck delimiters/content are mapped to =flycheck-error-delimiter= / =flycheck-delimited-error= correctly, and ERC own/remote message text use =erc-input-face= / =erc-default-face=. Added =#previewlinktest= to pin all three mappings. -** DONE [#B] theme-studio spans should stop at bg and fg bounds :bug:quick:solo:studio: -CLOSED: [2026-06-15 Mon] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-13 -:END: -Done in commit 25e2d2ad: regenColumn ramps the dark side toward bg and the light side toward fg, bounded by the ground endpoints; pure black/white duplicates still skipped. Node tests + the #counttest bounds assertion pin it. -From the roam inbox: spanning a color should not generate colors beyond the current ground endpoints. No generated color should be darker than =bg= or lighter than =fg=. If the darker side hits =#000000=, do not create duplicate black tiles; if the lighter side hits =#ffffff=, do not create duplicate white tiles. Apply this to normal column spans and ground spans as appropriate, then pin with Node tests for the ramp/column plan and a browser gate for the palette UI. -** DONE [#B] vertico-prescient clobbers orderless filtering :bug:quick:solo: -CLOSED: [2026-06-13 Sat] -=modules/selection-framework.el:250= — =vertico-prescient-mode= defaults =vertico-prescient-enable-filtering t=, overriding =completion-styles= to prescient inside vertico sessions; the orderless config at :151 is dead exactly where it matters. Set =vertico-prescient-enable-filtering nil= — orderless matches, prescient sorts (and this resolves the dead =vertico-sort-function= finding in the buffer/window-libs child the other way around). From the 2026-06 config audit. -Fixed 2026-06-13: added =:custom (vertico-prescient-enable-filtering nil)= to the vertico-prescient use-package. Live daemon confirmed filtering nil + =completion-styles (orderless basic)= with the mode re-enabled — orderless matches, prescient sorts. No ERT test (framework defcustom, unexercisable in the stubbed-use-package harness); the in-session matching check is a VERIFY under Manual testing and validation. -** DONE [#C] Swap buffer delete/diff keys — destructive on capital :refactor:quick:solo: -CLOSED: [2026-06-13 Sat] -=modules/custom-buffer-file.el:515= binds =d= = =cj/delete-buffer-and-file= and =D= = =cj/diff-buffer-with-file=. Destructive commands should be the capital, and diff is the one hit often (when saving a buffer changed on disk). Swap them: =D= = delete, =d= = diff. From the roam inbox. -Swapped 2026-06-13: =cj/buffer-and-file-map= now binds =d= = =cj/diff-buffer-with-file=, =D= = =cj/delete-buffer-and-file=. keymap-lookup test added; live daemon re-bound by hand (defvar-keymap won't reassign a bound var on reload). Keypress check is a VERIFY under Manual testing and validation. -** DONE [#C] theme-studio: remove redundant reset button on package faces :refactor:quick:studio: -CLOSED: [2026-06-15 Mon] -Removed the per-row reset column (package faces was the only tier with one). It was not equivalent to the bulk reset next to "lock all": per-row reset one face, bulk resets every unlocked face. Single reset path now, matching syntax/ui tiers. Commit 7a7b1c16. -** DONE [#C] theme-studio: rename preview sample names :feature:quick:solo:studio: -CLOSED: [2026-06-15 Mon] -Renamed the preview personas Alice→Christine and Eve→Evan across the mu4e/signel/telega previews, with the mu4e header spacing adjusted to stay aligned. Commit 44128931. -** DONE [#C] theme-studio Rust + Zig language previews :feature:studio: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-11 -:END: -Requested by Craig 2026-06-11: add Rust and Zig code samples to the language previews (samples.py currently carries Elisp, Go, Python, TypeScript, Java, C, C++, Shell). Each sample should exercise the treesit token categories distinctive to its language (Rust: lifetimes, macros, attributes, traits; Zig: comptime, builtins, error unions), then regenerate theme-studio.html and extend the test surface. - -Shipped 2026-06-13: Rust and Zig were added to =samples.py= and =generate.py=, with generator tests pinning the language-specific category coverage. -** DONE [#C] theme-studio separate tile selection from name editing :feature:quick:solo:studio: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-13 -:END: -From the roam inbox: clicking a palette tile should have predictable intent. Single-click anywhere on a tile should select the whole color tile for editing/assignment. Double-clicking the name should enter name-edit mode with the cursor at the beginning of the name. Add browser-gate coverage for both paths so accidental single-click name edits do not regress. - -Shipped 2026-06-13: tile names are read-only until double-clicked; single-click selects the tile, and =#columntest= pins single-click vs double-click behavior. -** CANCELLED [#D] Desktop quick-capture: Note + Recipe types :feature:solo: -CLOSED: [2026-06-15 Mon] -Superseded 2026-06-15: the desktop popup was simplified to a single Task into the org-roam inbox (no Bug/Event, no template menu), so adding Note/Recipe types to the popup subset no longer applies. -** DONE [#A] theme-studio: remove the in-table preview column :refactor:studio: -CLOSED: [2026-06-15 Mon 20:57] -Drop the per-row preview from the assignment tables and rely on the live buffer preview alone. Requires auditing every assignment view so each face in the faces column has a situationally appropriate representation in the live preview. Craig wants a reusable project workflow for that periodic audit, created before the refit so it can drive the fix. From the roam inbox. -** DONE [#B] dupre-theme test failures :bug:test:quick:solo: -CLOSED: [2026-06-15 Mon] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-11 -:END: -Moot: dupre was retired (commit 4f0a8d80) and tests/test-dupre-theme.el was deleted with it, so the 4 failures no longer exist. The assertion-fix plan below is superseded. Remaining "dupre" mentions in the suite are benign (a fake theme symbol in test-face-diagnostic; a "dupre-fixture" JSON name in test-build-theme, a separate converter task). - -A full =make test= run (2026-06-07) is green across 516 of 517 files; the only failures are 4 tests in =tests/test-dupre-theme.el=, long pre-existing. Two root causes. For each, decide whether the palette or the test assertion is canonical, then fix the loser so =make test= goes fully green. - -Decided 2026-06-11 (Craig): #0d0b0a is the canonical background — the three drift assertions are stale, update them. org-todo stays the muted red-1 #a7502d — update the test's expected value. Both sides decided; this is now a pure assertion fix. - -*** TODO Background drift: 3 tests expect #151311, palette bg is #0d0b0a -=dupre-get-color-base= (test:46), =dupre-theme-default-face= (test:84), and =dupre-with-colors-binds-values= (test:62) all assert the default background is "#151311", but =themes/dupre-palette.el= defines =bg= as "#0d0b0a". The committed palette looks intentional, so the three assertions are likely just stale -- confirm #0d0b0a is the wanted background, then update the tests. - -*** TODO org-todo color mismatch: test expects #ff2a00, theme renders #a7502d -=dupre-theme-org-todo= (test:130) asserts the org-todo foreground is "#ff2a00" (intense-red), but the theme renders "#a7502d" (red-1). Design call: should org-todo be the bright intense-red or the muted red-1? Fix whichever side loses the decision. -** DONE [#B] reconcile-open-repos skips any repo with a dot in its name :bug:quick:solo: -CLOSED: [2026-06-15 Mon] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-13 -:END: -=modules/reconcile-open-repos.el:174= — discovery regexp ="^[^.]+$"= matches only dot-free names, so =~/code/mcp.el=, =capture.el=, =google-contacts.el=, =auto-dim-other-buffers.el= etc. are never reconciled while M-P still reports "Complete." Replace with =directory-files-no-dot-files-regexp= + a hidden-dir check; add a regression test with a dotted repo name. From the 2026-06 config audit. -*** 2026-06-13 Sat @ 11:01:44 -0500 Fixed: regexp swapped + hidden-dir check -=cj/find-git-repos= now iterates =directory-files-no-dot-files-regexp= (keeps dotted names, drops =.=/=..=) plus a =string-prefix-p "."= guard for hidden dirs. Regression test =test-find-git-repos-boundary-dotted-repo-name-found= (mcp.el/capture.el/plain-repo → 3 found); existing hidden-dirs-skipped test stays green; 11/11. Live daemon confirmed all six dotted repos under ~/code now discovered (mcp.el, gptel-mcp.el, capture.el, google-contacts.el, google-maps.el, auto-dim-other-buffers.el). Re-verified live 2026-06-15 (41 repos, 6 dotted); Craig confirmed. -** DONE [#B] theme-studio save button does not overwrite the current theme file :bug:studio: -CLOSED: [2026-06-15 Mon] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-13 -:END: -Resolved — Craig handled it 2026-06-15. -From the roam inbox: the =save= button currently behaves too much like =export=. The intended workflow is: after a theme file has been opened or saved once, pressing =save= or using the save keybinding overwrites that same file instead of downloading a fresh export. If browser security prevents overwriting a previously exported download without a file handle, make that limitation explicit in the UI and reconsider whether the separate save button should remain. This needs a small product decision around export-vs-save semantics before implementation. -** CANCELLED [#A] Global yes-or-no-p fset defeats every strong confirmation :bug:quick: -CLOSED: [2026-06-15 Mon 22:40] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-13 -:END: -=modules/system-defaults.el:203= =(fset 'yes-or-no-p 'y-or-n-p)= — verified live. Several modules deliberately chose yes-or-no-p as the strong tier for irreversible actions: shutdown/reboot (=system-commands.el:74=, whose comment explicitly says "so a stray RET/space can't trigger them"), "permanently destroy files" (=dwim-shell-config.el:804=), file overwrites (=custom-buffer-file.el:159,199=, =music-config.el:374=). The fset makes all of them single-keystroke — the two-tier design is dead. Drop the fset, or provide a real =cj/confirm-strong= (typed "yes") for the irreversible set. From the 2026-06 config audit. -Fixed 2026-06-13 (Craig chose the surgical option): added =cj/confirm-strong= to system-lib.el (binds =use-short-answers= nil for one =yes-or-no-p= call → typed "yes"); removed the redundant fset (kept =use-short-answers t= so benign prompts stay single-key); routed the 6 irreversible sites through it (shutdown/reboot, permanent-destroy, file overwrites). Note: the fset is baked into the running daemon and can't be cleared from Lisp, so the typed-"yes" tier goes live only after a daemon restart — manual confirm under the Manual testing parent. TDD; tests green. -** DONE [#B] Add Signal to the dashboard :quick:solo: -CLOSED: [2026-06-15 Mon] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-01 -:END: -** DONE [#B] ai-term adaptive side/bottom window placement :feature:quick:solo: -CLOSED: [2026-06-15 Mon] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-13 -:END: -The ai-term window should dock from whichever edge conserves more screen space, chosen at display time from the frame's aspect ratio: when the frame is wider than it is tall, dock from the right; when it is square or taller than wide, dock from the bottom. Compare the frame's pixel width against its height in the display-buffer rule to pick the edge. -** DONE [#B] auth-config: unguarded gpg-connect-agent call + compile-time require :bug:quick:solo: -CLOSED: [2026-06-15 Mon] -Fixed in cd95ea79: guarded gpg-connect-agent with cj/executable-find-or-warn; runtime require of user-constants. -From the 2026-06 config audit. =modules/auth-config.el:88= — bare =(call-process "gpg-connect-agent" ...)= in a =:demand t= :config signals file-missing and aborts init on machines without the binary; guard with =cj/executable-find-or-warn=. =auth-config.el:36= — =user-constants= is required only =eval-when-compile= but =authinfo-file= is read at load time; works from .el source, fails from standalone .elc. Use a runtime require (system-defaults.el:32-35 documents this exact trap). -** DONE [#B] Dashboard keybinding changes :quick:solo: -CLOSED: [2026-06-15 Mon] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-06 -:END: -On the dashboard, =g= should refresh the buffer (=dashboard-refresh-buffer=); =g= currently opens Telegram (=cj/telega=, dashboard-config.el:88), so move Telegram to another key. F1 (=cj/dashboard-only=) should also run a refresh at the end, so re-showing the dashboard always lands on fresh content. F1-refresh folded in from the roam inbox 2026-06-13. -** DONE [#B] eshell: visual-commands nested-list + xterm-color dead hook :bug:quick:solo: -CLOSED: [2026-06-15 Mon] -Fixed in de32ffbe: dolist visual-commands; xterm-color real hook name + filter wiring. -=modules/eshell-config.el:104= — =add-to-list= pushes one LIST into the flat string list =eshell-visual-commands=, so lf/ranger/htop/top never get a visual terminal (and the r→ranger alias garbles). dolist the strings. =:166= — =:hook (eshell-before-prompt-hook . ...)= gets "-hook" appended → registers on nonexistent =eshell-before-prompt-hook-hook=; and =xterm-color-filter= is never added to =eshell-preoutput-filter-functions= anyway while TERM advertises xterm-256color. Wire xterm-color fully per its README or drop it + the TERM override. From the 2026-06 config audit. -** DONE [#B] eww quick-add bookmarks split the store and break the default file :bug:quick:solo: -CLOSED: [2026-06-15 Mon] -Fixed in 7d58ccfb: dropped the dir-creating let-binding so quick-add shares the default store. -=modules/eww-config.el:116-126= — quick-add let-binds =eww-bookmarks-directory= to ~/.emacs.d/eww-bookmarks/ (creating a DIRECTORY at the path where the daemon's default store expects a FILE ~/.emacs.d/eww-bookmarks). After one quick-add, B reads an unreadable path and quick-added bookmarks are invisible post-restart. Drop the let-binding or setq the directory once in :config so both commands share one store. From the 2026-06 config audit. -** DONE [#B] Go: format key void-functions, go-mode :config never runs :bug:quick:solo: -CLOSED: [2026-06-15 Mon] -Fixed in 4038cf59: :commands (gofmt) autoloads gofmt so C-; f pulls go-mode and its :config. -=modules/prog-go.el:99,113-118= — .go maps to go-ts-mode so the go-mode package never loads, and =gofmt= isn't autoloaded in go-mode 1.6.0 — C-; f signals void-function, and the :config (exec-path += ~/go/bin, =gofmt-command "goimports"=) never executes. Wrapper that requires go-mode first (or autoload gofmt), move the setup to top level. From the 2026-06 config audit. -** DONE [#B] prog hooks mutate global state per buffer :bug:quick:solo: -CLOSED: [2026-06-15 Mon] -Fixed in 902290a4: electric-pair-local-mode in go/c/shell hooks; line-number setqs hoisted to top level. -From the 2026-06 config audit: =prog-go.el:64=, =prog-c.el:73=, =prog-shell.el:77= call global =(electric-pair-mode t)= from buffer setup hooks — one Go/C/shell buffer turns on pairing in org/text everywhere (python/webdev correctly use =electric-pair-local-mode=). =prog-general.el:79-80= — =display-line-numbers-type 'relative= setq/setq-default run from the hook AFTER the mode is enabled, so the first prog buffer of a session gets absolute numbers. Local-mode for the three; move the line-number setqs to top level. -The global electric-pair this turns on also paired "<" in org, stranding a ">" after "<"-key snippets (=#+end_src>=, broke cj-scan). That symptom is fixed separately (=d9c90e83=, an =electric-pair-inhibit-predicate= for "<"). This task remains the root fix: pairing should not be global at all. -** DONE [#B] Remove buffer-state cursor coloring :refactor: -CLOSED: [2026-06-15 Mon] -Removed cj/set-cursor-color-according-to-mode + the two cache defvars + the post-command/server-after-make-frame hook registrations from ui-config.el; cursor now uses the theme cursor face. Kept cj/buffer-status-state / cj/buffer-status-color in user-constants.el (modeline still uses them). Deleted tests/test-ui-cursor-color-integration.el (all cursor-function tests) and dropped the one cursor-function test from test-ui-config--buffer-cursor-state.el (kept its 6 classifier tests). Live daemon cleaned (hook removed, fn unbound, cursor reset). - -Craig directed removal (roam inbox, 2026-06-15): the cursor changing color by buffer state is confusing ("strange not knowing what your cursor should look like"). Remove cj/set-cursor-color-according-to-mode, the cj/-cursor-last-color / cj/-cursor-last-buffer defvars, and the post-command-hook + server-after-make-frame-hook registrations in ui-config.el, so the cursor uses the theme's cursor face. Keep the shared cj/buffer-status-state / cj/buffer-status-color classifier (the modeline buffer-name indicator still uses it). Before deleting tests/test-ui-cursor-color-integration.el and tests/test-ui-config--buffer-cursor-state.el, confirm which covers the shared classifier (keep) versus the cursor function (remove). Update the cursor header comment. This settles the earlier keep-vs-remove question: 7ccc3f5c's theme-driven rework is the thing to drop. -** DONE [#B] Split window opens the dashboard in the other window :feature:quick:solo: -CLOSED: [2026-06-15 Mon] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-10 -:END: -When splitting with C-x 2 (=split-window-below=) or C-x 3 (=split-window-right=), the new/other window should default to the =*dashboard*= buffer instead of mirroring the current buffer. Advise =split-window-below= / =split-window-right= (or rebind the keys) to select the dashboard in the freshly-created window. Keep point in the original window. -** DONE [#B] system-defaults: top-level server-start unguarded in batch :bug:quick:solo: -CLOSED: [2026-06-15 Mon] -Fixed in 79a38fe1: (unless noninteractive ...) guards on server-start and the custom-file temp. -=modules/system-defaults.el:140= — raw module load under =--batch= (make validate-modules on a machine with no daemon socket) starts a server from a batch process; the suite only passes because the testutil stubs it. Wrap in =(unless noninteractive ...)= — the repo's established guard for this defect class; same guard stops the =custom-file= =make-temp-file= at line 104 littering temp files per batch load. From the 2026-06 config audit. -** DONE [#C] theme-studio: extract a ground() helper for the repeated bg/fg literal :refactor:quick:solo:studio: -CLOSED: [2026-06-15 Mon] -Done in de6fccc9 as groundPair() (named to avoid the local `ground` destructure collision; 32 call sites). -The literal {bg:MAP['bg'],fg:MAP['p']} repeats 21 times across app.js and palette-actions.js, plus more in the browser gates. Extract a ground() helper that returns it and replace every call site. Purely mechanical, no behavior change; the node tests + browser gates are the safety net. From the 2026-06-15 refactor review. -** DONE [#C] cj/undo-kill-buffer skip-visited uses delq (eq) on path strings :bug:quick:solo: -CLOSED: [2026-06-15 Mon] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-13 -:END: -=modules/ui-navigation.el= — the visited-file filter calls =(delq buf-file recently-killed-list)= where =buf-file= is a fresh string from =expand-file-name=, never =eq= to the =recentf-list= entries, so already-open files are never skipped (the skip logic is dead). Use =delete= (equal-based). Found 2026-06-12 while fixing the off-by-one above; the two bugs cancel exactly when one file is open, which is why it went unnoticed. -** DONE [#B] C-s C-s vertico-repeat path never works :bug:quick:solo:next: -CLOSED: [2026-06-15 Mon] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-13 -:END: -Fixed in b62af096 (prior session): vertico-repeat-save added to minibuffer-setup-hook so a session exists for the second C-s. Re-verified live 2026-06-15: the hook is installed and cj/consult-line-or-repeat is defined. -=modules/selection-framework.el:263= — =cj/consult-line-or-repeat= calls =vertico-repeat= on the second consecutive C-s, but nothing adds =vertico-repeat-save= to =minibuffer-setup-hook= (grep: zero hits config-wide), so it always signals "No Vertico session". Add the hook next to the vertico use-package block. From the 2026-06 config audit. -*** 2026-06-13 Sat @ 10:59:52 -0500 Fixed: vertico-repeat-save hooked -Added top-level =(add-hook 'minibuffer-setup-hook #'vertico-repeat-save)= after the vertico use-package block (placed top-level, not inside use-package, so the stub-use-package test exercises it; =vertico-repeat-save= is autoloaded, deferring the load to first minibuffer). New test asserts hook membership; 5/5 green; evaled into the live daemon (=:on-hook= now t). Awaiting Craig's confirm → DONE. -** DONE [#B] dirvish M (mark all files) marks every other file :bug:quick:solo:next: -CLOSED: [2026-06-15 Mon] -Rewrote cj/dired-mark-all-visible-files with dired-get-filename + file-directory-p and an if/else so dired-mark's own point-advance isn't doubled by forward-line. Added real-dired marked-count tests; retired the now-dead regex helper and its fake-buffer mock test. -=modules/dirvish-config.el:218= — =dired-mark= advances point to the next line itself; the loop's extra =forward-line 1= then skips it, so consecutive files are marked alternately. Live mis-marking on a key that feeds batch operations (delete/copy on marked files) — data-loss adjacent. Drop the manual forward-line when a mark was made (or =dired-unmark-all-marks= + mark dirs + =dired-toggle-marks=). The trivial line-predicate helper is tested; the loop isn't — add the marked-count test. From the 2026-06 config audit. -** DONE [#B] heavy-box comment inserts non-comment lines :bug:solo:next: -CLOSED: [2026-06-15 Mon] -cj/--comment-heavy-box now prefixes the interior empty/text lines with the comment char + suffix (like cj/--comment-box) so they stay valid comments in line-comment languages, and gained the min-length guard (small/negative widths now error cleanly instead of hitting make-string). The two characterization assertions that pinned the broken bare-* lines were updated to the corrected output. -=modules/custom-comments.el:427= — =cj/--comment-heavy-box= interior/empty lines carry no comment prefix, so in line-comment languages (elisp, Python) C-; C h injects syntax-breaking bare =*...= lines. The existing test characterizes the broken output (asserts =^\*.*\*$=). Prefix interiors like =cj/--comment-box= does; add the missing min-length validation (negative width hits make-string with a raw error); fix the test to assert corrected output. From the 2026-06 config audit. -** DONE [#B] Scratch buffer background a shade lighter than default :feature:next: -CLOSED: [2026-06-15 Mon] -cj/scratch-apply-background remaps the *scratch* default background lighter (cj/scratch-background-lighten percent, default 5) via color-lighten-name, applied on the existing emacs-startup-hook. The percent is a tunable defcustom. Pure helper tested for the display-independent contract; the lightening itself is display-dependent (color-name-to-rgb), verified live in the daemon. -Make *scratch* just-noticeably lighter than the normal background so it reads as the scratch buffer. Simplest is a buffer-local face remap on *scratch*; Craig is fine routing it through org-faces if a theme hook is wanted. The exact lightening delta is an aesthetic call to tune visually. From the roam inbox. -** DONE [#C] theme-studio: drop the too-similar-colors message below the palette :refactor:studio:next: -CLOSED: [2026-06-15 Mon] -Removed the renderPaletteWarnings box (function, #palwarn element, .palwarn CSS) and its #deltatest browser gate. The per-chip nearest-ΔE tooltip stays (paletteWarnings still computes `nearest`), so the same info remains reachable inline. -Remove the too-similar-colors warning under the palette display. It isn't useful there; the same information is reachable per-assignment through the inline contrast field. From the roam inbox 2026-06-15. -** CANCELLED [#C] theme-studio: raise the max color spans to 5 :feature:studio: -CLOSED: [2026-06-15 Mon 22:52] -Increase the palette's maximum span count to 5, for a smoother, slower transition across a color. From the roam inbox. -*** CANCELLED which control caps below 5 — current maxes are all 8 -CLOSED: [2026-06-15 Mon 22:52] -On review the per-column span control, the ground span control, and regenColumn all already cap at 8 (well above 5), so there's no sub-5 limit to raise. Either 5 is already reachable, or the intended control is a different one (e.g. the generator emits base-only columns — spanCount is hardcoded 0 in palette-generator-ui.js). Need Craig to point at the control he's hitting. -** DONE [#C] Page-down in a long completing-read selects and dismisses the list :bug:next: -CLOSED: [2026-06-15 Mon] -Bound <next>/<prior> to vertico-scroll-up/down in vertico-map, so Page-Up/Down page the candidate list instead of falling through to history (which selected and dismissed). Verified live (use-package :bind isn't reachable under make test). -In a very long completing-read (vertico), Page-Down selects an item and the list vanishes instead of paging, forcing a cancel. Investigate the completion stack's next-page handling; likely needs vertico-scroll-up / vertico-scroll-down bound in vertico-map. From the roam inbox. -** CANCELLED [#C] theme-studio reconsider the JSON show button :feature:quick:studio: -CLOSED: [2026-06-15 Mon 22:56] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-13 -:END: -From the roam inbox: the =show= button for the raw JSON export does not fit the main theme-design workflow, but it may still be useful for debugging. Decide whether to hide it behind a debugging affordance, rename it, or remove it. Quick UI cleanup once the desired debugging surface is chosen; not marked solo because it is a workflow preference call. -** DONE [#B] TTY-accessible personal C-; keymap :feature:solo:quick: -CLOSED: [2026-06-16 Tue] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-05 -:END: -Done 2026-06-16: keybindings.el binds cj/custom-keymap under C-c ; alongside C-;, so the whole command family is reachable in a terminal frame with the same leaf keys (the single-point fix the body describes; no env-terminal-p branch). Audited every leaf key registered into the family — all are TTY-safe (letters, digits, punctuation, SPC, and arrow keys under C-; b, which terminals do encode); no C-RET, super, or hyper bindings, so nothing needed remapping. TDD: tests/test-keybindings-tty-mirror.el (3 tests, both prefixes share one map); full suite green; live-reloaded and confirmed C-c ; resolves to the family in the daemon. Commit pending. TTY-frame sign-off is a VERIFY under Manual testing and validation. -The personal prefix =C-;= (Control-semicolon) is GUI-only — terminals can't encode it, so the entire custom command family (=C-; g= calendar, =C-; a= AI, =C-; S= Slack, =C-; O= org, =C-; M= Signal, =C-; L= pearl, =C-; j= jump, …) is unreachable in a terminal frame (=emacsclient -nw=, Emacs inside vterm/tmux). Surfaced 2026-06-03 out of the pearl =C-; L= prefix discussion. - -Goal: keep =C-;= in GUI and add a TTY-typable mirror prefix so the same leaf keys work in a terminal. The fix is a single point: =modules/keybindings.el= defines =cj/custom-keymap= once, binds it globally with =(keymap-global-set "C-;" cj/custom-keymap)=, and every module registers into it via =cj/bind-prefix= / =cj/bind-command=. Binding that one keymap under a second prefix mirrors the whole family for free — no per-module edits. - -Easy prefix candidates (home-row-leaning, TTY-safe), same leaf keys under each: -- =C-c ;= (recommended) — keeps the semicolon mnemonic; =C-c= is the standard user prefix and always TTY-encodable, =;= is home row. =C-; L= becomes =C-c ; L=, zero leaf-key relearning. Bind it unconditionally alongside =C-;= so both GUI and TTY reach the identical map — no =env-terminal-p= branch needed. -- =C-c SPC= — easy reach, but collides with =org-table-blank-field= (=C-c SPC=) inside org buffers. -- Bare =C-c <leaf>= (the literal "C-c L" idea) — rejected: =C-c= is shared with org (=C-c l= = =org-store-link=, confirmed live), the LSP prefix (=lsp-keymap-prefix "C-c l"=), and pdf-view; binding the whole family under bare =C-c= would shadow/conflict with those. - -While in here, audit individual leaf chords for other non-TTY keys (any =C-RET=, super/hyper bindings — terminals can't send super/hyper either) and note or remap them. Verify the result in an actual =emacs -nw= / =emacsclient -nw= frame, not just GUI. Relates to the standing "org-mode keybinding consolidation" reminder. - -** DONE [#C] theme-studio: open with the palette collapsed to base colors :feature:studio:next: -CLOSED: [2026-06-16 Tue] -Every time theme-studio opens, the palette shows all colors including the span tints. Instead it should open showing the base colors only, and the user expands the spans by clicking the left-side arrow menu. From the roam inbox 2026-06-16. Craig: "just do it. :)" -Done 2026-06-16: initApp sets paletteShowFull=false before the first render, so the studio opens collapsed (arrow ▶); the existing toggle expands the spans. New #paldefaulttest gate asserts the opening collapsed state; #counttest and #paltoggletest now opt into full mode explicitly since they assert span tiles. Full suite green. -** DONE [#C] theme-studio: realistic markdown-mode preview :feature:studio: -CLOSED: [2026-06-16 Tue] -markdown-mode fell back to the generic preview (face names in their own colors). Built renderMarkdownPreview (app.js): a realistic README exercising 28 markdown faces in context (front matter, H1-H3, bold/italic, inline + fenced code with a language tag, links + bare URLs, lists + GFM checkboxes, blockquote + footnote, table, hr, strikethrough, highlight, math, inline HTML, comment). Routed via a PREVIEW_KEYS map in app_inventory.py (markdown-mode -> markdown). #mdtest gate validates every data-face is a real markdown face; full theme-studio suite green. Commit =0682b24f=, pushed. Visual sign-off is a VERIFY under Manual testing and validation. -** DONE [#C] cj/gptel-switch-backend reintroduces the string-model crash :bug:quick:solo: -CLOSED: [2026-06-16 Tue] -=modules/ai-config.el:272= — =(setq gptel-model model)= with the raw completing-read STRING — the documented wrong-type-argument-symbolp modeline hang (CLAUDE.md gotcha), reachable from C-; a B today. =cj/gptel-change-model= (C-; a m) already does backend+model switching and interns correctly. Intern here, or delete switch-backend and keep one command. From the 2026-06 config audit. - -Fixed 2026-06-16: added pure helper =cj/gptel--model-to-symbol= (mirrors =cj/gptel--model-to-string=) and coerced the completing-read value through it before =(setq gptel-model ...)= in =cj/gptel-switch-backend=. 7 ERT tests for the helper (=tests/test-ai-config-model-to-symbol.el=); the existing switch-backend test (=tests/test-ai-config-gptel-commands.el=) updated from asserting the raw string to asserting a symbol + a =symbolp= crash-guard. Full suite green; helper and the redefined command are live in the daemon. Chose "intern" over deleting the redundant command — the dedup is the VERIFY below. - -** DONE [#C] theme-studio picker panel blends into the page :bug:quick:solo:studio: -CLOSED: [2026-06-16 Tue] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-11 -:END: -Craig, 2026-06-11 manual-test walk: the color picker's background is hard to distinguish from the page background. Give the picker panel a visibly distinct background or a highlighted border so it stands out. Pin with a gate asserting the picker element carries the distinct style. -Done 2026-06-16: the picker now carries the gold accent border (#e8bd30) and a lighter background (#1f1c19 vs the page's #0d0b0a). The #pickertest gate asserts the accent border and a per-channel background lift of ≥12 over the page, so the distinction can't silently regress. - -** DONE [#A] ai-term: selecting an agent kills the whole Emacs process :bug: -CLOSED: [2026-06-18 Thu] -Root cause: a ghostel native-module regression in 0.35.0-0.35.2 (all shipped 2026-06-16..18), not anything in this config and not display-backend related. Reproduced down to a plain =M-x ghostel= in a GUI frame (not ai-term-specific); under gdb it is a clean =exit()= from the PGTK main loop (not a SIGSEGV — hence no core ever produced). Upstream filed it the same day: dakra/ghostel #422 (Linux/glibc — the native PTY path now spawns worker threads, and a SIGSETXID handler calls malloc while the main thread holds the glibc arena lock → crash/hang on =M-x ghostel= in a GUI daemon, exactly our case) and #423 (macOS — recursive os_unfair_lock via =run_window_change_functions=). =ghostel-comint= is not a usable workaround (no cursor positioning, can't run the Claude TUI). - -Fix: pinned ghostel to the last pre-rework build — =ghostel-20260604.2049=, commit 5779a2adceb2, native module 0.33.0 — installed directly into =elpa/= and held there by =:ensure= (won't auto-upgrade). See =modules/term-config.el=. Verified: the exact crash scenario (open a ghostel buffer in a PGTK GUI frame) now survives; ghostel buffer healthy; terminal test suites green. - -Also done this session: =ghostel-module-auto-install= set to =download= (the original "doesn't install" fix); zig 0.15.2 pinned at =/usr/local/bin/zig= as the compile fallback (Arch ships 0.16 which can't build ghostel); archsetup notified of the zig pin. - -*** 2026-06-18 Thu @ 16:33:56 -0500 ai-term confirmed working after the 0.33.0 pin -Craig confirmed in normal use — opening/selecting ai-terms works with no whole-process crash ("everything seems to be working as normal now"). Headless reproduction (open a ghostel buffer in a PGTK GUI frame) had already survived; this is the live-hands confirmation. -** DONE [#C] Reproducible face-coverage generator + coverage diff :feature:solo: -CLOSED: [2026-06-18 Thu] -Built: =face-coverage-dump.el= + =face_coverage.py= + =make face-coverage= / =make face-coverage-diff=. Validated by regenerating and diffing against the hand-built worklist (headings identical; only an intro line and one sharper description differ). Compare mode reports newly-covered / newly-present / disappeared / per-tier deltas. Unrecognized faces route by defface source (elpa -> own package bucket, built-in -> emacs-general child), so a newly-loaded package self-buckets. - -Known edge: a new package whose face prefix collides with an existing family name (e.g. =org-modern= faces start with =org=) folds into that family's bucket instead of getting its own, because the family match wins before the source fallback. Fix when it bites: add the package's prefix to =EXTRA_FAMILIES= in =face_coverage.py=. - -=scripts/theme-studio/face-coverage.org= is hand-regenerated by a throwaway /tmp script each time. Commit a self-contained generator so the worklist regenerates with one command, plus a diff that names what coverage changed between runs. - -Generator — two pieces plus a Makefile target: -- =face-coverage-dump.el= — batch elisp run via =emacsclient= against the live daemon (captures actually-loaded packages), with an =emacs --batch -l init.el= fallback for a clean checkout. For every face in =(face-list)= emit name, first-line docstring, and =(symbol-file f 'defface)=. One JSON/TSV out. -- =face_coverage.py= — read that dump plus the studio's managed set (font-lock map from =build-theme.el=, =UI_FACES= from =generate.py=, =package-inventory.json=); classify each face core/general/package by where its defface lives (=/usr/share/emacs= = built-in, =elpa= = package); group; write =face-coverage.org= with the TODO/DONE tree, =[d/t]= cookies, per-face docstrings, and per-bucket descriptions (group-documentation / package summary). -- =make face-coverage= runs both and writes the file. - -Carry over the manual logic already worked out: the CORE_HINT core-face set; the subsystem/package family buckets (including abbrev, which-func, git-gutter, git-commit, twentyfortyeight, yas, edit-indirect); the erc-ansi and =bg:erc=/=fg:erc= routing; and the separator-aware prefix match (=-=, =:=, =/=). - -Compare mode (=make face-coverage-diff=): -- Parse the committed (HEAD) =face-coverage.org= and the freshly generated one into face→state maps via =^\*+ (TODO|DONE) name=. Report newly covered (TODO→DONE), newly present (new package or Emacs upgrade), disappeared (package removed), and net coverage with per-tier deltas. -- =git diff face-coverage.org= already gives the raw line delta; this is the friendlier summary. -- Optional: append a dated =covered/total= line to a small coverage-log for progress over time. - -Dump from the live daemon by default (reflects the packages actually run); the batch fallback won't see lazily-loaded packages until required. -** DONE [#C] todo.org org-lint follow-ups :refactor: -CLOSED: [2026-06-20 Sat] -From the lint-org sweeps (2026-06-15, refreshed 2026-06-20). Resolved 2026-06-20: the misplaced-heading false positive was reworded (the bug-capture task's prose quoted heading-like "* TODO" strings), and the broken link was repointed from the missing =~/code/signel/todo.org= to =~/code/smoke/todo.org= (smoke is the evolved Signal package). The obsolete-properties-drawer entries no longer reproduce under a full org-lint pass. Both lint-org --check and the built-in org-lint now report zero. -** DONE [#B] F9 toggle collapses a 3-window layout to 2 :bug: -CLOSED: [2026-06-20 Sat] -Fixed 2026-06-20 (option 1 — reversible toggle, Craig's call). In a 3+ window layout where -the agent had its own split, toggle-on reused the working window at the bottom edge, -displacing its buffer and collapsing three windows to two. Added a flag -(=cj/--ai-term-last-toggle-deleted-split=) set when toggle-off delete-windows the agent's own -window; =cj/--ai-term-reuse-edge-window= consumes it and falls through to a fresh re-split, so -the agent returns to its own window and the others are untouched. The flag only changes the 3+ -window case (2-window slot-reuse unchanged). TDD regression -=test-ai-term--reuse-edge-window-3win-toggle-restores-own-window=; full =make test= green; -live-reloaded. Commit 64916462. GUI sign-off is a VERIFY under Manual testing and validation. -** DONE [#B] Codebase refactoring program — remaining batch :refactor:solo: -CLOSED: [2026-06-20 Sat] -Complete 2026-06-20: all 13 scan findings addressed across the day's sessions (see -=.ai/sessions/= for the logs). 5 medium extractions + 2 big single-file refactors + -6 theme-studio items including the browser-gates harness rewrite. The only item not -done is the item-8 plan() factory, consciously skipped as premature abstraction -(heterogeneous call sites — see "Remaining — item-8 plan() factory" below). -The original scan: full-codebase 8-agent fan-out over modules/ + scripts/theme-studio/, -one focused refactor per commit, won't-do items excluded. - -*** Working protocol (apply to every item) -- TDD: write/keep a failing-then-green test; harvest new test seams the refactor opens. -- Behavior-preserving only. If a "dedup" would delete a real test seam or couple - dissimilar code, SKIP it and record why (see skips below). -- Per refactor, verify in this order, then commit + push (no-approvals mode): - 1. =make test-file FILE=<basename.el>= for touched + new tests. - 2. =make validate-modules= (loads all 123 modules; catches load/paren errors). - 3. Init-launch smoke on a throwaway daemon: =emacs --daemon=cj-sNN=, then - =emacsclient -s cj-sNN -e '(emacs-pid)'= to capture the PID, check - =(length features)= = 807 and no init errors in the log, then kill by that - PID (the emacsclient kill-emacs is flaky; pkill -f 'daemon=cj-sNN' - self-matches its own shell — kill the captured PID). - 4. Live-reload the edited module into Craig's running daemon - (=emacsclient -e '(load "/home/cjennings/.emacs.d/modules/<m>.el")'=); skip - the live reload for big use-package modules whose :config restacks (verify via - the fresh smoke daemon instead, as with mail-config). -- Tab-heavy files: =sed -n 'A,Bp' FILE | cat -A= to get exact bytes before an Edit; - write NEW code in the documented 2-space style. -- Shared asset already created: =cj/format-region-with-program= in system-lib.el - (the run-a-formatter-over-the-buffer helper). Reuse it for any further - format-region duplicates. - -*** DONE — medium extractions (2026-06-20 afternoon) -All five shipped: calibredb-epub nov re-render/centering helpers (fccf29b0); -ai-term toggle-off teardown + working-buffer swap (62fee96b); calendar-sync -per-event exception parser (23f405b4); dirvish playlist-target resolution -(a1ca2fb0); custom-case per-word title-case decision (4cc9ca0b). - -*** DONE — big single-file + theme-studio (2026-06-20 afternoon, no-approvals run) -Both big single-file items shipped: dwim-shell branching command builders -(f93b4615); custom-comments divider/box generator dedup (42f0c88a). Five of the -six theme-studio items shipped: face_coverage path_kind (9a52370b), -capture-default-faces condition_matches unify (28b4d1cf), dropdownRowTextColor -delete (10a56789), test-file inline-integrity dedup — subTest loop + shared -inline-strip.mjs (13969c70), generate.py lazy _build()/__getattr__ (6df4ebdc), -browser-gates assertPreviewFaces for the 3 preview gates (5627f137). - -*** DONE — browser-gates harness rewrite (with Craig's go-ahead, 2026-06-20) -- =gate(id, body)= helper (05697e83): the 38 standard gates' ok/notes/A + title + - result-div boilerplate, note format standardized to " fails=". Each call site keeps - its literal =location.hash==='#NAMEtest'=. 6 custom gates stay inline. First automated - attempt deleted gates (a closing-finder spanned boundaries) — caught by a gate-count - guard, reverted, redone anchored on each gate's unique =d.id=. Verified all 44 green + - a forced A(false) in a converted gate still FAILs. -- =withSavedState(keys, body)= (a473aa7c): wraps the 7 restore-nothing gates, scoped to - the globals each mutates; JSON-clone snapshot + finally-restore (structuredClone threw - on the studio objects — caught by the gate run as "no verdict", switched to JSON like - the gates' own local saves). The 14 self-restoring gates left as-is. Verified 44 green, - restore round-trip holds, broken assertion in a wrapped gate still FAILs. - -*** Remaining — item-8 plan() factory (deferred, low value) -The =plan(overrides)= factory for the ~30 planPaletteGenerator calls (test-app-core.mjs -+ test-palette-generator-core.mjs) was deferred. The calls pass heterogeneous options -(scheme/accentCount/sourceMode/vibe/intent vary per call); a factory only dedups the -constant spanCount:0/rng and would hide which options each test actually exercises — -premature abstraction over varying calls. The other two item-8 parts (subTest loop + -shared stripExports) shipped in 13969c70. - -*** WON'T-DO (do not re-attempt — assessed and rejected) -- theme-studio buildTable/buildUITable/buildPkgTable merge: genuine per-tier divergence - (column order, syntax dual fg/bg dropdowns, ui preview cell, pkg nd markers) + the - =.cells[N]= positional sort coupling make a unified builder MORE complex than the - three explicit ones. Close as won't-do. -- Cross-language test overlap (browser-gates preview gate vs test_generate.py - PackageFaceCoverage): don't merge — would couple a fast Python test to a headless - browser run. A one-line comment in each noting the split is the most that's worth it. - -*** Skipped this run (with reasons — don't redo) -- eshell-config ssh-alias "merge the two helpers": =cj/--eshell-ssh-alias-commands= is - a deliberate pure/effectful split with 3 dedicated tests; merging deletes the seam. -- prog-*-setup boilerplate: only python+webdev share the full pattern; shell/c/elisp/ - common-lisp differ materially. A keyword-arg helper would be less readable. No - premature abstraction. -- erc join-command =cj/erc--ensure-active-connection= extraction: nesting-only on - untestable UI (call-interactively/switch-to-buffer), no test seam, risky tab-rewrite. -- coverage-core =simplecov-executable-lines= vs =parse-simplecov= clone: borderline - MEDIUM, differs only by a =(> hits 0)= predicate; parameterize with a keep-line-p - only if revisiting. Low priority. -** CANCELLED [#A] calendar-sync drops final occurrences, resurrects cancelled meetings :bug:solo:next: -CLOSED: [2026-06-20 Sat 22:51] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-13 -:END: -Needs from Craig: a real .ics fixture (or two) that reproduces both symptoms — a recurring event missing its final occurrence, and a cancelled meeting that reappears. This is RFC-5545 recurrence handling (RRULE/UNTIL/EXDATE/STATUS:CANCELLED); I won't guess-patch the parser without a failing case to test against. Drop a sanitized .ics and I'll write the characterization test + fix. -RFC 5545 conformance holes in =modules/calendar-sync.el=, all agenda-visible (from the 2026-06 config audit): -- =:973,1015,1024= — UNTIL treated as exclusive (strict =calendar-sync--before-date-p=); RFC and Google make it inclusive, so the LAST instance of every UNTIL-bounded series vanishes. Tests assert loose count ranges, so it's unpinned. Allow equality. -- =:578= — comma-separated EXDATE lists (Google emits them) never parse; the exclusion drops silently and cancelled occurrences reappear on the agenda. Split on "," before parsing; no comma-case test exists. -- =:902= — timed events without DTEND render as all-day (time lost); multi-day all-day spans collapse to one day (end date unused, exclusive-DTEND unhandled). Emit start-time-only stamps and org date ranges. ------ - -2026-06-20 Sat @ 22:52:51 -0400 Can't reproduce. closing -** DONE [#A] Native compilation disabled config-wide; GC at stock 800KB :bug:next: -CLOSED: [2026-06-20 Sat] -Both fixed 2026-06-20. =early-init.el:69= was =(setq native-comp-deferred-compilation nil)= — the obsolete alias of =native-comp-jit-compilation= — which turned JIT native-comp OFF entirely (not "synchronous"); replaced with =(setq native-comp-jit-compilation t)= + =native-comp-async-report-warnings-errors 'silent=. The old "Selecting deleted buffer" async race was an Emacs 28/29 issue; this is 30.2. GC: dropped the early-init post-startup restore to stock 800KB and the system-defaults minibuffer setup/exit hooks, replaced with gcmh (idle-delay 'auto, 1GB high threshold) — keeps the threshold high during activity, collects on idle. Verified via a clean throwaway-daemon launch (native-comp-jit t, gcmh-mode t, no backtrace) and a batch proof of gcmh's threshold cycle; applied live to the running daemon. Restart confirmation filed under Manual testing and validation. -** DONE [#C] Dirvish: free D for hard-delete, move duplicate :feature:quick:next: -CLOSED: [2026-06-20 Sat] -Decided with Craig 2026-06-20: remove delete-to-trash entirely, bind =d= = =cj/dirvish-duplicate-file= and =D= = =cj/dirvish-hard-delete= (sudo rm -rf after a =yes-or-no-p= naming the exact targets). Built in =modules/dirvish-config.el= (=cj/--dirvish-hard-delete-command= pure builder + =cj/dirvish-hard-delete= command; keymap =d=/=D= swap). 4 ERT tests for the command builder; full suite green; live-reloaded into the daemon (=dirvish-mode-map= =d=/=D= rebinding confirmed). Manual keypress + sudo-flow check filed under Manual testing and validation. -** DONE [#C] Pull a fullscreen terminal window away with C-; b + arrow :feature:next: -CLOSED: [2026-06-20 Sat] -Decided with Craig 2026-06-20: when the selected window is the sole window, =C-; b= + arrow keeps that window on the arrow's edge and slivers =other-buffer= in on the opposite side (=minimize-window=, so the current window keeps almost the whole frame), focus staying put; each further arrow then shrinks it step by step via =windsize=, reading the same as resizing an existing split. Generalizes to any sole window, not just terminals — resize was a no-op there before. Built in =modules/ui-navigation.el= (=cj/window-pull-side= pure mapping + =cj/window--pull-away= + a =one-window-p= branch in =cj/window-resize-sticky=). ERT tests for the mapping and both sticky paths; geometry verified in a headless frame (down -> terminal 37/40 at the bottom, reveal 2 lines slivered on top via window-min-height=1, windsize-down then steps it down); full suite green; live-reloaded into the daemon. Refined from a first cut that split toward the arrow and jumped to 50%, per Craig's feedback. Manual gesture check filed under Manual testing and validation. -** DONE [#B] Migrate All Terminals From Vterm to Ghostel -CLOSED: [2026-06-20 Sat 22:50] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-04 -:END: -Replace vterm with ghostel (libghostty-vt) as the single terminal engine across every workflow, and rename ai-vterm → ai-term. References: [[file:docs/2026-05-25-emacs-terminal-comparison.org][docs/2026-05-25-emacs-terminal-comparison.org]] (vterm vs eat vs ghostel research); migration spec [[id:b54c94a0-d762-4b41-afd7-cf5593ce6675][docs/specs/vterm-to-ghostel-migration-spec-implemented.org]] (READY; external review incorporated 2026-06-04, D1-D7 agreed). Build in 5 phases (0-4); see the spec's Implementation tasks block. - -Decisions D1-D7 are settled in the spec's Agreed-decisions section. Build order below; each phase stays green (suite + byte-compile) at every step. - -*** 2026-06-20 Sat @ 22:49:41 -0400 Follow-up: theme ghostel ANSI faces in dupre -D2 — set the 16 ghostel-color-* + ghostel-default faces in dupre-faces/palette. -Roam-inbox note (2026-06-14): theme-studio assignments don't reach ghostel — it paints from its own ANSI palette, not the theme. Also investigate ghostel's property-file color mechanism as an alternative and surface the options for working with that limitation. - -*** 2026-06-20 Sat @ 22:50:28 -0400 CANCELLED [#B] Follow-up: evaluate ghostel-eshell + ghostel-compile -CLOSED: [2026-06-20 Sat 22:49] -D3 — ghostel-eshell as eshell visual backend; ghostel-compile against F4 dev-fkeys. - -*** 2026-06-20 Sat @ 22:50:32 -0400 DONE [#B] Investigate ghostel selection/highlight color -CLOSED: [2026-06-20 Sat 22:50] -Look at how selected text is highlighted in a ghostel buffer — the region face in =ghostel-copy-mode= and any live selection — surfaced during the copy-mode debugging. Check whether the highlight is legible against the dupre background and consistent with the rest of the config; if it needs theming, fold it in with D2 (theming the ghostel faces in dupre). - -*** 2026-06-04 Thu @ 23:57:09 -0500 Phase 0 done: characterization baseline green -=make test= green except the 5 documented pre-existing failures (4 test-dupre-theme, 1 test-init-module-headers), none terminal-related. Characterization coverage already present + green for all six must-survive behaviors: vterm-toggle--dispatch/display/buffer-filter, vterm-tmux-history, ai-vterm--show-or-create/launch-command/f9-in-vterm, ui-config--buffer-cursor-state + vterm-copy-mode-cursor, dashboard-config-launchers. Add a characterization test before any behavior change in later phases if a gap appears. - -*** 2026-06-05 Fri @ 00:38:34 -0500 Phase 1 done: ghostel + term-config.el -=modules/term-config.el= written (full port of vterm-config: tmux history/copy-mode-dwim preserved via process-tty-name + ghostel-send-string; F12 toggle + display rule + geometry; cj/term-map C-; x menu → ghostel commands; which-key "terminal menu"; ghostel-max-scrollback 10MB; C-; added to ghostel-keymap-exceptions; F12 + C-; in ghostel-mode-map; use-package ghostel guarded per D6). Dropped: mouse-wheel SGR forwarding, vterm-timer-delay hacks, copy-mode cursor hook, goto-address hook. ghostel installed into elpa (MELPA + auto-downloaded native module). Tests: test-term-toggle--{dispatch,display,buffer-filter} + test-term-tmux-history (16) ported with a ghostel stub in testutil-ghostel-buffers; all green. - -*** 2026-06-05 Fri @ 00:38:34 -0500 Phase 2 done: ai-vterm→ai-term on ghostel -=modules/ai-vterm.el= → =modules/ai-term.el=: 6 vterm call sites swapped to ghostel (buffer named via let-bound ghostel-buffer-name + pinned ghostel-buffer-name-function so OSC titles don't rename agent buffers); F9/C-F9/M-F9 on global + ghostel-mode-map; refuse-in-terminal guard removed (D4 — F9 launches in TTY frames); tmux-suppression invariant preserved (cj/--ai-term-suppress-tmux). 23 ai-vterm tests renamed → test-ai-term--* (terminal-guard test deleted, obsolete); show-or-create + f9-in-term rewritten for ghostel; all green. ui-config cursor-state ported (ghostel-mode + ghostel--input-mode; copy/emacs = read-only, else writeable) + its test. init.el now requires term-config + ai-term; vterm-config.el + ai-vterm.el deleted. Full suite green except the 5 documented pre-existing failures (4 dupre-theme, 1 init-module-headers/popper-config-missing — both unrelated). validate-modules ✓; full early-init+init smoke clean (no ghostel/term/ai-term errors). vterm package still installed (Phase 4) — dashboard "Launch VTerm" + dormant auto-dim still reference it until Phase 3/4. Restart Emacs to pick up ghostel (load-order + use-package :config change). - -*** 2026-06-05 Fri @ 00:50:58 -0500 Phase 3 done: satellites ported to ghostel -Deleted auto-dim's vterm color-advice + redraw integration (~165 lines; D1 — terminals don't dim, ghostel bakes its palette per-terminal so there's no per-window color hook); dashboard launcher → =(ghostel)= + "Launch Terminal" label; cj-window-geometry/toggle-lib doc comments; module-inventory + init-load-graph doc refs. (ui-config cursor-state + init.el requires landed in Phase 2.) Trimmed test-auto-dim-config (dropped the 6 vterm tests) + updated the dashboard-launcher test stub. Incidental: removed the stale =popper-config= entry from the test-init-module-headers allowlist (the file doesn't exist + isn't required) — fixes the long-standing pre-existing test failure. - -*** 2026-06-05 Fri @ 00:50:58 -0500 Phase 4 done: vterm + vterm-toggle removed -=package-delete='d vterm + vterm-toggle from elpa. No vterm refs remain in modules/init except intentional historical comments. Suite green except the 4 pre-existing dupre-theme failures (the popper-config one is now fixed). validate-modules ✓; full early-init+init batch smoke = INIT-SMOKE-OK. The migration parent stays DOING until Craig restarts Emacs and walks the ghostel manual-verify matrix under "Emacs Manual Testing and Validation". - -*** 2026-06-05 Fri @ 14:24:02 -0500 Auto-dim revisit cancelled — current no-dim behavior is fine -Craig confirmed the shipped auto-dim setup works fine as-is: terminal buffers don't participate in unfocused-window dimming (D1), and the rest of auto-dim behaves. That is the measured decision the original task asked for — option (a), keep no-dim — so no rework (the focus-loss palette-blend in option (b) or an upstream per-window hook in option (c)) is needed. Closing without further investigation. Context: [[id:b54c94a0-d762-4b41-afd7-cf5593ce6675][migration spec]] D1. - -*** 2026-05-26 Tue @ 15:15:43 -0500 Direction confirmed; Claude Code in eat needs a caveat -Craig confirmed the consolidation: one terminal engine everywhere — eat for standalone terminal buffers (replacing vterm) plus =eat-eshell-mode= as eshell's visual backend, keeping eshell as the shell. Not dropping eshell for eat + zsh. - -Researched whether Claude Code runs cleanly in eat (Craig runs it in his Emacs terminal). Verdict: mostly, with caveats. eat is the default backend for claude-code.el and renders the TUI with color and full key handling, but there is an eat-specific bug where Claude Code's input handling makes the buffer scroll-pop to the top on window-buffer changes and the input box can get stuck mid-buffer (recoverable, but it does not happen in vterm or ghostel), and eat runs about 1.5x slower than vterm on heavy streaming output. claude-code.el's own docs name ghostel as the most faithful Claude TUI renderer. - -Recommendation: consolidate everyday terminals onto eat, but keep ghostel (or vterm) for the Claude Code workflow specifically — the scroll-pop / stuck-input bug and the slower heavy-stream handling are exactly what bites a long Claude session. Sources: [[https://github.com/cpoile/claudemacs][claudemacs]], [[https://github.com/stevemolitor/claude-code.el][claude-code.el]], [[https://codeberg.org/akib/emacs-eat][emacs-eat]]. - -Eval plan (from the research doc): install EAT alongside vterm, run the same workloads through both, decide. Test matrix: Claude Code TUI, lazygit, htop/btop, yazi, a heavy-output build, ssh to a remote, and eshell with =eat-eshell-mode=. Assess rendering fidelity, stability under heavy output, and Emacs-native line editing. Switch only if it covers every workflow without regression. - -*** 2026-06-02 Tue @ 14:12:48 -0500 Audit: eval plan not yet run; back to TODO -Task audit found no eval work recorded since the 2026-05-26 direction-confirmed note. The test matrix above is unrun, so the task isn't actively in progress — moved DOING back to TODO until the eval starts. - -*** 2026-06-04 Thu @ 22:40:27 -0500 Pivot: ghostel as the single engine (not eat) -Direction changed from eat-everyday + ghostel-for-Claude to ghostel-for-everything, and the task is now a migration rather than an eval. Rationale: ghostel is claude-code.el's most-faithful Claude TUI renderer and the fastest engine (81 vs vterm 34 vs eat 4.9 MB/s), and an audit confirmed it exposes an analog for every vterm primitive this config uses (=ghostel-send-string=, =ghostel-keymap-exceptions=, =ghostel-copy-mode=, =ghostel-clear-scrollback=, =ghostel-send-next-key=, =ghostel-next-prompt= / =ghostel-previous-prompt=, =ghostel-max-scrollback=, =ghostel-kill-buffer-on-exit=). eat's washed colors, the scroll-pop / stuck-input bug under Claude Code, and slowest throughput made it the weaker single-engine pick; one engine beats running two. Surface audited: 2 main modules (=vterm-config.el=, =ai-vterm.el=) + 4 satellites (=auto-dim-config.el= is the heavy one) + ~35 test files + init.el. Next: spike ghostel read-only to answer the open migration questions (auto-dim rework — ARCHITECTURE.md forbids the around-redraw color advice vterm uses; tmux pane-id via =process-tty-name= on a ghostel process; buffer naming; TTY-frame behavior; copy-mode keybinding parity), then write the migration spec under =docs/design/= and review it. - -*** 2026-06-04 Thu @ 23:17:54 -0500 Spec review: not ready until decisions and handoff shape are closed -Ran the spec-review workflow against [[id:b54c94a0-d762-4b41-afd7-cf5593ce6675][docs/specs/vterm-to-ghostel-migration-spec-implemented.org]] and wrote a companion review file (incorporated and deleted 2026-06-04). Verdict: =Not ready=. Direction is sound, but the draft still has open D1-D5 decisions, lacks the workflow-required =Implementation phases= section and acceptance criteria, and needs explicit ghostel package/native-module failure behavior before implementation tasks can be emitted. - -*** 2026-06-04 Thu @ 23:24:28 -0500 Spec-response: review incorporated, raised to READY -Folded the external review via spec-response. Craig accepted D1-D5; baked them plus D6 (module-failure = degrade-with-warning, modifying the reviewer's fail-loud) and D7 (=ghostel-max-scrollback= 10 MB) into a new Agreed-decisions section. Added Implementation phases (0-4), Acceptance criteria, Dependency/module-failure behavior, Test strategy, per-phase key/menu ownership, the tmux-suppression contract, and an Implementation-tasks drop-in block. Status DRAFT → READY; review file deleted. Build is now unblocked. - -*** 2026-06-04 Thu @ 23:30:18 -0500 External re-review: ready -Re-reviewed [[id:b54c94a0-d762-4b41-afd7-cf5593ce6675][docs/specs/vterm-to-ghostel-migration-spec-implemented.org]] after incorporation. Verdict: =Ready=. No further blocking review notes; implementation can start from the phase plan and acceptance criteria in the spec. -** DONE [#A] erc-yank silently publishes >5-line pastes as public gists :bug:quick:solo: -CLOSED: [2026-06-20 Sat] -Dropped erc-yank 2026-06-20 (Craig's call: drop, not harden). The package turned a >5-line paste into a PUBLIC gist (=gist -P=, the clipboard-paste flag, no =--private=) behind a single y-or-n-p, with no executable-find guard for =gist=. It also gisted the system clipboard rather than the kill-ring text being yanked. No replacement binding needed: =erc-mode-map= defines no C-y of its own, so removing the package lets C-y fall through to the ordinary global =yank=. Verified live: effective C-y in an ERC buffer = =yank=. (Audit's "no confirmation" was slightly off — the package did prompt — but public-by-default + one-keystroke confirm + no guard made dropping it the clean fix.) -** DONE [#B] C-<left>/<right>/<down> wrongly enter terminal copy-mode :bug:quick: -CLOSED: [2026-06-24 Wed] -Fixed 2026-06-24: per Craig, only C-<up> enters copy-mode now — all other arrows (C-<down>/<left>/<right> and the M-arrows) were dropped from both the ghostel-mode-map binding and ghostel-keymap-exceptions in modules/term-config.el, so C-<left>/C-<right> reach the shell as readline word-motion again. Also per Craig: C-<up> pressed while already in copy-mode just moves up — cj/term-copy-mode-up checks tmux pane_in_mode (and ghostel--input-mode without tmux) and skips re-entry, which would otherwise reset the cursor. 6 ERT tests rewritten; byte-compile clean; the live daemon was stripped of the stale bindings/exceptions and reloaded (C-<up> bound + an exception, C-<left> forwarded to the pty). Real-terminal scroll is the VERIFY under Manual testing and validation. -** DONE [#B] ai-term wrap-teardown + shutdown functions :feature: -CLOSED: [2026-06-24 Wed] -Done 2026-06-24: added the three headless functions to =modules/ai-term.el= per the rulesets contract — =cj/ai-term-quit= (kill aiv- session + agent buffer + restore layout, idempotent), =cj/ai-term-live-count= (integer gate), =cj/ai-term-shutdown-countdown= (gate re-check → abort-able run-at-time countdown → =cj/ai-term-shutdown-command=, a defcustom). Reused the existing kill/close helpers. 13 ERT tests (live-count parsing, quit kill+idempotency, gate-abort/cancel/tick); byte-compile + validate-modules + launch smoke clean; headless contracts verified live in the daemon (live-count→3, quit no-op returns the session name, countdown aborted with sessions live — no shutdown). The tmux/shutdown side effects and the both-sides end-to-end are a VERIFY under Manual testing and validation. Original task body: -The .emacs.d half of the rulesets wrap-it-up teardown / shutdown feature. Implement three functions in =modules/ai-term.el=, all callable headlessly via =emacsclient -e= (no interactive frame): =cj/ai-term-quit "<project>"= (teardown a project's aiv- tmux session + buffer + geometry restore), =cj/ai-term-live-count= (integer, the safety gate), =cj/ai-term-shutdown-countdown= (run-at-time timer). Craig's 2026-06-23 decisions: non-destructive qualifier = "with summary"/"and summarize"; countdown is a run-at-time timer (not a tty writer); safety gate uses cj/ai-term-live-count. Lands with the rulesets half (workflow + Stop hook already built/pushed). Spec: =inbox/PROCESSED-2026-06-23-2331-from-rulesets-ai-term-teardown-companion.org= (rulesets proposal: docs/design/2026-06-23-wrap-teardown-shutdown-proposal.org). Own focused session. -** DONE [#C] README holistic pass -CLOSED: [2026-06-24 Wed] -Holistic pass over README.org, changes approved by Craig: bumped the Emacs floor to 30 (developed on 30.2); corrected the module count (~100 → ~120); added docs/ to the layout and reworded scripts/ (now also theme-studio); added Theme Studio, the ghostel native terminal, and ai-term to Features; added make coverage-summary to the dev targets. From the roam inbox. -** DONE [#B] Theme-driven nerd-icons colors + filetype legend :feature: -CLOSED: [2026-06-24 Wed] -Dropped the runtime nerd-icons tint so icon color is theme-driven, and added a -theme-studio filetype-legend representation over the 34 =nerd-icons-*= color -faces. Spec: -[[file:docs/specs/theme-studio-nerd-icons-colors-spec.org][theme-studio-nerd-icons-colors-spec.org]]. -Three Codex spec-review rounds (3 + 6 + 1 findings) incorporated; findings -[10/10], decisions [6/6]. Ready confirmed 2026-06-24 and implemented in a -no-approvals speedrun as the four dated phases below — full run-tests.sh and -=make test= green, all pushed. Live visual confirmation is a VERIFY under -Manual testing and validation. vNext follow-ups promoted to their own [#D] task. -*** 2026-06-24 Wed @ 05:54:34 -0400 Phase 1 — legend capture shipped -=scripts/theme-studio/build-nerd-icons-legend.el= resolves the 13 v1 rows from the live nerd-icons alists into =nerd-icons-legend.json= (committed); =generate.py='s =load_nerd_icons_legend= validates and falls back to the generic app on absent/malformed/empty/bad-row, with a warning. 7 Python tests. Committed (feat phase 1). -*** 2026-06-24 Wed @ 05:54:34 -0400 Phase 2 — bespoke legend preview shipped -nerd-icons registers as a bespoke app whenever the legend is valid (=add_nerd_icons_app=); =renderNerdIconsPreview= draws each row's glyph in its mapped face color through the shared registry, so recolor repaints live; the 34 faces stay editable. =#nerdiconstest= gate covers the wiring, the dir-row owner, and the recolor-repaint. Committed (feat phase 2). -*** 2026-06-24 Wed @ 05:54:34 -0400 Phase 3 — tint removed, theme drives color -Removed =cj/nerd-icons-tint-color= + =cj/--nerd-icons-color-faces= + =cj/nerd-icons-apply-tint= and both call sites from =nerd-icons-config.el=; the WIP theme already owned the 34 faces (theme-studio auto-discovered them), so color is theme-driven now. Kept =cj/--nerd-icons-color-dir=. Deleted the apply-tint test. validate-modules + launch smoke clean. Committed (feat phase 3). -*** 2026-06-24 Wed @ 05:54:34 -0400 Phase 4 — dir-precedence probe + round-trip -ERT probe locks the dir-precedence decision (prepended =nerd-icons-yellow= is first in the face list, wins over =nerd-icons-completion-dir-face=); =#nerdiconstest= extended with the export/import round-trip over an assigned nerd-icons color and a dir-face-stays-out check. Full run-tests.sh + =make test= green. Committed (test phase 4). Live visual is the VERIFY under Manual testing. -** DONE [#B] ai-term keybinding home :feature: -CLOSED: [2026-06-23 Tue] -Done 2026-06-23 (commit be772bc0): family moved to C-; a (a toggle, s select/launch, n next, k kill), swap also on M-SPC, F9 family retired, jumper's M-SPC binding removed (rehome pending). cj/ai-term-next now opens the picker when no agent is running instead of erroring. Bindings verified live in the daemon; Craig's hands-on check is filed under Manual testing and validation. -Move the ai-term commands off the F9 family. F9 sits somewhere semi-dangerous -to hit, and F8 (org-agenda) is slow to load, which reads as Emacs being -unresponsive. Craig wants three commands on an easy near-home-row chord: open -the ai-term selection menu, switch to the next agent, and kill the current one -(=cj/ai-term=, =cj/ai-term-next=, =cj/ai-term-close=). Explore C-, M-, and C-M- -with SPC. Likely collides with jumper, but ai-term is used far more, so jumper -yields. Archiving gptel this session freed the =C-; a= prefix, so the whole -ai-term family could live under =C-; a= (or another near-home-row key). -Related: the s-F9 detached-agent landing task and the tmux copy-mode binding -task elsewhere in this section. From the roam inbox. -** DONE [#C] Face coloring completion-read icons :quick:solo: -CLOSED: [2026-06-23 Tue] -Answered 2026-06-23 (investigation, no code change). There is no single -"completion icon" face — each icon inherits a per-type =nerd-icons-*= color -face (a .el file icon inherits =nerd-icons-purple=, an M-x command icon -=nerd-icons-blue=, etc.; nerd-icons picks the face per glyph/filetype). What -makes every completion icon render the SAME color here is this config's bulk -tint: =cj/nerd-icons-tint-color= (defcustom in =nerd-icons-config.el=, default -"darkgoldenrod") sets the foreground of all ~33 =nerd-icons-*= color faces via -=cj/nerd-icons-apply-tint=, applied in the =nerd-icons= =:config=. Verified live: -=nerd-icons-icon-for-file "init.el"= -> =:inherit nerd-icons-purple=, and that -face's foreground is "darkgoldenrod". Directory icons additionally get -=nerd-icons-yellow= layered on by =cj/--nerd-icons-color-dir= advice -(=nerd-icons-completion-dir-face= is unset, so it isn't the driver here). -To theme: change =cj/nerd-icons-tint-color= (one color for all icons, then call -=cj/nerd-icons-apply-tint=), or drop the bulk tint and set the individual -=nerd-icons-*= color faces for per-filetype colors. For theme-studio, the knob -to expose is =cj/nerd-icons-tint-color= plus the =nerd-icons-*= face family. -** DONE [#C] Org formatting inside cj comments :feature: -CLOSED: [2026-06-23 Tue] -Done 2026-06-23: mapped the "cj:" src-block language to org-mode via -=org-src-lang-modes= in =org-babel-config.el=. Effect: a cj comment block's -prose now gets org font-lock in place (links, *bold*, lists styled — verified -live, the link inside a block carries the =org-link= face), and =C-c '= opens a -full org-mode buffer to edit it. Approach A from the design walk: non-breaking, -the =cj:= grep marker and the whole cj-processing pipeline are unchanged. The -block stays a src block, so org's parser still treats its body as code — links -are followed from the =C-c '= buffer rather than clicked in place. If that -in-place limitation bites, Approach B (migrate to a =#+begin_cj= special block) -is the documented escalation. -Craig writes free-form prose inside cj comment blocks (=#+begin_src cj: ...=) -and wants org formatting available there. -From the roam inbox. -** DONE [#C] term: M-<arrow> enters tmux copy-mode :feature: -CLOSED: [2026-06-24 Wed] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-22 -:END: -Done 2026-06-24: C-<up>/<down>/<left>/<right> and M-<arrow> in =ghostel-mode-map= enter copy-mode and carry their direction in one stroke (=cj/term-copy-mode-up= & friends -> =cj/term-copy-mode-move= -> =cj/term-copy-mode-dwim= then =cj/--term-copy-mode-move-step=). tmux path writes the arrow escape sequence into the pty; non-tmux path moves point in =ghostel-copy-mode=. All 8 keys added to =ghostel-keymap-exceptions= + =ghostel--rebuild-semi-char-keymap= (the gotcha). Ghostel-only. 6 new ERT tests; bindings + exceptions + the dwim sequence verified live in the daemon. The real tmux copy-mode scroll is a VERIFY under Manual testing and validation. - -Folded 2026-06-23 from the roam inbox: Craig also wants C-<up> (control + up arrow) to enter tmux copy-mode and move up in one stroke — i.e. a modified arrow both enters copy-mode and passes the movement (copy-mode + arrow). So the binding set is the modified arrow keys (M-arrow and/or C-arrow), each entering copy-mode and carrying its own direction. -** CANCELLED [#C] page-signal pager account deregistered — re-registration needs your hands -CLOSED: [2026-06-21 Sun] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-12 -:END: -Reported by .emacs.d 2026-06-12 01:01: the dedicated pager number (+15045173983, the Claude Pager Google Voice number on signal-cli) returns "User ... is not registered" on every send — Signal appears to have deregistered it (GV numbers get periodically re-verified). Re-registration requires captcha/SMS, which only you can do. Until then every page-signal call fails; .emacs.d's config-audit page fell back to email. Wrapper lives at claude-templates/bin/page-signal. -** DONE [#B] mu4e: cmail can't trash, no account can refile :bug:quick:solo: -CLOSED: [2026-06-24 Wed] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-13 -:END: -=modules/mail-config.el:217-220= — the cmail context (primary account) sets only drafts/sent, so D falls back to default "/trash" which doesn't exist under ~/.mail (=/cmail/Trash= does); and NO context sets =mu4e-refile-folder=, so r targets nonexistent "/archive" everywhere. Accepting mu4e's offer to create the maildir strands mail in a directory mbsync never syncs — messages silently vanish from the server's view. Add =mu4e-trash-folder= to cmail + per-context =mu4e-refile-folder=. From the 2026-06 config audit. -Fixed 2026-06-13: cmail gets =mu4e-trash-folder= "/cmail/Trash"; refile is a per-message function (=cj/mu4e--refile-folder=) instead of a per-context string — mu4e context :vars are sticky, so a per-context refile leaks one account's archive folder into another. cmail → "/cmail/Archive"; gmail/dmail signal a =user-error= rather than move mail into an unsynced phantom folder (Craig chose the fail-safe over syncing [Gmail]/All Mail — the All Mail option means a multi-GB pull + cross-folder duplicates; revisit if local Gmail archiving is wanted). Applies on next mu4e open; pure dispatch helper covered by tests. -** CANCELLED [#C] Lock screen silently fails — slock is X11-only :bug:quick: -CLOSED: [2026-06-21 Sun] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-13 -:END: -=modules/system-commands.el:105= binds the lockscreen command to =slock=, which can't grab a Wayland session; =cj/system-cmd= launches it detached with output silenced, so C-; ! l does nothing and the screen never locks. Security issue: Craig believes the screen locks when it doesn't. Fix: =hyprlock= (or =swaylock=), ideally resolved per session type via =env-wayland-p= so an X11 fallback survives for other machines. From the 2026-06 config audit. -Fixed 2026-06-13: lockscreen-cmd resolves to =loginctl lock-session= on Wayland (logind Lock → hypridle → hyprlock, the path idle/sleep locking already uses), =slock= on X11; also added the missing =(require 'host-environment)=. Live in the daemon; manual lock test under the Manual testing parent. -** CANCELLED [#B] AI Open Work -CLOSED: [2026-06-23 Tue] -gptel archived 2026-06-23 to archive/gptel/ (rarely used). The child issues below — ai-rewrite directive plumbing, ai-conversations bugs, the stale-elpa / gptel-magit shadow, model-switch dedup — are all moot against archived code. Kept for reference; detail also in git history. -*** CANCELLED [#B] ai-rewrite: chosen directive never reaches the request :bug:solo: -=modules/ai-rewrite.el:64= — the directive is let-bound around =(call-interactively #'gptel-rewrite)=, but gptel-rewrite is a transient prefix that returns when the menu shows; the send resolves the directive AFTER the binding unwound (verified against ~/code/gptel/gptel-rewrite.el:780-799). The picker's choice is silently dropped — the module's core feature is inert. Set =gptel--rewrite-directive= buffer-locally (restore via =gptel-post-rewrite-functions=) or use a self-removing global hook entry. From the 2026-06 config audit. - -*** CANCELLED [#B] Stale elpa gptel shadows the local fork — likely the gptel-magit root :bug:quick:solo:next: -Needs from Craig: can't be done standalone. I tried deleting elpa/gptel-0.9.8.5 — the fork loaded fine and gptel-magit still worked via use-package autoloads, but package activation then printed "Unable to activate gptel-magit / Required gptel-0.9.8 unavailable" on every startup, so I reverted. To remove the shadow we must also resolve gptel-magit's package dependency: either drop gptel-magit's package dep (load it via load-path like the gptel fork), or repackage the fork into .localrepo as gptel. Tell me which and I'll do it; this pairs with the gptel-magit investigation. -=elpa/gptel-0.9.8.5= is still installed alongside the =~/code/gptel= fork (=ai-config.el:383=); package activation puts the elpa dir + autoloads on load-path, so which copy wins depends on ordering, and a mixed load (fork .el + elpa .elc) produces "impossible" bugs. =gptel-magit= (elpa) declares gptel as a dependency, so IT may be pulling the stale copy — check this first when working the open "[#B] Investigate gptel-magit not working properly" task. Fix: =package-delete= the elpa gptel + remove from .localrepo so the fork is the only copy on disk. From the 2026-06 config audit. - -2026-06-15: tried deleting =elpa/gptel-0.9.8.5= standalone. The fork loaded correctly and gptel-magit still worked via use-package =:commands= autoloads, BUT package activation then printed "Unable to activate package gptel-magit / Required package gptel-0.9.8 unavailable" on every startup and test run (gptel-magit declares gptel as a package dependency that no longer resolves). Reverted. This can't be done standalone — it must be paired with the gptel-magit dependency fix (drop gptel-magit's package dep, or repackage the fork into .localrepo as gptel). Do it together with the gptel-magit investigation task. - -*** CANCELLED [#B] ai-conversations: dead-buffer load, role flattening, non-atomic writes :bug:solo: -From the 2026-06 config audit, =modules/ai-conversations.el=: -- =:324= — load in a fresh session does =get-buffer-create "*AI-Assistant*"= (plain fundamental-mode buffer); =--ensure-ai-buffer= then sees it exists and never calls =(gptel)=. Sending doesn't work, autosave self-cancels (requires gptel-mode). Use =get-buffer= for the check; let ensure create. The browser RET/l path inherits this. -- =:240= — persistence drops gptel's =response= text properties, so a reloaded history replays to the model as ONE user message (model re-reads its own answers as Craig's words). Adopt gptel's native bounds persistence or re-mark on load from the "* Backend:" headings. -- =:248= — =write-region= straight at the target; crash mid-write truncates the only copy of the history (autosave hits this constantly). Temp + rename. -- =:140= — three overlapping autosave mechanisms (after-send advice that fires before the response exists, post-response hook, 60s timer). Keep the hook; drop the advice (and likely the timer). - -*** CANCELLED [#B] Dedup gptel model-switch commands — keep switch-backend or fold into change-model :bug: -=cj/gptel-change-model= (C-; a m) already does backend+model switching and interns correctly, so =cj/gptel-switch-backend= (C-; a B) is arguably redundant now that its crash is fixed. Decision for Craig: keep both, or delete =cj/gptel-switch-backend= plus its C-; a B binding and keep one model-switch command. From the 2026-06 config-audit follow-up. -** DONE [#B] agenda sources: roam Projects missing, no existence filtering :bug:solo: -CLOSED: [2026-06-24 Wed] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-20 -:END: -Done 2026-06-24, both parts: (1) per Craig, corrected the docs rather than implementing roam-Project agenda scanning — the commentary + two docstrings claimed org-roam "Project" nodes are agenda sources, but they were never scanned; roam Project/Topic notes are refile targets (org-refile-config.el), not agenda sources. (2) =cj/--org-agenda-base-files= now drops non-existent files and =org-agenda-skip-unavailable-files= is set as a backstop, in the one shared helper so the agenda builders, single-project view, and chime initializer all get it. base-files tests reworked to drive real temp files (+ a drops-missing case); byte-compile clean; live-verified (skip var t, base-files returns only existing). From the 2026-06 config audit, =modules/org-agenda-config.el=: -- =:182-191= — commentary and docstrings promise org-roam nodes tagged "Project" as agenda sources, but =cj/--org-agenda-scan-files= never scans them, and files added by the roam finalize-hook are wiped on the next =cj/build-org-agenda-list= cache rebuild (≤1h). Add a roam Project pass (mirror =org-refile-config.el:101-109=) or correct the docs. -- =:186,456= — agenda file list built unconditionally (inbox/calendars may not exist on a fresh machine) and =org-agenda-skip-unavailable-files= is unset — the exact interactive-prompt class that once hung the chime daemon. Filter with =file-exists-p= + set the var as backstop. -** DONE [#B] F7 diff-aware coverage classifies every changed file "not tracked" :bug:solo: -CLOSED: [2026-06-22 Mon] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-20 -:END: -Fixed 2026-06-22: simplecov keys are absolute, git-diff keys repo-relative, so the exact-key intersect never matched. Added =cj/--coverage-relativize-keys= and normalize both tables to repo-relative in =cj/--coverage-read-and-display= before the intersect; intersect unchanged. New =test-coverage-core--relativize-keys.el= (5 unit + 1 integration through the real parsers). Full suite green. -=modules/coverage-core.el:252= — =cj/--coverage-intersect= joins covered×changed by exact string key, but simplecov.json keys are ABSOLUTE paths while the git-diff parser returns repo-RELATIVE ones — zero matches ever, so working-tree/staged/branch scopes report ":tracked nil" for everything and F7's main feature is inert (whole-project scope works, same-source keys). Unit tests hand-build matching keys so they pass; add one integration test feeding a real undercover report + real diff. Normalize both sides to repo-relative. From the 2026-06 config audit. -** DONE [#B] jumper: register collisions and dead-marker errors :bug:solo: -CLOSED: [2026-06-22 Mon] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-13 -:END: -Fixed 2026-06-22: (1) store now allocates the first unused register char in the live slice (=jumper--first-free-register=) instead of by next-index, and removal clears the freed register, so a store after a removal no longer overwrites a surviving slot's marker; (2) =jumper--with-marker-at= guards =(buffer-live-p (marker-buffer marker))= so killed-buffer entries are skipped instead of signaling wrong-type errors; (3) the single-location toggle jumps back to the last-location register when set (returns =jumped-back=). New =test-jumper--register-hygiene.el= (8 tests); all 42 jumper tests green. Pre-existing unused-lexical =i= warning in =jumper--location-exists-p= left alone (separate nit). -Two related defects from the 2026-06 config audit: -- =modules/jumper.el:155= — removal shifts the vector without renumbering registers, so a later store allocates a register still held by a surviving location and silently overwrites it. Allocate the first free register char in the live slice; =set-register nil= on removal so freed markers don't pin buffers. -- =modules/jumper.el:117,132= — guards check =(markerp marker)= but not =(buffer-live-p (marker-buffer marker))=; after killing a buffer holding a location, M-SPC SPC and M-SPC j signal wrong-type errors. Treat dead entries as skippable/removable. -Also =jumper.el:178= — the promised single-location toggle never toggles back ('already-there branch should =jump-to-register= z when set). -** DONE [#C] face-diagnostic: face-name buttons + header allowlist :feature:quick:solo: -CLOSED: [2026-06-24 Wed] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-21 -:END: -Done 2026-06-24: (a) =cj/--face-diag-face-button= renders each real face name in the report as a =buttonize='d button that runs =describe-face= on it (carries the face as button-data); anonymous specs and non-faces stay plain. Routed through the stack, overlay, remap, and provenance render sites. (b) Added =face-diagnostic= to =test-init-header--classified-modules= (it's required in init.el and already carries the header contract). 5 new ERT tests; button text properties confirmed live in a rendered *Face Diagnosis* buffer. Click/RET sign-off is a VERIFY under Manual testing and validation. Spec: [[id:98f065cf-8bd5-46a0-ac24-da94d66855ad][face-font-diagnostic-popup-spec-implemented.org]]. -** DONE [#C] latexmk workflow never activates (two breaks) :bug:quick:solo: -CLOSED: [2026-06-24 Wed] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-21 -:END: -Done 2026-06-24: changed the :hook key from =TeX-mode-hook= to =TeX-mode= (use-package appends "-hook" only to non-"-mode" symbols, so this now registers on the real =TeX-mode-hook= instead of the unbound =TeX-mode-hook-hook=), and auctex-latexmk from =:defer t= to =:after tex= so =auctex-latexmk-setup= runs when AUCTeX loads. Confirmed both breaks via macroexpand (the dump showed =add-hook 'TeX-mode-hook-hook= before, =TeX-mode-hook= after). 2 new regression ERT tests; live-verified in a real .tex buffer: =TeX-command-default= is "latexmk" and "LatexMk" is in =TeX-command-list=. Actual C-c C-c compile is a VERIFY under Manual testing and validation. From the 2026-06 config audit. -** CANCELLED [#C] the preview splits an already split window into 3 temporarily. :bug: -CLOSED: [2026-06-21 Sun] -looks strange. potentially problematic for ai-terms. -** CANCELLED [#C] TRAMP/dirvish "?" for remote dates — verify the fix per host :bug: -CLOSED: [2026-06-21 Sun] -:PROPERTIES: -:LAST_REVIEWED: 2026-06-02 -:END: - -Root cause is traced (see the dated investigation entry below). What's left needs a live remote: open each remote host in dirvish and run the three diagnostic evals to find which gate is closed, then close it. - -Diagnostics (run with point in a remote dirvish buffer): -- =M-: (dirvish-prop :remote-async)= — nil means =tramp-direct-async-process-p= is failing for this method/host, so dirvish's remote attribute fetch never runs. -- =M-: (dirvish-prop :gnuls)= — nil means the remote has no GNU =ls= (the =ls --version= probe failed), so the parser gate stays shut. Likely on truenas (FreeBSD). -- =M-: (tramp-direct-async-process-p)= — confirms whether direct-async is actually active for the connection. - -Likely fixes, by which gate is closed: -- =:gnuls= nil → install GNU coreutils on the remote (FreeBSD: =pkg install coreutils=) and make =ls= resolve to GNU on the TRAMP path, or accept "?" on that host. - - - Constraint: nothing gets installed on the remote host, so the =:gnuls= gate is resolved by accepting "?" on that host rather than installing coreutils. -- =:remote-async= nil → the scp/sshx method isn't advertising direct-async; switch to a method that supports it or check =tramp-direct-async-process= is taking effect for that protocol. - -Files involved: =modules/tramp-config.el=, =modules/dirvish-config.el=. - -*** 2026-05-22 Fri @ 20:24:44 -0500 Traced the root cause through dirvish source -Remote dates/sizes don't come from the dired =ls= listing or =dired-listing-switches=. They come from =dirvish-data-for-dir= (=dirvish-tramp.el:95=), which runs =ls -1lahi= on the remote and parses the columns into the attribute cache. That method only fires when both =(dirvish-prop :remote-async)= is a number and =(dirvish-prop :gnuls)= is a string. When either gate is shut, dirvish falls back to its default, which deliberately skips =(file-attributes f-name)= for remote files (=dirvish.el:904=, a perf guard) — leaving attrs nil, so the file-size and file-time widgets render "?" (=dirvish-widgets.el:216,247=). - -That explains why every prior fix missed: dired-listing-switches feed a different code path entirely, and disabling =tramp-direct-async-process= shuts the =:remote-async= gate, which is the one path that populates remote attributes — exactly backwards. The config already enables direct-async for ssh/sshx (=tramp-config.el:79-88=), so the remaining closed gate is per-host: =:gnuls= (no GNU ls on FreeBSD-based truenas) or direct-async not taking effect for the method. Could not verify on a live remote from the work session — handed the per-host diagnostics up into the task body. |
