From: Andre Noll Date: Tue, 8 Mar 2016 23:23:17 +0000 (+0100) Subject: i9e: print warning if keyseq can not be mapped. X-Git-Tag: v0.5.6~4^2~2 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=72330a682b4db019af84bf9a9ee09bb78681d4ad 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. --- 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)