From 72330a682b4db019af84bf9a9ee09bb78681d4ad Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 9 Mar 2016 00:23:17 +0100 Subject: [PATCH] i9e: print warning if keyseq can not be mapped. In i9e_open() we currently ignore errors from rl_generic_bind(), which is OK, but we should at least let the user know that the binding won't work. While at it, call rl_bind_keyseq_in_map() instead of rl_generic_bind() as the former function provides all we need and is simpler. Also fix the typo in the comment. --- interactive.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/interactive.c b/interactive.c index b5ee7977..9f8a5013 100644 --- a/interactive.c +++ b/interactive.c @@ -468,10 +468,12 @@ int i9e_open(struct i9e_client_info *ici, struct sched *s) if (ici->bound_keyseqs) { char *seq; int i; - /* bind each key sequence to the our dispatcher */ - for (i = 0; (seq = ici->bound_keyseqs[i]); i++) - rl_generic_bind(ISFUNC, seq, (char *)dispatch_key, - i9ep->bare_km); + /* bind each key sequence to our dispatcher */ + for (i = 0; (seq = ici->bound_keyseqs[i]); i++) { + if (rl_bind_keyseq_in_map(seq, + dispatch_key, i9ep->bare_km) != 0) + PARA_WARNING_LOG("could not bind #%d: %s\n", i, seq); + } i9ep->num_key_bindings = i; } if (ici->history_file) -- 2.39.5