- if (lexrc.next())
- auto_region_delete = lexrc.GetBool();
- break;
-
- case RC_BIND:
- {
- // we should not do an explicit binding before
- // loading a bind file. So, in this case, load
- // the default bind file.
- if (!hasBindFile) {
- ReadBindFile();
- bind_file = bindFile;
- }
- // !!!chb, dynamic key binding...
- int action, res = 0;
- string seq, cmd;
-
- if (lexrc.lex() == LyXLex::LEX_DATA) {
- seq = lexrc.GetString();
- } else {
- lexrc.printError("Bad key sequence: `$$Token'");
- break;
- }
-
- if (lexrc.lex() == LyXLex::LEX_DATA) {
- cmd = lexrc.GetString();
- } else {
- lexrc.printError("Bad command: `$$Token'");
- break;
- }
-
- if ((action = lyxaction.LookupFunc(cmd))>= 0) {
- if (lyxerr.debugging(Debug::KBMAP)) {
- lyxerr << "RC_BIND: Sequence `"
- << seq << "' Command `"
- << cmd << "' Action `"
- << action << '\'' << endl;
- }
- res = toplevel_keymap->bind(seq, action);
- if (res != 0) {
- lexrc.printError(
- "Invalid key sequence `"
- + seq + '\'');
- }
- } else {// cmd is the last token read.
- lexrc.printError(
- "Unknown LyX function `$$Token'");