Skip to content

feat: hover mode, configurable global predicate, :weight; drop render cache - #10

Merged
chiply merged 1 commit into
mainfrom
feat/hover-mode-and-ergonomics
Jun 16, 2026
Merged

feat: hover mode, configurable global predicate, :weight; drop render cache#10
chiply merged 1 commit into
mainfrom
feat/hover-mode-and-ergonomics

Conversation

@chiply

@chiply chiply commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Ergonomics + polish pass ahead of publishing.

P0 — hover is now batteries-included. svg-margin-hover-mode (global) installs the show-help-function wrapper itself (chaining any prior one) and sets svg-margin-hover-highlight, so enabling the hover highlight is one line instead of hand-wired boilerplate. The former private svg-margin--note-help is now the public svg-margin-note-help (old name kept as an obsolete alias) for anyone composing their own wrapper.

P1

  • svg-margin-global-predicate — choose which buffers global-svg-margin-mode enables in (default: file-visiting buffers), instead of a hardwired predicate.
  • Drop the unused svg-margin--render-cache (it had no in-package consumer and cost work on every render).

P2

  • :weight indicator key for :text font-weight (default bold).
  • Document the whole-buffer/per-render provider cost in the Commentary.

Tests added for weight, the hover mode (wiring + chaining), the alias, and the predicate. package-lint/checkdoc clean, 39 tests pass.

… cache

- svg-margin-hover-mode: a global minor mode that installs the
  show-help-function wrapper (chaining any prior) and sets
  svg-margin-hover-highlight, so the hover highlight no longer needs
  hand-wired boilerplate.
- svg-margin-note-help: the former private svg-margin--note-help, now public
  (old name kept as an obsolete alias) for custom show-help wrappers.
- svg-margin-global-predicate: choose which buffers global-svg-margin-mode
  enables in (default: file-visiting buffers).
- :weight indicator key sets the :text font-weight (default bold).
- Drop the unused per-render svg-margin--render-cache (no in-package consumer;
  it was per-render overhead).
- Document the whole-buffer per-render provider cost.
Copilot AI review requested due to automatic review settings June 16, 2026 02:23
@chiply
chiply merged commit 835818e into main Jun 16, 2026
8 checks passed
@chiply
chiply deleted the feat/hover-mode-and-ergonomics branch June 16, 2026 02:25
@chiply chiply mentioned this pull request Jun 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR is an ergonomics/polish pass for svg-margin ahead of publishing, adding batteries-included hover highlight wiring, making global-svg-margin-mode buffer selection configurable, and extending text indicators with a configurable SVG font-weight, while removing an unused render cache.

Changes:

  • Add :weight support for :text indicators (default "bold") and tests validating forwarding/behavior.
  • Introduce svg-margin-hover-mode (global) to wire show-help-function and expose svg-margin-note-help (with an obsolete alias for the old private name), with corresponding tests.
  • Add svg-margin-global-predicate (default file-visiting buffers) and document the new predicate + hover mode in the README.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
test/svg-margin-test.el Adds ERT coverage for :weight, hover-mode wiring/chaining, obsolete alias behavior, and the new global predicate.
svg-margin.el Implements :weight, publicizes hover help tracking + adds svg-margin-hover-mode, adds svg-margin-global-predicate, and drops the render cache.
README.md Documents the new global predicate, :weight, and the simplified hover highlight setup via svg-margin-hover-mode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread svg-margin.el
Comment on lines +978 to +981
(setq svg-margin-hover-highlight t)
(unless (eq show-help-function #'svg-margin--show-help)
(setq svg-margin--prev-show-help show-help-function
show-help-function #'svg-margin--show-help)))
Comment thread svg-margin.el
Comment on lines +976 to +981
(if svg-margin-hover-mode
(progn
(setq svg-margin-hover-highlight t)
(unless (eq show-help-function #'svg-margin--show-help)
(setq svg-margin--prev-show-help show-help-function
show-help-function #'svg-margin--show-help)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants