Skip to content

[codex] fix custom fringe bitmap faces#124

Merged
eval-exec merged 2 commits into
mainfrom
codex/fix-custom-fringe-bitmaps
Jun 7, 2026
Merged

[codex] fix custom fringe bitmap faces#124
eval-exec merged 2 commits into
mainfrom
codex/fix-custom-fringe-bitmaps

Conversation

@eval-exec

Copy link
Copy Markdown
Owner

Summary

Fix custom fringe bitmap handling so packages that define their own fringe bitmaps can immediately assign faces to them.

This addresses the startup failure seen when running ./target/release/neomacs with a user config that loads Mingus:

Debugger entered--Lisp error: (error "Undefined fringe bitmap")
  set-fringe-bitmap-face(mingus-NP-fringe mingus-playing-face)
  ...
  require(mingus nil t)

Debug Notes

The failing sequence in mingus.el is:

  1. Define package-specific fringe bitmap symbols such as mingus-NP-fringe.
  2. Call set-fringe-bitmap-face on those symbols during package load.

The root cause was a mismatch between the two fringe builtins in neomacs:

  • define-fringe-bitmap validated the bitmap arguments and returned the bitmap symbol, but did not record the symbol as a defined fringe bitmap.
  • set-fringe-bitmap-face only accepted a hardcoded list of built-in bitmap names, so any package-defined bitmap still looked undefined.

GNU-style Lisp already treats the symbol's fringe property as the bitmap marker; lisp/fringe.el uses (get symbol 'fringe) in fringe-bitmap-p. This fix follows that model.

Changes

  • Make define-fringe-bitmap stateful and store a non-nil fringe property on the bitmap symbol.
  • Make destroy-fringe-bitmap clear the symbol's fringe property.
  • Make set-fringe-bitmap-face accept either known built-in bitmap names or symbols with a non-nil fringe property.
  • Add a regression test covering define -> set face -> destroy -> reject face.

User Impact

Packages like Mingus that define custom fringe bitmaps no longer fail during startup with Undefined fringe bitmap when assigning bitmap faces.

Verification

  • cargo test -p neovm-core defined_fringe_bitmap_can_receive_face_until_destroyed
  • cargo test -p neovm-core dispatch_builtin_pure_handles_fringe_display_and_debug_output_placeholders
  • cargo check -p neovm-core
  • Earlier local release rebuild also completed with cargo build --release -p neomacs.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates the fringe bitmap builtins (define-fringe-bitmap, destroy-fringe-bitmap, and set-fringe-bitmap-face) to track defined fringe bitmaps dynamically by storing a fringe property on the symbol. This allows dynamically defined fringe bitmaps to accept faces until they are destroyed. A potential issue was identified in builtin_set_fringe_bitmap_face where calling symbol_property_get on a non-symbol argument could lead to a panic or unexpected error, and a guard was suggested to ensure safety.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread neovm-core/src/emacs_core/builtins/symbols.rs
@eval-exec eval-exec force-pushed the codex/fix-custom-fringe-bitmaps branch from 2162441 to b9ea136 Compare June 7, 2026 12:54
@eval-exec eval-exec marked this pull request as ready for review June 7, 2026 13:32
Copilot AI review requested due to automatic review settings June 7, 2026 13:32
@eval-exec eval-exec merged commit 6c3e8cd into main Jun 7, 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 fixes Neomacs’ fringe-bitmap interoperability so Lisp packages that define custom fringe bitmaps (e.g. Mingus) can immediately assign faces to them without triggering Undefined fringe bitmap during startup. It does so by making define-fringe-bitmap/destroy-fringe-bitmap manage a non-nil/nil 'fringe symbol property, and teaching set-fringe-bitmap-face to accept symbols marked that way (in addition to the built-in bitmap name allowlist).

Changes:

  • Make define-fringe-bitmap set a non-nil 'fringe property on the bitmap symbol, and destroy-fringe-bitmap clear it.
  • Extend set-fringe-bitmap-face validation to accept symbols with a non-nil 'fringe property.
  • Add regression tests for the define → set-face → destroy → reject flow, plus GNU-like type rejection for non-symbol bitmaps.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
neovm-core/src/emacs_core/builtins/tests.rs Adds regression tests covering custom fringe bitmap lifecycle and type errors.
neovm-core/src/emacs_core/builtins/symbols.rs Updates set-fringe-bitmap-face to treat 'fringe-marked symbols as defined.
neovm-core/src/emacs_core/builtins/stubs.rs Makes define-fringe-bitmap / destroy-fringe-bitmap stateful via symbol properties.
neovm-core/src/emacs_core/builtins/mod.rs Wires updated builtins to receive Context where needed.

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

Comment on lines 3092 to +3096
expect_range_args("set-fringe-bitmap-face", &args, 1, 2)?;
let bitmap = args[0].as_symbol_name();
if !bitmap.is_some_and(is_known_fringe_bitmap) {
let has_fringe_property =
symbol_property_get(ctx, args[0], Value::symbol("fringe"))?.1.is_some_and(|v| !v.is_nil());
if !bitmap.is_some_and(is_known_fringe_bitmap) && !has_fringe_property {
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