/** Symbols for actions. */
static MSymbol Minsert, Mdelete, Mmark, Mmove, Mpushback, Mundo, Mcall, Mshift;
-static MSymbol Mselect, Mshow, Mhide, Mcommit, Munhandle;
+static MSymbol Mselect, Mshow, Mhide, Mcommit, Munhandle, Mpop;
static MSymbol Mset, Madd, Msub, Mmul, Mdiv, Mequal, Mless, Mgreater;
static MSymbol Mless_equal, Mgreater_equal;
static MSymbol Mcond;
Mmove = msymbol ("move");
Mmark = msymbol ("mark");
Mpushback = msymbol ("pushback");
+ Mpop = msymbol ("pop");
Mundo = msymbol ("undo");
Mcall = msymbol ("call");
Mshift = msymbol ("shift");
MERROR (MERROR_IM, -1);
}
else if (action_name == Mshow || action_name == Mhide
- || action_name == Mcommit || action_name == Munhandle)
+ || action_name == Mcommit || action_name == Munhandle
+ || action_name == Mpop)
;
else if (action_name == Mcond)
{
}
}
}
+ else if (name == Mpop)
+ {
+ if (ic_info->key_head < ic_info->used)
+ MLIST_DELETE1 (ic_info, keys, ic_info->key_head, 1);
+ }
else if (name == Mcall)
{
MInputMethodInfo *im_info = (MInputMethodInfo *) ic->im->info;
{
/* The above branch actions didn't change the state. */
- /* If MAP is the root map of the initial state, it means
- that the current input method can not handle KEY. */
- if (map == ((MIMState *) MPLIST_VAL (im_info->states))->map)
+ /* If MAP is the root map of the initial state, and there
+ still exist an unhandled key, it means that the current
+ input method can not handle it. */
+ if (map == ((MIMState *) MPLIST_VAL (im_info->states))->map
+ && ic_info->key_head < ic_info->used)
{
MDEBUG_PRINT (" unhandled\n");
return -1;
current state. */
shift_state (ic, ic_info->state->name);
}
- else
+ else if (! map->branch_actions)
{
- /* MAP is the root map. Shift to the initial state. */
+ /* MAP is the root map without any default branch
+ actions. Shift to the initial state. */
shift_state (ic, Mnil);
}
}