diff options
author | Akinori Ito <aito@eie.yz.yamagata-u.ac.jp> | 2001-11-09 04:59:17 +0000 |
---|---|---|
committer | Akinori Ito <aito@eie.yz.yamagata-u.ac.jp> | 2001-11-09 04:59:17 +0000 |
commit | 6c63633545c254dc085402e0f927a6826d1dd229 (patch) | |
tree | 0126fb5598304c713ea1276e294da9098b5df3b4 /func.c | |
parent | Initial revision (diff) | |
download | w3m-6c63633545c254dc085402e0f927a6826d1dd229.tar.gz w3m-6c63633545c254dc085402e0f927a6826d1dd229.zip |
Updates from 0.2.1 into 0.2.1-inu-1.5release-0-2-1-inu-1-5
Diffstat (limited to 'func.c')
-rw-r--r-- | func.c | 36 |
1 files changed, 24 insertions, 12 deletions
@@ -24,6 +24,8 @@ initKeymap(void) int c; int f; int lineno; + int verbose = 1; + extern int str_to_bool(char *value, int old); if (!w3mNFuncList) w3mNFuncList = countFuncList(w3mFuncList); @@ -43,36 +45,46 @@ initKeymap(void) s = getWord(&p); if (*s == '#') /* comment */ continue; - if (strcmp(s, "keymap")) { /* error */ - emsg = Sprintf("line %d: keymap not found\n", lineno)->ptr; + if (! strcmp(s, "keymap")) + ; + else if (! strcmp(s, "verbose")) { + s = getWord(&p); + if (*s) + verbose = str_to_bool(s, verbose); + continue; + } else { /* error */ + emsg = Sprintf("line %d: syntax error '%s'", lineno, s)->ptr; record_err_message(emsg); - disp_message_nsec(emsg, FALSE, 1, TRUE, FALSE); + if (verbose) + disp_message_nsec(emsg, FALSE, 1, TRUE, FALSE); continue; } s = getQWord(&p); c = getKey(s); if (c < 0) { /* error */ - emsg = Sprintf("line %d: unknown key '%s'\n", lineno, s)->ptr; + emsg = Sprintf("line %d: unknown key '%s'", lineno, s)->ptr; record_err_message(emsg); - disp_message_nsec(emsg, FALSE, 1, TRUE, FALSE); + if (verbose) + disp_message_nsec(emsg, FALSE, 1, TRUE, FALSE); continue; } s = getWord(&p); f = getFuncList(s, w3mFuncList, w3mNFuncList); if (f < 0) { - emsg = Sprintf("line %d: invalid command '%s'\n", lineno, s)->ptr; + emsg = Sprintf("line %d: invalid command '%s'", lineno, s)->ptr; record_err_message(emsg); - disp_message_nsec(emsg, FALSE, 1, TRUE, FALSE); - f = FUNCNAME_nulcmd; + if (verbose) + disp_message_nsec(emsg, FALSE, 1, TRUE, FALSE); + continue; } if (c & K_ESCD) - EscDKeymap[c ^ K_ESCD] = (f >= 0) ? f : FUNCNAME_nulcmd; + EscDKeymap[c ^ K_ESCD] = f; else if (c & K_ESCB) - EscBKeymap[c ^ K_ESCB] = (f >= 0) ? f : FUNCNAME_nulcmd; + EscBKeymap[c ^ K_ESCB] = f; else if (c & K_ESC) - EscKeymap[c ^ K_ESC] = (f >= 0) ? f : FUNCNAME_nulcmd; + EscKeymap[c ^ K_ESC] = f; else - GlobalKeymap[c] = (f >= 0) ? f : FUNCNAME_nulcmd; + GlobalKeymap[c] = f; s = getQWord(&p); addKeyList(&w3mKeyList, c, s); } |