472
/* Let user unbind a sequence from a given (or all) menus */
473
void parse_unbinding(char *ptr)
475
char *keyptr = NULL, *keycopy = NULL, *menuptr = NULL;
482
rcfile_error(N_("Missing key name"));
487
ptr = parse_next_word(ptr);
488
keycopy = mallocstrcpy(NULL, keyptr);
489
for (i = 0; i < strlen(keycopy); i++)
490
keycopy[i] = toupper(keycopy[i]);
493
fprintf(stderr, "Starting unbinding code");
496
if (keycopy[0] != 'M' && keycopy[0] != '^' && keycopy[0] != 'F' && keycopy[0] != 'K') {
498
N_("keybindings must begin with \"^\", \"M\", or \"F\""));
503
ptr = parse_next_word(ptr);
505
if (!strcmp(menuptr, "")) {
507
/* Note to translators, do not translate the word "all"
508
in the sentence below, everything else is fine */
509
N_("Must specify menu to bind key to (or \"all\")"));
513
menu = strtomenu(menuptr);
516
N_("Could not map name \"%s\" to a menu"), menuptr);
522
fprintf(stderr, "unbinding \"%s\" from menu = %d\n", keycopy, menu);
525
/* Now find the apropriate entries in the menu to delete */
526
for (s = sclist; s != NULL; s = s->next) {
527
if (((s->menu & menu)) && !strcmp(s->keystr,keycopy)) {
530
fprintf(stderr, "deleted menu entry %d\n", s->menu);
474
537
/* Read and parse additional syntax files. */
475
538
void parse_include(char *ptr)
895
958
parse_colors(ptr, TRUE);
896
959
else if (strcasecmp(keyword, "bind") == 0)
897
960
parse_keybinding(ptr);
961
else if (strcasecmp(keyword, "unbind") == 0)
962
parse_unbinding(ptr);
898
963
#endif /* ENABLE_COLOR */
900
965
rcfile_error(N_("Command \"%s\" not understood"), keyword);