[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-readline] rl_bind_keyseq family functions don't create bindings in

From: Mark Karpov
Subject: [Bug-readline] rl_bind_keyseq family functions don't create bindings in some cases
Date: Sun, 04 Jan 2015 00:53:06 +0600

Found in Readline 6.3-release. ASUS K52D laptop, Arch Linux x86_64,
Linux 3.17.6-1 kernel.

According to description of rl_bind_keyseq (also rl_bind_keyseq_in_map,
rl_bind_keyseq_if_unbound, rl_bind_keyseq_if_unbound_in_map), this
function should create new keymap entries as necessary (actually "new
keymaps" in description, but I think "new keymap entries" is
meant). It doesn't work this way.

The function only rebinds already existing key sequences to new
functions, but it doesn't create new key sequences. It's seems like
there is no alternative way to bind a function to nonexistent key

C example:

#include <stdio.h>
#include <stdlib.h>
#include <readline/readline.h>

int foo (int arg, int key)
  rl_insert_text ("automagically inserted!");
  return 0;

int main (void)
  rl_initialize ();
  rl_bind_keyseq ("\\C-a", foo); // success - C-a is an existing keyseq
  rl_bind_keyseq ("\\C-q", foo); // no effect - can't create new keyseq
  readline (">>> ");
  return EXIT_SUCCESS;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]