Repository navigation
api(bind): add BindKindView::Keymap so the view reports keymap bindings faithfully - #3616
Conversation
…fresh local A local/declare operand that creates a FRESH local inside a function binds the new mutable instance — an outer-scope readonly mark on the same name must not fire (GNU make_local_variable, declare.def:929+ / variables.c:5524+). The nested_readonly check consulted the flat READONLY_VARS name mark without regard to locally_scoped, so 'local x=(7 8 9)' inside a caller holding 'local -r x' spuriously reported 'x: readonly variable' (while still binding). Also gate local_context on the declare family: export/readonly operands always bind the inherited (global) variable (setattr.def:240-268), so the non-localizing readonly refusal still fires for them — verified against GNU 5.3.20 (export/declare -g on a global readonly inside a function: diagnostic, then the body continues). Same-scope re-local on a readonly local still refuses; an inner-scope readonly mark shadowed by a fresh local stays scoped to its instance. Fixes #3609. Refs #2666 (varenv19.sub ccc). Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…gs faithfully
BindKindView now carries a Keymap variant mirroring BindKind
(rl_generic_bind's ISKMAP value — e.g. old-style 'keyname: prefix-meta'
binds the sequence to the emacs-meta map, bind.c:1845-1855). Previously
the capture collapsed such entries into BindKindView::Function{name:
"prefix-meta"}, so a host could not distinguish a keymap-valued slot
from a real function binding (GAP-13 entity-part ruling, rubash#3013).
- capture maps BindKind::Keymap -> BindKindView::Keymap; the dump arm
still renders the slot as 'seq: prefix-meta' (GNU rl_function_dumper
prints ISKMAP entries that way).
- Session::register_binding accepts the variant, converting it back to
BindKind::Keymap (ISKMAP assignment semantics unchanged).
- docs/api-ledger.md variant lists updated on both rows; the niu-side
explicit arm + its ledger row are the paired niubash change.
Refs #3013. Refs niubash#863 GAP-13.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
【WIN-AGENT-AUDIT】PR #3616 第1轮 — 建议:FAIL 机制核查:
腿(逐项给数字与名字):
F 点(建议 FAIL):
未跑/VOID 的腿:
|
|
【WIN-AGENT-AUDIT】PR #3616 第2轮(y4)— 建议:FAIL 维持(两个阻塞均未解除,均不在本 lane 可动范围) 第 1 轮 F 点复核:
机制面(第 1 轮结论不变): 建议:维持 FAIL——先落 niubash 侧账本/显式臂(或队长裁定 cmp 门豁免口径),再由 owner rebase 清理无关 commit 后复审。 |
) (#1042) Mirror the engine-side ledger update from unixwin/rubash#3616: the bind view reports keymap-valued bindings faithfully, so the BindKindView variant list grows Execute / Function / Macro / Keymap. Both copies of docs/api-ledger.md must stay byte-identical (api-ledger-sync gate).
…ubash#3013) (#1045) * docs(api-ledger): add BindKindView::Keymap row (Refs unixwin/rubash#3013) Mirror the engine-side ledger update from unixwin/rubash#3616: the bind view reports keymap-valued bindings faithfully, so the BindKindView variant list grows Execute / Function / Macro / Keymap. Both copies of docs/api-ledger.md must stay byte-identical (api-ledger-sync gate). * runtime(bind): handle BindKindView::Keymap explicitly (Refs unixwin/rubash#3013) rubash#3616 adds the keymap-valued view kind (lib/readline/bind.c:1845 ISKMAP). Match it explicitly instead of leaning on wildcard arms: - readline_live: mirror it as the function the engine's dump face renders for that slot (prefix-meta), so the key still reaches readline's own keymap dispatch. - keymap_registry: new DroppedKind::Keymap with its fix hint. - repl chord layer: a keymap binding is not a chord event. Also mirrors the two api-ledger variant-list edits so both copies stay byte-identical. * runtime(bind): deliver keymap bindings through the explicit Keymap kind rubash#3616's BindKindView::Keymap is now the real kind for ISKMAP bindings, so: - keymap_registry::delivery_kind rewrites Keymap onto the prefix-meta function only at the delivery boundary (no host slot of its own, rl_function_dumper renders that slot as prefix-meta); - the flat bind layer matches on it and keeps an exhaustiveness arm; - the [keymap].bind parser records BindKindView::Keymap { name } instead of the old prefix-meta function shim. Checked with cargo check --workspace --locked against the rubash #3616 head: 0 errors, 0 warnings.
|
【WIN-AGENT-AUDIT】PR #3616 第3轮(o2)— 判词:PASS(已合入 squash head: 5e13476(原 6badbab + F1(niubash 侧账本缺
F2(分支叠了已由 #3610 落地的旧 commit f6836d5)按规程处置,未 rebase:
机制(GNU 锚点): 腿:
未跑/VOID:本 head 的 Windows 全量 lib(上轮已核失败集合 {issue2084…},本轮产品面只增视图变体,lib 面由 lib 钉覆盖);GNU bash oracle(无 shell 语义面,API 视图层)。 |
|
Merged as squash F1 — ledger pairing / niubash adoption. The ledger row alone was not sufficient: niubash master then failed this PR's canary with 4 × E0004 (exhaustive matches on Final canary: F2 — stacked history. Local legs: round-trip pin #3013 is closed with the same acceptance (contract + both ledger rows + niubash explicit arms + green canary). |
Summary
BindKindViewgains aKeymapvariant mirroringBindKind(rl_generic_bind ISKMAP value — old-stylekeyname: prefix-metabinds the sequence to the emacs-meta map, bind.c:1845-1855). Previously the capture collapsed such entries intoBindKindView::Function{name: "prefix-meta"}, so a host could not tell a keymap-valued slot from a real function binding — the gap niubash #959 covered with a wildcard arm (rubash#3013, GAP-13 实体部裁定 Q-A(ii)).BindView::capturemapsBindKind::Keymap→BindKindView::Keymap; the dump arm still renders"seq": prefix-meta(rl_function_dumper prints ISKMAP slots that way).Session::register_bindingaccepts the variant →BindKind::Keymap(ISKMAP 语义不变).docs/api-ledger.md两处变体清单补Keymap; niu 侧显式臂与其账本行为配套的 niubash 半单(本 PR 只落 rubash 侧)。Pin:
issue3013_keymap_kind_round_trips_through_the_view(Control-v: prefix-meta→Keymap{emacs-meta}+ register_binding 回写往返),consumer_tests 124 全绿,check-api-ledger287 符号齐,零编译警告。Refs #3013.