Skip to content

readline-set-option! doesn't allow for setting keybindings #790

@jpellegrini

Description

@jpellegrini

After I made the PR I realized this:

stklos> (define-external readline-parse-and-bind ((line :string)) :entry-name "rl_parse_and_bind" :return-type :int)

stklos> (readline-parse-and-bind "Control-f: \"define\"")

Now when the user hits C-f readline automatically inserts the word define 😄

It is also possible to not just include text, but do actions like resetting the terminal, etc.

It also works for setting variables, but then one needs to use the command set:

stklos> (readline-parse-and-bind "set blink-matching-paren off")
stklos> (readline-parse-and-bind "set blink-matching-paren on")

But the PR I made actually hardcoded the set in readline-set-option, so one cannot change keybindings... Maybe we should change this?

  1. Have a generic readline-config-line! instead of readline-set-option!?
  2. Keep readline-set-option! and include readline-set-keybinding?
  3. Keep readline-set-option! and include generic readline-config-line!?
  4. Keep it as it is?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions