Repository navigation
fix(bind): old-style keynames, set: form, -m case (Refs #2914, #2915, #2916) - #2921
Merged
Merged
Conversation
…2914, #2915, #2916) - parse_old_style_binding ports rl_parse_and_bind's old-style arm (lib/readline/bind.c:1803-1856): keyname after the last '-', glean_key_from_name (bind.c:2387), Control-/Meta- prefixes by case-insensitive substring scan (_rl_strindex, util.c:274), macro values, equivalency no-op, NULL-slot binds for unknown function names. The executor's positional loop registers the result instead of dropping non-quoted specs (rubash#2914). - strip_set_keyword follows GNU's separator scan (bind.c:1637): the first token may end at ':' as well as whitespace, so 'set: foo' reaches the variable arm (rubash#2915). - bind -m resolves keymap names case-insensitively, matching rl_get_keymap_by_name (bind.c:2424) and the set keymap channel (rubash#2916); the diagnostic keeps the name as typed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #2914, #2915, #2916 — r74 bind-face residuals (follow-up to #2913). UNVERIFIED-BY-CAPTAIN.
Fixes #2914
Fixes #2915
Fixes #2916
What
Three residuals from the r74 bind-face batch, all in
rl_parse_and_bind's surface (lib/readline/bind.c:1594):bind 'Control-t: undo',bind 'Meta-x: undo'were silently dropped andbind 'backward-char 'never produced GNU'sunknown key modifierdiagnostic. Implements the arm per bind.c:1803-1856: keyname after the last-,glean_key_from_name(bind.c:2387), Control-/Meta- prefix detection by case-insensitive substring scan (_rl_strindex, util.c:274), macro values, equivalency no-op, NULL-slot binding for unknown function names.bind 'set: foo'was silently swallowed:strip_set_keywordrequired whitespace afterset, but GNU's separator scan terminates the first token at:too (bind.c:1637), so the colon form now reaches the variable arm (readline: foo: unknown variable name; a validset: name valueapplies).bind -m EMACSwas rejected: the-mchannel tested keymap names case-sensitively while GNU resolves them throughrl_get_keymap_by_name(_rl_stricmp, bind.c:2424) — the same rule theset keymapchannel already used ([bug] bind set silently accepts invalid bell-style/keymap values (no "could not set value" diagnostic) #2871). The-mchannel now lowercases before the membership test and stores the canonical map.Pins:
tests/issue2914_bind_old_style_keyname_regressions.rs(10),tests/issue2915_bind_set_colon_regressions.rs(5),tests/issue2916_bind_keymap_option_case_regressions.rs(4) — all fail-first on master (9/10, 4/5, 3/4 red; the green ones are parity controls), green on this branch.本 PR 删除了什么
Nothing deleted. The change is additive: one new parse arm in
src/builtins/bind.rs, a widened token rule instrip_set_keyword, and a case fold in the-mvalidation. No legacy path became unreachable.Net lines
+608 / −30 (net +578) over 5 files:
src/builtins/bind.rsandsrc/executor/bind_builtins.rs(the arm, the token rule, the case fold) plus the three new pin stems (+322 test lines).Verification (lane-side, UNVERIFIED-BY-CAPTAIN)
Control-t: prefix-meta(see REPORT — GNU's keymap-valued ISKMAP bind has no kind in the flat registry model; the slot is occupied and listings agree apart from the prefix's sub-map rows).