int describekeybriefly(UNUSED(char **args)) { char *seq, *str, *msg, *is; Thingy func; if (statusline) return 1; clearlist = 1; statusline = "Describe key briefly: _"; zrefresh(); seq = getkeymapcmd(curkeymap, &func, &str); statusline = NULL; if(!*seq) return 1; msg = bindztrdup(seq); msg = appstr(msg, " is "); if (!func) is = bindztrdup(str); else is = nicedup(func->nam, 0); msg = appstr(msg, is); zsfree(is); showmsg(msg); zsfree(msg); return 0; }
int printbind(char *str, FILE *stream) { char *b = bindztrdup(str); int ret = zputs(b, stream); zsfree(b); return ret; }
static void scanfindfunc(char *seq, Thingy func, UNUSED(char *str), void *magic) { struct findfunc *ff = magic; if(func != ff->func) return; if (!ff->found++) ff->msg = appstr(ff->msg, " is on"); if(ff->found <= MAXFOUND) { char *b = bindztrdup(seq); ff->msg = appstr(ff->msg, " "); ff->msg = appstr(ff->msg, b); zsfree(b); } }