}
+/* Return a plist containing an integer value of VAR. */
+
static MPlist *
resolve_variable (MInputContextInfo *ic_info, MSymbol var)
{
}
static int
-integer_value (MInputContext *ic, MPlist *arg, MPlist **value, int surrounding)
+integer_value (MInputContext *ic, MPlist *arg, int surrounding)
{
MInputContextInfo *ic_info = (MInputContextInfo *) ic->info;
int code, pos;
MText *preedit = ic->preedit;
int len = mtext_nchars (preedit);
- if (value)
- *value = NULL;
if (MPLIST_INTEGER_P (arg))
return MPLIST_INTEGER (arg);
{
MPlist *val = resolve_variable (ic_info, MPLIST_SYMBOL (arg));
- if (value)
- *value = val;
return (MPLIST_INTEGER_P (val) ? MPLIST_INTEGER (val) : 0);
}
if (code == '@')
pos = atoi (name + 1);
if (pos == 0)
return get_preceding_char (ic, 0);
- pos = ic->cursor_pos + pos;
+ if (pos < 0)
+ pos = ic->cursor_pos + pos;
+ else
+ pos = ic->cursor_pos + pos - 1;
if (pos < 0)
{
if (ic->produced && mtext_len (ic->produced) + pos >= 0)
mtext_len (ic->produced) + pos);
return get_preceding_char (ic, - pos);
}
- else
- pos--;
- if (pos >= len)
+ else if (pos >= len)
return get_following_char (ic, pos - len);
}
else
if (MPLIST_INTEGER_P (plist))
return MPLIST_INTEGER (plist);
if (MPLIST_SYMBOL_P (plist))
- return integer_value (ic, plist, NULL, 1);
+ return integer_value (ic, plist, 1);
if (! MPLIST_PLIST_P (plist))
return 0;
plist = MPLIST_PLIST (plist);
pl = MPLIST_NEXT (pl);
+ if (action_name == M_candidates)
+ {
+ /* This is an already regularised action. */
+ continue;
+ }
if (action_name == Minsert)
{
if (MPLIST_MTEXT_P (pl))
if (mtext_nchars (MPLIST_MTEXT (pl)) == 0)
MERROR (MERROR_IM, -1);
}
+ else if (MPLIST_INTEGER_P (pl))
+ {
+ int c = MPLIST_INTEGER (pl);
+
+ if (c < 0 || c > MCHAR_MAX)
+ MERROR (MERROR_IM, -1);
+ }
else if (MPLIST_PLIST_P (pl))
{
MPLIST_DO (pl, MPLIST_PLIST (pl))
im_info->cmds = mplist ();
if (! im_info->vars)
im_info->vars = mplist ();
+ if (! im_info->states)
+ im_info->states = mplist ();
}
if (! im_info->title
&& (key == Mnil || key == Mtitle))
to = 0;
else if (to > len)
to = len;
+ pos = to - ic->cursor_pos;
}
- MDEBUG_PRINT1 ("(%d)", to - ic->cursor_pos);
+ MDEBUG_PRINT1 ("(%d)", pos);
if (to < ic->cursor_pos)
preedit_delete (ic, to, ic->cursor_pos);
else if (to > ic->cursor_pos)
{
int intarg = (MPLIST_TAIL_P (args)
? ic_info->used - 2
- : integer_value (ic, args, NULL, 0));
+ : integer_value (ic, args, 0));
mtext_reset (ic->preedit);
mtext_reset (ic_info->preedit_saved);
|| name == Mmul || name == Mdiv)
{
MSymbol sym = MPLIST_SYMBOL (args);
+ MPlist *value = resolve_variable (ic_info, sym);
int val1, val2;
- MPlist *value;
char *op;
- val1 = integer_value (ic, args, &value, 0);
+ val1 = MPLIST_INTEGER (value);
args = MPLIST_NEXT (args);
val2 = resolve_expression (ic, args);
if (name == Mset)
val1 /= val2, op = "/=";
MDEBUG_PRINT4 ("(%s %s 0x%X(%d))",
MSYMBOL_NAME (sym), op, val1, val1);
- if (value)
- mplist_set (value, Minteger, (void *) val1);
+ mplist_set (value, Minteger, (void *) val1);
}
else if (name == Mequal || name == Mless || name == Mgreater
|| name == Mless_equal || name == Mgreater_equal)
´Ø¿ô minput_get_description () ¤Ï¡¢$LANGUAGE ¤È $NAME ¤Ë¤è¤Ã¤Æ»ØÄê
¤µ¤ì¤¿ÆþÎϥ᥽¥Ã¥É¤òÀâÌÀ¤¹¤ë M-text ¤òÊÖ¤¹¡£
- @return »ØÄꤵ¤ì¤¿ÆþÎϥ᥽¥Ã¥É¤¬ÀâÌÀ¤¹¤ë¥Æ¥¥¹¥È¤ò»ý¤Ã¤Æ¤¤¤ì¤Ð¡¢
+ @return
+ »ØÄꤵ¤ì¤¿ÆþÎϥ᥽¥Ã¥É¤¬ÀâÌÀ¤¹¤ë¥Æ¥¥¹¥È¤ò»ý¤Ã¤Æ¤¤¤ì¤Ð¡¢
#MText ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£¸Æ¤Ó½Ð¤·Â¦¤Ï¡¢¤½¤ì¤ò m17n_object_unref
() ¤òÍѤ¤¤Æ²òÊü¤·¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ÆþÎϥ᥽¥Ã¥É¤ËÀâÌÀ¥Æ¥¥¹¥È¤¬Ìµ¤±
¤ì¤Ð@c NULL ¤òÊÖ¤¹¡£ */
The minput_config_file () function returns the absolute path name
of per-user customization file into which minput_save_config ()
- save configurations. It is usually @c "config.mic" under the
- directory @c ".m17n.d" of user's home directory. It is not assured
- that the file of the returned name exists nor is
- readable/writable. If minput_save_config () fails and returns -1,
- an application program might check the file, make it
- writable (if possible), and try minput_save_config () again.
+ save configurations. It is usually @c config.mic under the
+ directory <tt>${HOME}/.m17n.d</tt> (${HOME} is user's home
+ directory). It is not assured that the file of the returned name
+ exists nor is readable/writable. If minput_save_config () fails
+ and returns -1, an application program might check the file, make
+ it writable (if possible), and try minput_save_config () again.
@return
¤³¤Î³ä¤êÅö¤Æ¤Ï¡¢³ä¤êÅö¤Æ°Ê¹ß¿·¤·¤¯¥ª¡¼¥×¥ó¤µ¤ì¤¿ÆþÎϥ᥽¥Ã¥É¤«¤éÍ
¸ú¤Ë¤Ê¤ë¡£
- @return ½èÍý¤¬À®¸ù¤¹¤ì¤Ð 0 ¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð -1 ¤òÊÖ¤·¡¢
+ @return
+ ½èÍý¤¬À®¸ù¤¹¤ì¤Ð 0 ¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð -1 ¤òÊÖ¤·¡¢
#merror_code ¤ò #MERROR_IM ¤ËÀßÄꤹ¤ë¡£ */
int