if (branch_actions)
M17N_OBJECT_REF (branch_actions);
}
- else if (im_info->maps
- && (plist = (MPlist *) mplist_get (im_info->maps, map_name)))
+ else if (im_info->maps)
{
- MPLIST_DO (plist, plist)
+ plist = (MPlist *) mplist_get (im_info->maps, map_name);
+ if (! plist)
{
- MPlist *keylist, *map_actions;
+ MPlist *p = mplist__assq (im_info->configured_vars, map_name);
- if (! MPLIST_PLIST_P (plist))
- MERROR (MERROR_IM, -1);
- keylist = MPLIST_PLIST (plist);
- map_actions = MPLIST_NEXT (keylist);
- if (MPLIST_SYMBOL_P (keylist))
+ if (p && MPLIST_PLIST_P (p))
+ {
+ p = MPLIST_NEXT (MPLIST_NEXT (MPLIST_NEXT (MPLIST_PLIST (p))));
+ if (MPLIST_SYMBOL_P (p))
+ plist = mplist_get (im_info->maps, MPLIST_SYMBOL (p));
+ }
+ }
+ if (plist)
+ {
+ MPLIST_DO (plist, plist)
{
- MSymbol command = MPLIST_SYMBOL (keylist);
- MPlist *pl;
+ MPlist *keylist, *map_actions;
- if (MFAILP (command != Mat_reload))
- continue;
- pl = resolve_command (im_info->configured_cmds, command);
- if (MFAILP (pl))
- continue;
- MPLIST_DO (pl, pl)
- load_translation (map, pl, map_actions, branch_actions,
+ if (! MPLIST_PLIST_P (plist))
+ MERROR (MERROR_IM, -1);
+ keylist = MPLIST_PLIST (plist);
+ map_actions = MPLIST_NEXT (keylist);
+ if (MPLIST_SYMBOL_P (keylist))
+ {
+ MSymbol command = MPLIST_SYMBOL (keylist);
+ MPlist *pl;
+
+ if (MFAILP (command != Mat_reload))
+ continue;
+ pl = resolve_command (im_info->configured_cmds, command);
+ if (MFAILP (pl))
+ continue;
+ MPLIST_DO (pl, pl)
+ load_translation (map, pl, map_actions, branch_actions,
+ im_info->macros);
+ }
+ else
+ load_translation (map, keylist, map_actions, branch_actions,
im_info->macros);
}
- else
- load_translation (map, keylist, map_actions, branch_actions,
- im_info->macros);
}
}
{
M17N_OBJECT_UNREF (mt);
mt = mtext__from_data (translated, strlen (translated),
- MTEXT_FORMAT_UTF_8, 0);
+ MTEXT_FORMAT_UTF_8, 1);
}
}
#endif
MPlist *config_cmds)
{
MPlist *global = NULL, *custom = NULL, *config = NULL;
- MSymbol name;
+ MSymbol name = MPLIST_SYMBOL (plist);
MSymbol status;
MPlist *description, *keyseq;
if (global_cmds && (global = mplist__assq (global_cmds, name)))
global = MPLIST_NEXT (MPLIST_PLIST (global));
- name = MPLIST_SYMBOL (plist);
plist = MPLIST_NEXT (plist);
if (MPLIST_MTEXT_P (plist) || MPLIST_PLIST_P (plist))
{
}
else if (custom_cmds && (custom = mplist__assq (custom_cmds, name)))
{
- custom = MPLIST_NEXT (MPLIST_PLIST (custom));
- if (! MPLIST_TAIL_P (custom))
+ MPlist *this_keyseq = MPLIST_NEXT (MPLIST_NEXT (MPLIST_PLIST (custom)));
+
+ if (MPLIST_TAIL_P (this_keyseq))
+ mplist__pop_unref (custom);
+ else
{
status = Mcustomized;
- keyseq = custom;
+ keyseq = this_keyseq;
}
}
}
else if (custom_vars && (custom = mplist__assq (custom_vars, name)))
{
- custom = MPLIST_NEXT (MPLIST_PLIST (custom));
- if (! MPLIST_TAIL_P (custom))
+ MPlist *this_value = MPLIST_NEXT (MPLIST_NEXT (MPLIST_PLIST (custom)));
+
+ if (MPLIST_TAIL_P (this_value))
+ mplist__pop_unref (custom);
+ else
{
- value = custom;
+ value = this_value;
if (MFAILP (check_variable_value (value, global ? global : plist)))
value = NULL;
status = Mcustomized;
if (mtext_nchars (ic->produced) > 0)
{
- MSymbol lang = msymbol_get (ic->im->language, Mlanguage);
-
if (mdebug__flag & mdebug_mask)
{
MDEBUG_PRINT (" (produced");
MDEBUG_PRINT (")");
}
- if (lang != Mnil)
- mtext_put_prop (ic->produced, 0, mtext_nchars (ic->produced),
- Mlanguage, ic->im->language);
+ mtext_put_prop (ic->produced, 0, mtext_nchars (ic->produced),
+ Mlanguage, ic->im->language);
}
if (ic_info->commit_key_head > 0)
{
}
else
{
- if (no_cutom)
+ if (no_custom)
mplist__pop_unref (plist);
else
{
@brief Get information about input method variable(s).
The minput_get_variable () function returns information about
- the variable $VARIABLE of the input method specified by $LANGUAGE and $NAME.
+ variable $VARIABLE of the input method specified by $LANGUAGE and $NAME.
An input method variable controls behavior of an input method.
There are two kinds of variables, global and local. A global
}
else
{
- plist = MPLIST_PLIST (plist); /* (NAME nil VALUE) */
- plist = MPLIST_NEXT (plist); /* ([nil VALUE]) */
- if (! MPLIST_TAIL_P (plist))
- return 0;
- mplist_set (plist, Mnil ,NULL);
+ if (no_custom)
+ mplist__pop_unref (plist);
+ else
+ {
+ plist = MPLIST_PLIST (plist); /* (NAME nil VALUE) */
+ plist = MPLIST_NEXT (plist); /* ([nil VALUE]) */
+ mplist_set (plist, Mnil ,NULL);
+ }
}
}
else
else
custom->cmds = mplist (), p = NULL;
elt = MPLIST_NEXT (elt);
- if (MPLIST_TAIL_P (elt))
+ if (p)
{
- if (p)
- {
- /* Make customization ignored. */
- p = MPLIST_NEXT (MPLIST_PLIST (p));
- mplist_set (p, Mnil, NULL);
- }
+ p = MPLIST_NEXT (MPLIST_NEXT (MPLIST_PLIST (p)));
+ mplist_set (p, Mnil, NULL);
}
else
{
- elt = MPLIST_NEXT (elt);
- if (p)
- {
- p = MPLIST_NEXT (MPLIST_NEXT (MPLIST_PLIST (p)));
- mplist_set (p, Mnil, NULL);
- mplist__conc (p, elt);
- }
- else
- {
- p = MPLIST_PLIST (pl);
- mplist_add (custom->cmds, Mplist, p);
- }
+ p = mplist ();
+ mplist_add (custom->cmds, Mplist, p);
+ M17N_OBJECT_UNREF (p);
+ mplist_add (p, Msymbol, command);
+ p = mplist_add (p, Msymbol, Mnil);
+ p = MPLIST_NEXT (p);
}
+ mplist__conc (p, elt);
}
if (config->vars)
MPLIST_DO (pl, config->vars)
else
custom->vars = mplist (), p = NULL;
elt = MPLIST_NEXT (elt);
- if (MPLIST_TAIL_P (elt))
+ if (p)
{
- if (p)
- mplist__pop_unref (p);
+ p = MPLIST_NEXT (MPLIST_NEXT (MPLIST_PLIST (p)));
+ mplist_set (p, Mnil, NULL);
}
else
{
- elt = MPLIST_NEXT (elt);
- if (p)
- {
- p = MPLIST_NEXT (MPLIST_NEXT (MPLIST_PLIST (p)));
- mplist_set (p, Mnil, NULL);
- mplist__conc (p, elt);
- }
- else
- {
- p = MPLIST_PLIST (pl);
- mplist_add (custom->vars, Mplist, p);
- }
+ p = mplist ();
+ mplist_add (custom->vars, Mplist, p);
+ M17N_OBJECT_UNREF (p);
+ mplist_add (p, Msymbol, variable);
+ p = mplist_add (p, Msymbol, Mnil);
+ p = MPLIST_NEXT (p);
}
+ mplist__conc (p, elt);
}
}
- M17N_OBJECT_UNREF (im_config_list);
+ free_im_list (im_config_list);
+ im_config_list = NULL;
/* Next, reflect customization to the actual plist to be written. */
data = tail = mplist ();