>>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes:
Martin> It doesn't only happen to SELFINSERT. It happens to Martin> BREAKPARAGRAPH, BACKSPACE and DELETE too. Try for yourself! You are absolutely right! Here is an updated patch, which catches another case. I am afraid some other cases could be lurking somewhere, but it is difficult to know. This bug exists because of bug 1941. The fix I chose was to avoid updating menus/toolbars after INTERNAL commands. The question is whether we have other FuncRequests in the code that should be tagged as something else than INTERNAL. Anyway, the fixes below are essentially right, and if you cannot find other problems, I propose to apply the patch. JMarc
Index: src/ChangeLog =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v retrieving revision 1.2356 diff -u -p -r1.2356 ChangeLog --- src/ChangeLog 16 Jan 2006 15:17:17 -0000 1.2356 +++ src/ChangeLog 18 Jan 2006 14:05:28 -0000 @@ -1,3 +1,9 @@ +2006-01-18 Jean-Marc Lasgouttes <[EMAIL PROTECTED]> + + * kbmap.C (defkey): + * lyxfunc.C (processKeySym): make sure new FuncRequest objects + have origin set to KEYBOARD. + 2006-01-16 Jürgen Spitzmüller <[EMAIL PROTECTED]> * rowpainter.C (isCursorOnRow): do not exclude endpos(). Index: src/lyxfunc.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxfunc.C,v retrieving revision 1.674 diff -u -p -r1.674 lyxfunc.C --- src/lyxfunc.C 23 Dec 2005 12:19:56 -0000 1.674 +++ src/lyxfunc.C 18 Jan 2006 14:05:28 -0000 @@ -307,7 +307,8 @@ void LyXFunc::processKeySym(LyXKeySymPtr // by a binding if (keysym->isText() && keyseq.length() == 1) { lyxerr[Debug::KEY] << "isText() is true, inserting." << endl; - func = FuncRequest(LFUN_SELFINSERT); + func = FuncRequest(LFUN_SELFINSERT, + FuncRequest::KEYBOARD); } else { lyxerr[Debug::KEY] << "Unknown, !isText() - giving up" << endl; owner->message(_("Unknown function.")); @@ -318,7 +319,8 @@ void LyXFunc::processKeySym(LyXKeySymPtr if (func.action == LFUN_SELFINSERT) { if (encoded_last_key != 0) { string const arg(1, encoded_last_key); - dispatch(FuncRequest(LFUN_SELFINSERT, arg)); + dispatch(FuncRequest(LFUN_SELFINSERT, arg, + FuncRequest::KEYBOARD)); lyxerr[Debug::KEY] << "SelfInsert arg[`" << arg << "']" << endl; } Index: src/kbmap.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/kbmap.C,v retrieving revision 1.57 diff -u -p -r1.57 kbmap.C --- src/kbmap.C 8 Nov 2004 10:54:28 -0000 1.57 +++ src/kbmap.C 18 Jan 2006 14:05:28 -0000 @@ -274,6 +274,7 @@ void kb_keymap::defkey(kb_sequence * seq newone->mod = seq->modifiers[r]; if (r + 1 == seq->length()) { newone->func = func; + newone->func.origin = FuncRequest::KEYBOARD; newone->table.reset(); return; } else {