X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Finput.c;h=3cc1086f5774d90e9154486ff79d70b7a8c899d1;hb=398685e3214363bc831a7c29f89e466a96b71e4a;hp=30a9ad8d51dc19e18aa4c44b8d8c6e527b80a082;hpb=b217a56d503fabd33f17d8766c1a203bd92f1664;p=m17n%2Fm17n-lib.git diff --git a/src/input.c b/src/input.c index 30a9ad8..3cc1086 100644 --- a/src/input.c +++ b/src/input.c @@ -1640,7 +1640,7 @@ check_description (MPlist *plist) { M17N_OBJECT_UNREF (mt); mt = mtext__from_data (translated, strlen (translated), - MTEXT_FORMAT_UTF_8, 0); + MTEXT_FORMAT_UTF_8, 1); } } #endif @@ -1778,15 +1778,18 @@ config_command (MPlist *plist, MPlist *global_cmds, MPlist *custom_cmds, status = Mconfigured; config = MPLIST_NEXT (MPLIST_PLIST (config)); if (! MPLIST_TAIL_P (config)) - keyseq = MPLIST_NEXT (config); + keyseq = config; } 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 = MPLIST_NEXT (custom); + keyseq = this_keyseq; } } @@ -2068,17 +2071,20 @@ config_variable (MPlist *plist, MPlist *global_vars, MPlist *custom_vars, config = MPLIST_NEXT (MPLIST_PLIST (config)); if (! MPLIST_TAIL_P (config)) { - value = MPLIST_NEXT (config); + value = config; if (MFAILP (check_variable_value (value, global ? global : plist))) value = NULL; } } 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 = MPLIST_NEXT (custom); + value = this_value; if (MFAILP (check_variable_value (value, global ? global : plist))) value = NULL; status = Mcustomized; @@ -4781,7 +4787,7 @@ minput_get_description (MSymbol language, MSymbol name) @c STATUS is a symbol representing how the key assignment is decided. The value is #Mnil (the default key assignment), #Mcustomized (the - key assignment is customized by per-user configuration file), or + key assignment is customized by per-user customization file), or #Mconfigured (the key assignment is set by the call of minput_config_command ()). For a local command only, it may also be #Minherited (the key assignment is inherited from the @@ -4833,12 +4839,13 @@ minput_get_description (MSymbol language, MSymbol name) @c DESCRIPTION ¤Ï¥³¥Þ¥ó¥É¤òÀâÌÀ¤¹¤ë M-text ¤Ç¤¢¤ë¤«¡¢ÀâÌÀ¤¬Ìµ¤¤¾ì¹ç¤Ë ¤Ï #Mnil ¤Ç¤¢¤ë¡£ - @c STATUS ¤Ï¥­¡¼³ä¤êÅö¤Æ¤¬¤É¤Î¤è¤¦¤ËÄê¤á¤é¤ì¤ë¤«¤ò¤¢¤é¤ï¤¹¥·¥ó¥Ü¥ë¤Ç¤¢ - ¤ê¡¢¤½¤ÎÃÍ¤Ï #Mnil ¡Ê¥Ç¥Õ¥©¥ë¥È¤Î³ä¤êÅö¤Æ¡Ë, #Mcustomized ¡Ê¥æ¡¼¥¶ - Ëè¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤Ë¤è¤Ã¤Æ¥«¥¹¥¿¥Þ¥¤¥º¤µ¤ì¤¿³ä¤êÅö¤Æ¡Ë, #Mconfigured - ¡Êminput_config_command ()¤ò¸Æ¤Ö¤³¤È¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¤ë³ä¤êÅö¤Æ¡Ë¤Î - ¤¤¤º¤ì¤«¤Ç¤¢¤ë¡£¥í¡¼¥«¥ë¥³¥Þ¥ó¥É¤Î¾ì¹ç¤Ë¤Ï¡¢#Minherited ¡ÊÂбþ¤¹¤ë - ¥°¥í¡¼¥Ð¥ë¥³¥Þ¥ó¥É¤«¤é¤Î·Ñ¾µ¤Ë¤è¤ë³ä¤êÅö¤Æ¡Ë¤Ç¤â¤è¤¤¡£ + @c STATUS ¤Ï¥­¡¼³ä¤êÅö¤Æ¤¬¤É¤Î¤è¤¦¤ËÄê¤á¤é¤ì¤ë¤«¤ò¤¢¤é¤ï¤¹¥·¥ó¥Ü¥ë + ¤Ç¤¢¤ê¡¢¤½¤ÎÃÍ¤Ï #Mnil ¡Ê¥Ç¥Õ¥©¥ë¥È¤Î³ä¤êÅö¤Æ¡Ë, #Mcustomized ¡Ê¥æ¡¼ + ¥¶Ëè¤Î¥«¥¹¥¿¥Þ¥¤¥º¥Õ¥¡¥¤¥ë¤Ë¤è¤Ã¤Æ¥«¥¹¥¿¥Þ¥¤¥º¤µ¤ì¤¿³ä¤êÅö¤Æ¡Ë, + #Mconfigured ¡Êminput_config_command ()¤ò¸Æ¤Ö¤³¤È¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¤ë + ³ä¤êÅö¤Æ¡Ë¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¡£¥í¡¼¥«¥ë¥³¥Þ¥ó¥É¤Î¾ì¹ç¤Ë¤Ï¡¢ + #Minherited ¡ÊÂбþ¤¹¤ë¥°¥í¡¼¥Ð¥ë¥³¥Þ¥ó¥É¤«¤é¤Î·Ñ¾µ¤Ë¤è¤ë³ä¤êÅö¤Æ¡Ë + ¤Ç¤â¤è¤¤¡£ @c KEYSEQ ¤Ï£±¤Ä°Ê¾å¤Î¥·¥ó¥Ü¥ë¤«¤é¤Ê¤ë plist ¤Ç¤¢¤ê¡¢³Æ¥·¥ó¥Ü¥ë¤Ï¥³¥Þ ¥ó¥É¤Ë³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¥­¡¼¥·¡¼¥¯¥¨¥ó¥¹¤òɽ¤¹¡£KEYSEQ ¤¬Ìµ¤¤¾ì¹ç¤Ï¡¢ @@ -4905,13 +4912,16 @@ minput_get_command (MSymbol language, MSymbol name, MSymbol command) If $KEYSEQLIST is a non-empty plist, it must be a list of key sequences, and each key sequence must be a plist of symbols. - If $KEYSEQLIST is an empty plist, the default key sequences of the - command for the input method is assigned to $COMMAND. + If $KEYSEQLIST is an empty plist, any configuration and + customization of the command are cancelled, and default key + sequences become effective. + + If $KEYSEQLIST is NULL, the configuration of the command is + canceled, and the original key sequences (what saved in per-user + customization file, or the default one) become effective. - If $KEYSEQLIST is NULL, the configuration of the command for the - input method is canceled, and the default key sequences become - effective. In such case, if $COMMAND is #Mnil, configurations for - all commands of the input method are canceled. + In the latter two cases, $COMMAND can be #Mnil to make all the + commands of the input method the target of the operation. If $NAME is #Mnil, this function configures the key assignment of a global command, not that of a specific input method. @@ -4919,11 +4929,10 @@ minput_get_command (MSymbol language, MSymbol name, MSymbol command) The configuration takes effect for input methods opened or re-opened later in the current session. In order to make the configuration take effect for the future session, it must be saved - in a per-user configuration file by the function + in a per-user customization file by the function minput_save_config (). @return - If the operation was successful, this function returns 0, otherwise returns -1. The operation fails in these cases: