[codex] fix custom fringe bitmap faces#124
Conversation
There was a problem hiding this comment.
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.
2162441 to
b9ea136
Compare
There was a problem hiding this comment.
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-bitmapset a non-nil'fringeproperty on the bitmap symbol, anddestroy-fringe-bitmapclear it. - Extend
set-fringe-bitmap-facevalidation to accept symbols with a non-nil'fringeproperty. - 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.
| 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 { |
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/neomacswith a user config that loads Mingus:Debug Notes
The failing sequence in
mingus.elis:mingus-NP-fringe.set-fringe-bitmap-faceon those symbols during package load.The root cause was a mismatch between the two fringe builtins in neomacs:
define-fringe-bitmapvalidated the bitmap arguments and returned the bitmap symbol, but did not record the symbol as a defined fringe bitmap.set-fringe-bitmap-faceonly 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
fringeproperty as the bitmap marker;lisp/fringe.eluses(get symbol 'fringe)infringe-bitmap-p. This fix follows that model.Changes
define-fringe-bitmapstateful and store a non-nilfringeproperty on the bitmap symbol.destroy-fringe-bitmapclear the symbol'sfringeproperty.set-fringe-bitmap-faceaccept either known built-in bitmap names or symbols with a non-nilfringeproperty.User Impact
Packages like Mingus that define custom fringe bitmaps no longer fail during startup with
Undefined fringe bitmapwhen assigning bitmap faces.Verification
cargo test -p neovm-core defined_fringe_bitmap_can_receive_face_until_destroyedcargo test -p neovm-core dispatch_builtin_pure_handles_fringe_display_and_debug_output_placeholderscargo check -p neovm-corecargo build --release -p neomacs.