Revision: 7366
Author:   deton.kih
Date:     Fri Nov 11 15:35:20 2011
Log:      * Add postfix kanji to sequence conversion.
* scm/tutcode-key-custom.scm
  - (tutcode-postfix-kanji2seq-start-sequence,
     tutcode-postfix-kanji2seq-1-start-sequence,
     tutcode-postfix-kanji2seq-2-start-sequence,
     tutcode-postfix-kanji2seq-3-start-sequence,
     tutcode-postfix-kanji2seq-4-start-sequence,
     tutcode-postfix-kanji2seq-5-start-sequence,
     tutcode-postfix-kanji2seq-6-start-sequence,
     tutcode-postfix-kanji2seq-7-start-sequence,
     tutcode-postfix-kanji2seq-8-start-sequence,
     tutcode-postfix-kanji2seq-9-start-sequence,
     tutcode-verbose-stroke-key): New custom.
* scm/tutcode-custom.scm
  - (tutcode-keep-illegal-sequence?): New custom.
  - (tutcode-delete-leading-space-on-postfix-kanji2seq?): New custom.
* scm/tutcode.scm
  - (tutcode-postfix-kanji2seq-delimiter-char-list): New variable.
  - (tutcode-commit-with-auto-help):
    Change to call tutcode-postfix-commit.
  - (tutcode-stroke-help-update-alist-with-rule):
    Add label for postfix kanji to sequence conversion key.
  - (tutcode-do-update-preedit): Add postfix kanji to sequence mode.
  - (tutcode-commit-editor-context):
    Change to call tutcode-postfix-commit.
  - (tutcode-proc-state-on):
    Change to commit the sequence by verbose stroke key
    in the middle of sequence.
    Change not to ignore illegal sequence.
    Add check of postfix kanji to sequence conversion start.
  - (tutcode-begin-postfix-bushu-conversion):
    Change to call tutcode-postfix-commit.
  - (tutcode-undo-prepare-postfix): Remove.
    Move into tutcode-postfix-commit.
  - (tutcode-postfix-commit):
    New function extracted from call of
    tutcode-undo-prepare-postfix and commit.
  - (tutcode-postfix-katakana-commit):
    Change to call tutcode-postfix-commit.
  - (tutcode-kanji-list->sequence,
     tutcode-begin-postfix-kanji2seq-conversion,
     tutcode-proc-state-postfix-kanji2seq): New function.
  - (tutcode-proc-state-yomi):
    Change to use the sequence by verbose strokey key
    in the middle of sequence.
    Change not to ignore illegal sequence.
    Change to call tutcode-postfix-commit.
  - (tutcode-state-has-preedit?): Add postfix kanji to sequence state.
  - (tutcode-key-press-handler): Add postfix kanji to sequence state.
  - (tutcode-custom-set-mazegaki/bushu-start-sequence!):
    Add postfix kanji to sequence start key sequences.
* scm/tutcode-rule.scm
  - (tutcode-rule):
    Move katakana rules which use uppercase keys to separate rule.
  - (tutcode-rule-uppercase-for-katakana):
    Extracted katakana rules which use uppercase keys from tutcode-rule.
  - (tutcode-rule-uppercase-for-kigou-in-katakana):
    Extracted kigou rules which use uppercase keys from tutcode-rule.
  - Add check not to add rules which use uppercase keys.

http://code.google.com/p/uim/source/detail?r=7366

Modified:
 /trunk/scm/tutcode-custom.scm
 /trunk/scm/tutcode-key-custom.scm
 /trunk/scm/tutcode-rule.scm
 /trunk/scm/tutcode.scm

=======================================
--- /trunk/scm/tutcode-custom.scm       Fri Oct 14 16:12:44 2011
+++ /trunk/scm/tutcode-custom.scm       Fri Nov 11 15:35:20 2011
@@ -122,6 +122,18 @@
   (N_ "Enable fallback of surrounding text API")
   (N_ "long description will be here."))

+(define-custom 'tutcode-keep-illegal-sequence? #f
+  '(tutcode)
+  '(boolean)
+  (N_ "Keep key sequence not convertible to Kanji")
+  (N_ "long description will be here."))
+
+(define-custom 'tutcode-delete-leading-delimiter-on-postfix-kanji2seq? #f
+  '(tutcode)
+  '(boolean)
+  (N_ "Delete leading delimiter on postfix kanji to sequence conversion")
+  (N_ "long description will be here."))
+
 (define-custom 'tutcode-history-size 0
   '(tutcode)
   '(integer 0 65535)
=======================================
--- /trunk/scm/tutcode-key-custom.scm   Tue Nov  8 14:10:16 2011
+++ /trunk/scm/tutcode-key-custom.scm   Fri Nov 11 15:35:20 2011
@@ -275,6 +275,66 @@
               (N_ "[TUT-Code] postfix katakana conversion of 9 characters")
               (N_ "long description will be here"))

+(define-custom 'tutcode-postfix-kanji2seq-start-sequence ""
+               '(tutcode-keys1)
+              '(string ".*")
+              (N_ "[TUT-Code] postfix kanji to sequence conversion")
+              (N_ "long description will be here"))
+
+(define-custom 'tutcode-postfix-kanji2seq-1-start-sequence ""
+               '(tutcode-keys1)
+              '(string ".*")
+ (N_ "[TUT-Code] postfix kanji to sequence conversion of 1 character")
+              (N_ "long description will be here"))
+
+(define-custom 'tutcode-postfix-kanji2seq-2-start-sequence ""
+               '(tutcode-keys1)
+              '(string ".*")
+ (N_ "[TUT-Code] postfix kanji to sequence conversion of 2 characters")
+              (N_ "long description will be here"))
+
+(define-custom 'tutcode-postfix-kanji2seq-3-start-sequence ""
+               '(tutcode-keys1)
+              '(string ".*")
+ (N_ "[TUT-Code] postfix kanji to sequence conversion of 3 characters")
+              (N_ "long description will be here"))
+
+(define-custom 'tutcode-postfix-kanji2seq-4-start-sequence ""
+               '(tutcode-keys1)
+              '(string ".*")
+ (N_ "[TUT-Code] postfix kanji to sequence conversion of 4 characters")
+              (N_ "long description will be here"))
+
+(define-custom 'tutcode-postfix-kanji2seq-5-start-sequence ""
+               '(tutcode-keys1)
+              '(string ".*")
+ (N_ "[TUT-Code] postfix kanji to sequence conversion of 5 characters")
+              (N_ "long description will be here"))
+
+(define-custom 'tutcode-postfix-kanji2seq-6-start-sequence ""
+               '(tutcode-keys1)
+              '(string ".*")
+ (N_ "[TUT-Code] postfix kanji to sequence conversion of 6 characters")
+              (N_ "long description will be here"))
+
+(define-custom 'tutcode-postfix-kanji2seq-7-start-sequence ""
+               '(tutcode-keys1)
+              '(string ".*")
+ (N_ "[TUT-Code] postfix kanji to sequence conversion of 7 characters")
+              (N_ "long description will be here"))
+
+(define-custom 'tutcode-postfix-kanji2seq-8-start-sequence ""
+               '(tutcode-keys1)
+              '(string ".*")
+ (N_ "[TUT-Code] postfix kanji to sequence conversion of 8 characters")
+              (N_ "long description will be here"))
+
+(define-custom 'tutcode-postfix-kanji2seq-9-start-sequence ""
+               '(tutcode-keys1)
+              '(string ".*")
+ (N_ "[TUT-Code] postfix kanji to sequence conversion of 9 characters")
+              (N_ "long description will be here"))
+
 (define-custom 'tutcode-latin-conv-start-sequence "al/"
                '(tutcode-keys1 mode-transition)
               '(string ".*")
@@ -424,3 +484,9 @@
               '(key)
               (N_ "[TUT-Code] relimit yomi to right in mazegaki")
               (N_ "long description will be here"))
+
+(define-custom 'tutcode-verbose-stroke-key '(" ")
+              '(tutcode-keys2)
+              '(key)
+              (N_ "[TUT-Code] insert pending key strokes")
+              (N_ "long description will be here"))
=======================================
--- /trunk/scm/tutcode-rule.scm Thu Jan  6 18:09:56 2011
+++ /trunk/scm/tutcode-rule.scm Fri Nov 11 15:35:20 2011
@@ -121,94 +121,6 @@
     ((("q" "l" "u"))("¤å" "¥å"))
     ((("q" "l" "j"))("¤ç" "¥ç"))
     ((("a" "l" "k"))("¤î" "¥î"))
-    ((("R" "K"))("¥¢"))
-    ((("R" "I"))("¥¤"))
-    ((("R" "U"))("¥¦"))
-    ((("R" "H"))("¥¨"))
-    ((("R" "J"))("¥ª"))
-    ((("E" "K"))("¥«"))
-    ((("E" "I"))("¥­"))
-    ((("E" "U"))("¥¯"))
-    ((("E" "H"))("¥±"))
-    ((("E" "J"))("¥³"))
-    ((("S" "K"))("¥µ"))
-    ((("S" "I"))("¥·"))
-    ((("S" "U"))("¥¹"))
-    ((("S" "H"))("¥»"))
-    ((("S" "J"))("¥½"))
-    ((("D" "K"))("¥¿"))
-    ((("D" "I"))("¥Á"))
-    ((("D" "U"))("¥Ä"))
-    ((("D" "H"))("¥Æ"))
-    ((("D" "J"))("¥È"))
-    ((("F" "K"))("¥Ê"))
-    ((("F" "I"))("¥Ë"))
-    ((("F" "U"))("¥Ì"))
-    ((("F" "H"))("¥Í"))
-    ((("F" "J"))("¥Î"))
-    ((("T" "K"))("¥Ï"))
-    ((("T" "I"))("¥Ò"))
-    ((("T" "U"))("¥Õ"))
-    ((("T" "H"))("¥Ø"))
-    ((("T" "J"))("¥Û"))
-    ((("W" "K"))("¥Þ"))
-    ((("W" "I"))("¥ß"))
-    ((("W" "U"))("¥à"))
-    ((("W" "H"))("¥á"))
-    ((("W" "J"))("¥â"))
-    ((("Q" "K"))("¥ä"))
-    ((("Q" "U"))("¥æ"))
-    ((("Q" "J"))("¥è"))
-    ((("G" "K"))("¥é"))
-    ((("G" "I"))("¥ê"))
-    ((("G" "U"))("¥ë"))
-    ((("G" "H"))("¥ì"))
-    ((("G" "J"))("¥í"))
-    ((("A" "K"))("¥ï"))
-    ((("A" "I"))("¥ð"))
-    ((("A" "H"))("¥ñ"))
-    ((("A" "J"))("¥ò"))
-    ((("R" "L" "K"))("¥¡"))
-    ((("R" "L" "I"))("¥£"))
-    ((("R" "L" "U"))("¥¥"))
-    ((("R" "L" "R" "U"))("¥ô"))
-    ((("R" "L" "H"))("¥§"))
-    ((("R" "L" "J"))("¥©"))
-    ((("E" "L" "K"))("¥¬"))
-    ((("E" "L" "E" "K"))("¥õ"))
-    ((("E" "L" "I"))("¥®"))
-    ((("E" "L" "U"))("¥°"))
-    ((("E" "L" "H"))("¥²"))
-    ((("E" "L" "E" "H"))("¥ö"))
-    ((("E" "L" "J"))("¥´"))
-    ((("S" "L" "K"))("¥¶"))
-    ((("S" "L" "I"))("¥¸"))
-    ((("S" "L" "U"))("¥º"))
-    ((("S" "L" "H"))("¥¼"))
-    ((("S" "L" "J"))("¥¾"))
-    ((("D" "L" "K"))("¥À"))
-    ((("D" "L" "I"))("¥Â"))
-    ((("D" "L" "U"))("¥Ã"))
-    ((("D" "L" "D" "U"))("¥Å"))
-    ((("D" "L" "H"))("¥Ç"))
-    ((("D" "L" "J"))("¥É"))
-    ((("F" "L"))("¥ó"))
-    ((("T" "L" "K"))("¥Ð"))
-    ((("T" "L" "I"))("¥Ó"))
-    ((("T" "L" "U"))("¥Ö"))
-    ((("T" "L" "H"))("¥Ù"))
-    ((("T" "L" "J"))("¥Ü"))
-    ((("T" "L" "T" "K"))("¥Ñ"))
-    ((("T" "L" "T" "I"))("¥Ô"))
-    ((("T" "L" "T" "U"))("¥×"))
-    ((("T" "L" "T" "H"))("¥Ú"))
-    ((("T" "L" "T" "J"))("¥Ý"))
-    ((("Q" "L" "K"))("¥ã"))
-    ((("Q" "L" "U"))("¥å"))
-    ((("Q" "L" "J"))("¥ç"))
-    ((("A" "L" "K"))("¥î"))
-    ((("E" " "))("¡¼"))
-    ((("O" " "))("¡¦"))
     ((("q" " "))("¡È"))
     ((("w" " "))("¢©"))
     ((("e" " "))("¡¼"))
@@ -2764,3 +2676,115 @@
     ((("z" "v" "p"))("ÌØ"))
     ((("z" "v" "u"))("ÅÎ"))
     ((("z" "v" "y"))("ºÖ"))))
+
+(define tutcode-rule-uppercase-for-katakana
+  '(
+    ((("R" "K"))("¥¢"))
+    ((("R" "I"))("¥¤"))
+    ((("R" "U"))("¥¦"))
+    ((("R" "H"))("¥¨"))
+    ((("R" "J"))("¥ª"))
+    ((("E" "K"))("¥«"))
+    ((("E" "I"))("¥­"))
+    ((("E" "U"))("¥¯"))
+    ((("E" "H"))("¥±"))
+    ((("E" "J"))("¥³"))
+    ((("S" "K"))("¥µ"))
+    ((("S" "I"))("¥·"))
+    ((("S" "U"))("¥¹"))
+    ((("S" "H"))("¥»"))
+    ((("S" "J"))("¥½"))
+    ((("D" "K"))("¥¿"))
+    ((("D" "I"))("¥Á"))
+    ((("D" "U"))("¥Ä"))
+    ((("D" "H"))("¥Æ"))
+    ((("D" "J"))("¥È"))
+    ((("F" "K"))("¥Ê"))
+    ((("F" "I"))("¥Ë"))
+    ((("F" "U"))("¥Ì"))
+    ((("F" "H"))("¥Í"))
+    ((("F" "J"))("¥Î"))
+    ((("T" "K"))("¥Ï"))
+    ((("T" "I"))("¥Ò"))
+    ((("T" "U"))("¥Õ"))
+    ((("T" "H"))("¥Ø"))
+    ((("T" "J"))("¥Û"))
+    ((("W" "K"))("¥Þ"))
+    ((("W" "I"))("¥ß"))
+    ((("W" "U"))("¥à"))
+    ((("W" "H"))("¥á"))
+    ((("W" "J"))("¥â"))
+    ((("Q" "K"))("¥ä"))
+    ((("Q" "U"))("¥æ"))
+    ((("Q" "J"))("¥è"))
+    ((("G" "K"))("¥é"))
+    ((("G" "I"))("¥ê"))
+    ((("G" "U"))("¥ë"))
+    ((("G" "H"))("¥ì"))
+    ((("G" "J"))("¥í"))
+    ((("A" "K"))("¥ï"))
+    ((("A" "I"))("¥ð"))
+    ((("A" "H"))("¥ñ"))
+    ((("A" "J"))("¥ò"))
+    ((("R" "L" "K"))("¥¡"))
+    ((("R" "L" "I"))("¥£"))
+    ((("R" "L" "U"))("¥¥"))
+    ((("R" "L" "R" "U"))("¥ô"))
+    ((("R" "L" "H"))("¥§"))
+    ((("R" "L" "J"))("¥©"))
+    ((("E" "L" "K"))("¥¬"))
+    ((("E" "L" "E" "K"))("¥õ"))
+    ((("E" "L" "I"))("¥®"))
+    ((("E" "L" "U"))("¥°"))
+    ((("E" "L" "H"))("¥²"))
+    ((("E" "L" "E" "H"))("¥ö"))
+    ((("E" "L" "J"))("¥´"))
+    ((("S" "L" "K"))("¥¶"))
+    ((("S" "L" "I"))("¥¸"))
+    ((("S" "L" "U"))("¥º"))
+    ((("S" "L" "H"))("¥¼"))
+    ((("S" "L" "J"))("¥¾"))
+    ((("D" "L" "K"))("¥À"))
+    ((("D" "L" "I"))("¥Â"))
+    ((("D" "L" "U"))("¥Ã"))
+    ((("D" "L" "D" "U"))("¥Å"))
+    ((("D" "L" "H"))("¥Ç"))
+    ((("D" "L" "J"))("¥É"))
+    ((("F" "L"))("¥ó"))
+    ((("T" "L" "K"))("¥Ð"))
+    ((("T" "L" "I"))("¥Ó"))
+    ((("T" "L" "U"))("¥Ö"))
+    ((("T" "L" "H"))("¥Ù"))
+    ((("T" "L" "J"))("¥Ü"))
+    ((("T" "L" "T" "K"))("¥Ñ"))
+    ((("T" "L" "T" "I"))("¥Ô"))
+    ((("T" "L" "T" "U"))("¥×"))
+    ((("T" "L" "T" "H"))("¥Ú"))
+    ((("T" "L" "T" "J"))("¥Ý"))
+    ((("Q" "L" "K"))("¥ã"))
+    ((("Q" "L" "U"))("¥å"))
+    ((("Q" "L" "J"))("¥ç"))
+    ((("A" "L" "K"))("¥î"))))
+
+(define tutcode-rule-uppercase-for-kigou-in-katakana
+  '(
+    ((("E" " "))("¡¼"))
+    ((("O" " "))("¡¦"))))
+
+;;; Âçʸ»ú¤Ç¥«¥¿¥«¥ÊÆþÎϤò¹Ô¤¦ÄêµÁ¤òÅÐÏ¿¤·¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤Ë¤Ï¡¢
+;;; ~/.uim¤Ë°Ê²¼¤Î¤è¤¦¤Ëµ­½Ò¤¹¤ë¡£
+;;;   (define tutcode-rule-exclude-uppercase-for-katakana? #t)
+;;; ¤Þ¤¿¡¢¥«¥¿¥«¥ÊÃæ¤Ë½Ð¸½¤¹¤ë¤³¤È¤Î¿¤¤"¡¼"¤È"¡¦"¤òÂçʸ»ú¤ÇÆþÎϤ¹¤ëÄêµÁ¤Î¤ß¤ò
+;;; ÅÐÏ¿¤·¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤Ë¤Ï¡¢~/.uim¤Ë°Ê²¼¤Î¤è¤¦¤Ëµ­½Ò¤¹¤ë¡£
+;;;   (define tutcode-rule-exclude-uppercase-for-kigou-in-katakana? #t)
+(if (or (not (symbol-bound? 'tutcode-rule-exclude-uppercase-for-katakana?))
+        (not tutcode-rule-exclude-uppercase-for-katakana?))
+  (set! tutcode-rule
+    (append
+      tutcode-rule
+      tutcode-rule-uppercase-for-katakana
+      (if (or (not (symbol-bound?
+                    'tutcode-rule-exclude-uppercase-for-kigou-in-katakana?))
+              (not tutcode-rule-exclude-uppercase-for-kigou-in-katakana?))
+        tutcode-rule-uppercase-for-kigou-in-katakana
+        ()))))
=======================================
--- /trunk/scm/tutcode.scm      Tue Nov  8 14:10:16 2011
+++ /trunk/scm/tutcode.scm      Fri Nov 11 15:35:20 2011
@@ -131,6 +131,31 @@
 ;;;  ÆÉ¤ß1ʸ»ú tutcode-postfix-katakana-1-start-sequence
 ;;;   ...
 ;;;  ÆÉ¤ß9ʸ»ú tutcode-postfix-katakana-9-start-sequence
+;;; * ¸åÃÖ·¿´Á»ú¢ªÆþÎÏ¥·¡¼¥±¥ó¥¹ÊÑ´¹
+;;;   TUT-Code¥ª¥ó¡¦¥ª¥Õ¤Î¥â¡¼¥ÉÀÚ¤êÂØ¤¨¤Ê¤·¤Ç±Ññ¸ì¤òÆþÎϤ·¤Æ¡¢
+;;;   ¸å¤«¤é±Ñ»ú²½¤¹¤ë¤¿¤á¤Îµ¡Ç½¤Ç¤¹¡£
+;;;   tutcode-keep-illegal-sequence?¤ò#t¤ËÀßÄꤷ¤¿¾å¤Ç¡¢
+;;; ±Ññ¸ìÆþÎϸå¤Ë¡¢tutcode-verbose-stroke-key(¥Ç¥Õ¥©¥ë¥È¤Ï¥¹¥Ú¡¼¥¹¥­¡¼)¤ò +;;; ÂǸ°¤¹¤ë¤³¤È¤Ç¥·¡¼¥±¥ó¥¹¤ò½ªÃ¼¤·¤¿¸å¤Ë¡¢°Ê²¼¤Î³«»Ï¥­¡¼¤òÆþÎϤ·¤Æ²¼¤µ¤¤¡£
+;;;   (ÊÑ´¹¸å¤Ë¡¢ºÇ¸å¤Îtutcode-verbose-stroke-key¤Ï¼«Æ°ºï½ü¤·¤Þ¤¹)
+;;; Îã:"undo "¤ÈÂǸ°¤¹¤ë¤È"¼ñ¡¦"¤Èɽ¼¨¤µ¤ì¡¢°Ê²¼¤Î³«»Ï¥­¡¼¤Ç¡¢"undo"¤ËÊÑ´¹¡£
+;;;               tutcode-postfix-kanji2seq-start-sequence
+;;;     ´Á»ú1ʸ»ú tutcode-postfix-kanji2seq-1-start-sequence
+;;;      ...
+;;;     ´Á»ú9ʸ»ú tutcode-postfix-kanji2seq-9-start-sequence
+;;;   ʸ»ú¿ô¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¡¢<¤È>¥­¡¼¤Ë¤è¤ê¡¢»ú¿ô¤Î¿­½Ì¤¬²Äǽ¤Ç¤¹¡£
+;;;   ʸ»ú¿ô¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¡¢±Ññ¸ìÆþÎÏÁ°¤Ë¥¹¥Ú¡¼¥¹¤òÆþÎϤ·¤Æ¤ª¤¯¤È¡¢
+;;;   ¥¹¥Ú¡¼¥¹¤è¤ê¸å¤Îʸ»ú¤ò±Ñ»ú¤ËÊÑ´¹¤·¤Þ¤¹¡£
+;;;   ¤³¤Î¤È¤­¡¢±Ññ¸ì¤Î¶èÀÚ¤ê¤Î¤¿¤á¤ËÆþÎϤ·¤¿¥¹¥Ú¡¼¥¹¤ò¼«Æ°ºï½ü¤¹¤ë¤Ë¤Ï¡¢
+;;;   tutcode-delete-leading-delimiter-on-postfix-kanji2seq?¤ò
+;;;   #t¤ËÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£
+;;;   Îã:" code "¤ÈÂǸ°¤¹¤ë¤È" ±é³Æ "¤Èɽ¼¨¤µ¤ì¡¢³«»Ï¥­¡¼¤Ç¡¢"code"¤ËÊÑ´¹¡£
+;;;   Ãí:±Ññ¸ìÃæ¤ËÁ°ÃÖ·¿¸ò¤¼½ñ¤­ÊÑ´¹³«»Ï¤Ê¤É¤Îµ¡Ç½¤ËÂФ¹¤ë¥·¡¼¥±¥ó¥¹¤¬
+;;;      ´Þ¤Þ¤ì¤Æ¤¤¤ë¤È¡¢³ºÅö¤¹¤ëµ¡Ç½¤¬¼Â¹Ô¤µ¤ì¤Æ¤·¤Þ¤¤¤Þ¤¹¡£
+;;;      ¸½¾õ¤Ç¤Ï¡¢¤½¤ì¤é¤Îµ¡Ç½¤ËÂФ¹¤ë¥·¡¼¥±¥ó¥¹¤ò¡¢
+;;;      ±Ññ¸ìÃæ¤Ç¤Ï½Ð¸½¤·¤Ê¤¤¥·¡¼¥±¥ó¥¹¤ËÊѹ¹¤¹¤ë¤³¤È¤Ç²óÈò¤·¤Æ¤¯¤À¤µ¤¤¡£
+;;; Îã:"/local/"¤ÈÂǤĤÈ"¼øºå"¤Î¸å¤Ë"al/"¤Ë¤è¤êÁ°ÃÖ·¿±Ñ»úÊÑ´¹¥â¡¼¥É¤¬³«»Ï
+;;;         (¤Ê¤ª¡¢"local/"¤Î¾ì¹ç¤Ï"Ìô»ùŬ"¤Ê¤Î¤ÇÌäÂê¤Ê¤·)
 ;;;
 ;;; ¡Ú¥Ø¥ë¥×µ¡Ç½¡Û
 ;;; * ²¾ÁÛ¸°È×ɽ¼¨(ɽ·Á¼°¤Î¸õÊ䥦¥£¥ó¥É¥¦¤òήÍÑ)
@@ -554,6 +579,12 @@
 (define tutcode-postfix-mazegaki-terminate-char-list
   '("\n" "\t" " " "¡¢" "¡£" "¡¤" "¡¥" "¡¦" "¡Ö" "¡×" "¡Ê" "¡Ë"))

+;;; ¸åÃÖ·¿´Á»ú¢ªÆþÎÏ¥·¡¼¥±¥ó¥¹ÊÑ´¹¤ÎÆÉ¤ß¼èÆÀ»þ¤Ë¡¢ÆÉ¤ß¤Ë´Þ¤á¤Ê¤¤Ê¸»ú¤Î¥ê¥¹¥È¡£
+;;; ¥¹¥Ú¡¼¥¹¤ò´Þ¤à±Ññ¸ì¤ÎÊÑ´¹¤ò³Ú¤Ë¤·¤¿¤¤¾ì¹ç¡¢'(":")Åù¤Ë¤¹¤ë¤³¤È¤òÁÛÄê¡£
+;;; ("\n" "\t"¤ÏḚ̂·¤¤¡£tutcode-delete-leading-delimiter-on-postfix-kanji2seq?
+;;;  ¤¬#t¤Î¾ì¹ç¤Ç¤âºï½ü¤·¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤¿¤á)
+(define tutcode-postfix-kanji2seq-delimiter-char-list '(" "))
+
 ;;; surrounding text API¤¬»È¤¨¤Ê¤¤»þ¤Ë¡¢Ê¸»úºï½ü¤Î¤¿¤á¤Ëcommit¤¹¤ëʸ»úÎó
 (define tutcode-fallback-backspace-string "\b")

@@ -719,6 +750,7 @@
      ;;; 'tutcode-state-kigou µ­¹æÆþÎϥ⡼¥É
      ;;; 'tutcode-state-history ¥Ò¥¹¥È¥êÆþÎϥ⡼¥É
      ;;; 'tutcode-state-postfix-katakana ¸åÃÖ·¿¥«¥¿¥«¥ÊÊÑ´¹Ãæ
+     ;;; 'tutcode-state-postfix-kanji2seq ¸åÃÖ·¿´Á»ú¢ªÆþÎÏ¥·¡¼¥±¥ó¥¹ÊÑ´¹Ãæ
      (list 'state 'tutcode-state-off)
      ;;; ¥«¥¿¥«¥Ê¥â¡¼¥É¤«¤É¤¦¤«
      ;;; #t: ¥«¥¿¥«¥Ê¥â¡¼¥É¡£#f: ¤Ò¤é¤¬¤Ê¥â¡¼¥É¡£
@@ -1339,11 +1371,8 @@
                          (list head (tutcode-context-latin-conv pc))))
(res (tutcode-prepare-commit-string pc))) ; flush¤Ë¤è¤êheadÅù¤¬¥¯¥ê¥¢
     (if (> yomi-len 0)
+      (tutcode-postfix-commit pc res yomi)
       (begin
-        (tutcode-postfix-delete-text pc yomi-len)
-        (tutcode-commit pc res)
-        (tutcode-undo-prepare-postfix pc res yomi))
-      (begin
         (tutcode-commit pc res)
         (if undo-data
           (tutcode-undo-prepare pc state res undo-data))))
@@ -1916,6 +1945,16 @@
             ((tutcode-postfix-katakana-7-start) "¥«7")
             ((tutcode-postfix-katakana-8-start) "¥«8")
             ((tutcode-postfix-katakana-9-start) "¥«9")
+            ((tutcode-postfix-kanji2seq-start) "/@")
+            ((tutcode-postfix-kanji2seq-1-start) "/1")
+            ((tutcode-postfix-kanji2seq-2-start) "/2")
+            ((tutcode-postfix-kanji2seq-3-start) "/3")
+            ((tutcode-postfix-kanji2seq-4-start) "/4")
+            ((tutcode-postfix-kanji2seq-5-start) "/5")
+            ((tutcode-postfix-kanji2seq-6-start) "/6")
+            ((tutcode-postfix-kanji2seq-7-start) "/7")
+            ((tutcode-postfix-kanji2seq-8-start) "/8")
+            ((tutcode-postfix-kanji2seq-9-start) "/9")
             ((tutcode-auto-help-redisplay) "¢ã")
             ((tutcode-help) "¡©")
             ((tutcode-help-clipboard) "?c")
@@ -2391,6 +2430,11 @@
         (im-pushback-preedit pc preedit-none "¡ù")
         (let ((h (string-list-concat (tutcode-context-head pc))))
           (if (string? h)
+            (im-pushback-preedit pc preedit-none h))))
+      ((tutcode-state-postfix-kanji2seq)
+        (im-pushback-preedit pc preedit-none "¡¿")
+        (let ((h (string-list-concat (tutcode-context-head pc))))
+          (if (string? h)
             (im-pushback-preedit pc preedit-none h)))))
     (if (not cursor-shown?)
       (im-pushback-preedit pc preedit-cursor ""))))
@@ -2414,10 +2458,8 @@
     (tutcode-context-set-child-type! pc ())
     (if (> yomi-len 0)
       (let ((yomi (take (tutcode-context-mazegaki-yomi-all pc) yomi-len)))
-        (tutcode-postfix-delete-text pc yomi-len)
-        (tutcode-flush pc)
-        (tutcode-commit pc commit-str)
-        (tutcode-undo-prepare-postfix pc commit-str yomi))
+        (tutcode-postfix-commit pc commit-str yomi)
+        (tutcode-flush pc))
       (begin
         (tutcode-flush pc)
         (tutcode-commit pc commit-str)))
@@ -2742,6 +2784,11 @@
      ;; reset-candidate-window¤Ç¥ê¥»¥Ã¥È¤µ¤ì¤ë¤Î¤ÇÊݸ¤·¤Æ¤ª¤¯
      (completing?
       (eq? (tutcode-context-predicting pc) 'tutcode-predicting-completion))
+     (rk-commit-flush
+      (lambda ()
+        (if tutcode-keep-illegal-sequence?
+          (tutcode-commit pc (rk-pending rkc) #f #t))
+        (rk-flush rkc)))
      ;; Êä´°¸õÊäɽ¼¨¤Î¥Ú¡¼¥¸°Üư»þ¤Ï¡¢reset-candidate-window¤·¤¿¤éÂÌÌÜ
      (prediction-keys-handled?
       (if completing?
@@ -2762,26 +2809,26 @@
           ((and
             (tutcode-vi-escape-key? key key-state)
             tutcode-use-with-vi?)
-           (rk-flush rkc)
+           (rk-commit-flush)
            (tutcode-context-set-commit-strs! pc ())
            (tutcode-context-set-state! pc 'tutcode-state-off)
            (tutcode-commit-raw pc key key-state)) ; ESC¥­¡¼¤ò¥¢¥×¥ê¤Ë¤âÅϤ¹
           ((tutcode-off-key? key key-state)
-           (rk-flush rkc)
+           (rk-commit-flush)
            (tutcode-context-set-commit-strs! pc ())
            (tutcode-context-set-state! pc 'tutcode-state-off))
           ((tutcode-on-key? key key-state) ; off-key¤Èon-key¤¬ÊÌ¥­¡¼¤Î¾ì¹ç
;; ¸½ºßon¤Ç¤âoff¤Ç¤â¡¢on-key¤Çon¤Ë¤·¤¿¤¤¤À¤±¤Ê¤Î¤Çcommit-raw¤ò²óÈò
-           (rk-flush rkc))
+           (rk-commit-flush))
           ((tutcode-kigou-toggle-key? key key-state)
-           (rk-flush rkc)
+           (rk-commit-flush)
            (tutcode-begin-kigou-mode pc))
           ((tutcode-kigou2-toggle-key? key key-state)
-           (rk-flush rkc)
+           (rk-commit-flush)
            (tutcode-toggle-kigou2-mode pc))
           ((and (tutcode-kana-toggle-key? key key-state)
                 (not (tutcode-kigou2-mode? pc)))
-           (rk-flush rkc)
+           (rk-commit-flush)
            (tutcode-context-kana-toggle pc))
           ((tutcode-backspace-key? key key-state)
            (if (> (length (rk-context-seq rkc)) 0)
@@ -2801,7 +2848,7 @@
            (tutcode-toggle-stroke-help pc))
           ((and tutcode-use-completion?
                 (tutcode-begin-completion-key? key key-state))
-           (rk-flush rkc)
+           (rk-commit-flush)
            (if completing?
;; Êä´°Ãæ¤Ëbegin-completin-key¤¬²¡¤µ¤ì¤¿¤éÂоÝʸ»ú¤ò1¸º¤é¤·¤ÆºÆÊä´° ;; (°Õ¿Þ¤·¤Ê¤¤Ê¸»úÎó¤ÇÊä´°¤µ¤ì¤¿¾ì¹ç¤Ë¡¢Êä´°¤·Ä¾¤·¤¬¤Ç¤­¤ë¤è¤¦¤Ë)
@@ -2820,7 +2867,7 @@
             (and
               (modifier-key-mask key-state)
               (not (shift-key-mask key-state))))
-           (rk-flush rkc)
+           (rk-commit-flush)
            (tutcode-commit-raw pc key key-state))
           ;; Êä´°¸õÊäÍÑ¥é¥Ù¥ë¥­¡¼?
((and completing? (tutcode-heading-label-char-for-prediction? key))
@@ -2831,7 +2878,14 @@
           ;; ´Ö°ã¤Ã¤¿¥­¡¼¤Ï»Ä¤Ã¤Æ¤·¤Þ¤¦¤Î¤Ç¡¢rk-push-key!¤Ï»È¤¨¤Ê¤¤)
           ((not (rk-expect-key? rkc (charcode->string key)))
            (if (> (length (rk-context-seq rkc)) 0)
-             (rk-flush rkc) ; Àµ¤·¤¯¤Ê¤¤¥·¡¼¥±¥ó¥¹¤Ï¼Î¤Æ¤ë
+             (begin
+               (cond
+                 ((tutcode-verbose-stroke-key? key key-state)
+                   (tutcode-commit pc (rk-pending rkc) #f #t))
+                 (tutcode-keep-illegal-sequence?
+                   (tutcode-commit pc (rk-pending rkc) #f #t)
+                   (tutcode-commit-raw pc key key-state)))
+               (rk-flush rkc))
              ;; ñÆÈ¤Î¥­¡¼ÆþÎÏ(TUT-CodeÆþÎϤǤʤ¯¤Æ)
              (tutcode-commit-raw pc key key-state)))
           (else
@@ -2931,6 +2985,26 @@
                 (tutcode-begin-postfix-katakana-conversion pc 8))
               ((eq? res 'tutcode-postfix-katakana-9-start)
                 (tutcode-begin-postfix-katakana-conversion pc 9))
+              ((eq? res 'tutcode-postfix-kanji2seq-start)
+                (tutcode-begin-postfix-kanji2seq-conversion pc #f))
+              ((eq? res 'tutcode-postfix-kanji2seq-1-start)
+                (tutcode-begin-postfix-kanji2seq-conversion pc 1))
+              ((eq? res 'tutcode-postfix-kanji2seq-2-start)
+                (tutcode-begin-postfix-kanji2seq-conversion pc 2))
+              ((eq? res 'tutcode-postfix-kanji2seq-3-start)
+                (tutcode-begin-postfix-kanji2seq-conversion pc 3))
+              ((eq? res 'tutcode-postfix-kanji2seq-4-start)
+                (tutcode-begin-postfix-kanji2seq-conversion pc 4))
+              ((eq? res 'tutcode-postfix-kanji2seq-5-start)
+                (tutcode-begin-postfix-kanji2seq-conversion pc 5))
+              ((eq? res 'tutcode-postfix-kanji2seq-6-start)
+                (tutcode-begin-postfix-kanji2seq-conversion pc 6))
+              ((eq? res 'tutcode-postfix-kanji2seq-7-start)
+                (tutcode-begin-postfix-kanji2seq-conversion pc 7))
+              ((eq? res 'tutcode-postfix-kanji2seq-8-start)
+                (tutcode-begin-postfix-kanji2seq-conversion pc 8))
+              ((eq? res 'tutcode-postfix-kanji2seq-9-start)
+                (tutcode-begin-postfix-kanji2seq-conversion pc 9))
               ((eq? res 'tutcode-history-start)
                 (tutcode-begin-history pc))
               ((eq? res 'tutcode-undo)
@@ -2948,9 +3022,7 @@
     ((former-seq (tutcode-postfix-acquire-text pc 2))
      (res (and (>= (length former-seq) 2)
(tutcode-bushu-convert (cadr former-seq) (car former-seq)))))
-    (tutcode-postfix-delete-text pc 2)
-    (tutcode-commit pc res)
-    (tutcode-undo-prepare-postfix pc res former-seq)
+    (tutcode-postfix-commit pc res former-seq)
     (tutcode-check-auto-help-window-begin pc (list res) ())))

 ;;; ¸åÃÖ·¿/Á°ÃÖ·¿ÊÑ´¹¤Î³ÎÄê¤òundo¤¹¤ë
@@ -2985,11 +3057,13 @@
     ;; XXX: ¿ÃÊundo¤Ï̤Âбþ
     (tutcode-context-set-undo! pc (list state commit-len data))))

-;;; ¸åÃÖ·¿ÊÑ´¹¤Î³ÎÄê¤òundo¤¹¤ë¤¿¤á¤Î½àÈ÷
-;;; @param commit-str ³ÎÄêʸ»úÎó
-;;; @param yomi-str ÊÑ´¹¸µ¤Îʸ»úÎó(ÆÉ¤ß/Éô¼ó)¤Î¥ê¥¹¥È(µÕ½ç)
-(define (tutcode-undo-prepare-postfix pc commit-str yomi-list)
-  (tutcode-undo-prepare pc 'tutcode-state-off commit-str yomi-list))
+;;; ¸åÃÖ·¿ÊÑ´¹¤ò³ÎÄꤹ¤ë
+;;; @param str ³ÎÄꤹ¤ëʸ»úÎó
+;;; @param yomi-list ÊÑ´¹¸µ¤Îʸ»úÎó(ÆÉ¤ß/Éô¼ó)¤Î¥ê¥¹¥È(µÕ½ç)
+(define (tutcode-postfix-commit pc str yomi-list)
+  (tutcode-postfix-delete-text pc (length yomi-list))
+  (tutcode-commit pc str)
+  (tutcode-undo-prepare pc 'tutcode-state-off str yomi-list))

 ;;; ¸åÃÖ·¿¸ò¤¼½ñ¤­ÊÑ´¹¤ò³«»Ï¤¹¤ë
 ;;; @param yomi-len »ØÄꤵ¤ì¤¿ÆÉ¤ß¤Îʸ»ú¿ô¡£»ØÄꤵ¤ì¤Æ¤Ê¤¤¾ì¹ç¤Ï#f¡£
@@ -3345,9 +3419,7 @@
 ;;; @param show-help? katakana¤¬1ʸ»ú¤Î¾ì¹ç¤Ë¼«Æ°¥Ø¥ë¥×¤òɽ¼¨¤¹¤ë¤«¤É¤¦¤«
 (define (tutcode-postfix-katakana-commit pc yomi katakana show-help?)
   (let ((str (string-list-concat katakana)))
-    (tutcode-postfix-delete-text pc (length yomi))
-    (tutcode-commit pc str)
-    (tutcode-undo-prepare-postfix pc str yomi)
+    (tutcode-postfix-commit pc str yomi)
     (tutcode-flush pc)
     (if (and show-help?
(= (length katakana) 1)) ; 1ʸ»ú¤Î¾ì¹ç¡¢¼«Æ°¥Ø¥ë¥×ɽ¼¨(tc2¤ÈƱÍÍ)
@@ -3421,6 +3493,119 @@
           head #f)
         (tutcode-proc-state-on pc key key-state)))))

+;;; ´Á»ú¤Î¥ê¥¹¥È¤òÆþÎÏ¥·¡¼¥±¥ó¥¹¤ËÊÑ´¹¤¹¤ë¡£
+;;; ´Á»úÆþÎϤò½ªÃ¼¤¹¤ë¤¿¤á¤ËÆþÎϤµ¤ì¤¿Í¾Ê¬¤Êverbose-stroke-key¤Ïºï½ü¤·¤ÆÊÖ¤¹¡£
+;;; @param kanji-list ´Á»úʸ»úÎó¥ê¥¹¥È(µÕ½ç)
+;;; @return ÆþÎÏ¥·¡¼¥±¥ó¥¹Ê¸»úÎó¥ê¥¹¥È(µÕ½ç)¡£
+;;;  ¤³¤Î¥·¡¼¥±¥ó¥¹¤òÆþÎϤ¹¤ì¤Ðkanji-list¤¬À¸À®¤µ¤ì¤ë¡£
+;;;XXX:¥³¡¼¥Éɽ¤Ë¡¢¤¢¤ë´Á»ú¤ËÂФ¹¤ëÊ£¿ô¤Î¥·¡¼¥±¥ó¥¹¤¬¤¢¤ë¾ì¹ç¡¢ºÇ½é¤Î¤â¤Î¤ò»ÈÍÑ
+;;;    ¥«¥¿¥«¥ÊÆþÎÏÍÑÂçʸ»úÄêµÁ¤â¤¢¤ë¾ì¹ç¡¢¾®Ê¸»ú¥·¡¼¥±¥ó¥¹¤¬»È¤ï¤ì¤ë¡£
+;;; Îã:"CODE "¤ÈÂǸ°¡¢"COD¡¼"¤Èɽ¼¨¡¢´Á»ú¢ªÆþÎÏ¥·¡¼¥±¥ó¥¹ÊÑ´¹¤¹¤ë¤È"CODe "
+(define (tutcode-kanji-list->sequence pc kanji-list)
+  (let*
+    ((rule (rk-context-rule (tutcode-context-rk-context pc)))
+     (allseq
+      (append-map
+        (lambda (x)
+          (let ((seq (tutcode-reverse-find-seq x rule)))
+            ;; ľÀÜÆþÎϤǤ­¤Ê¤¤¾ì¹ç¤Ï´Á»ú¤Î¤Þ¤Þ(XXX:Éô¼ó¹çÀ®ÊýË¡¤Þ¤Çɽ¼¨?)
+            (if seq (reverse seq) (list x))))
+        kanji-list)))
+    ;; ºÇ¸å¤Îverbose-stroke-key(Îã:":")¤Ï´Á»úÆþÎϤò½ªÃ¼¤¹¤ë¤¿¤á
+    ;; ;ʬ¤ËÆþÎϤµ¤ì¤¿²ÄǽÀ­¤¬¤¢¤ë¤Î¤Çºï¤ë
+    ;; Îã: "undo:"¢ª"¼ño"¢ª("o" "¼ñ")¡¢"code:"¢ª"±é³Æ:"¢ª(":" "³Æ" "±é")
+    (if (tutcode-verbose-stroke-key? (string->ichar (safe-car allseq)) 0)
+      (cdr allseq)
+      allseq)))
+
+;;; ¸åÃÖ·¿¤Î´Á»ú¢ªÆþÎÏ¥·¡¼¥±¥ó¥¹ÊÑ´¹¤ò³«»Ï¤¹¤ë
+;;; @param yomi-len »ØÄꤵ¤ì¤¿ÆÉ¤ß¤Îʸ»ú¿ô¡£»ØÄꤵ¤ì¤Æ¤Ê¤¤¾ì¹ç¤Ï#f¡£
+(define (tutcode-begin-postfix-kanji2seq-conversion pc yomi-len)
+  (let*
+    ((former-all (tutcode-postfix-acquire-text pc
+                  (or yomi-len tutcode-mazegaki-yomi-max)))
+     (former-seq
+      (if yomi-len
+        former-all
+        (let*
+ ;; verbose-stroke-key¤¬" "(¥Ç¥Õ¥©¥ë¥È)¤Î¾ì¹ç¡¢Í¾Ê¬¤ËÆþÎϤµ¤ì¤Æ¤ë¤È
+          ;; ²¿¤âtake¤µ¤ì¤Ê¤¤¤Î¤Ç¡¢Í¾Ê¬¤Êverbose-stroke-key¤Ï¥¹¥­¥Ã¥×¡£
+          ;; (tutcode-kanji-list->sequence¤Ç;ʬ¤Êverbose-stroke-key¤òºï½ü)
+ ;; Îã:"undo "¢ª"¼ñ¡¦"¢ª("¡¦" "¼ñ")¡¢"code "¢ª"±é³Æ "¢ª(" " "³Æ" "±é")
+          ((first (safe-car former-all))
+           (first-verbose-key?
+ (tutcode-verbose-stroke-key? (and first (string->ichar first)) 0))
+           (rest (if first-verbose-key? (cdr former-all) former-all))
+           (seq
+            (take-while
+              (lambda (elem)
+                (not (member elem
+                      (append tutcode-postfix-kanji2seq-delimiter-char-list
+                        '("\n" "\t")))))
+              rest)))
+          (if first-verbose-key?
+ (cons first seq) ; delete-text¤¹¤ëŤµ¤ò¹ç¤ï¤»¤ë¤¿¤áfirst¤ÏÆþ¤ì¤ë
+            seq))))
+     (former-len (length former-seq)))
+    (if yomi-len
+      (let*
+        ((yomi (if (> former-len yomi-len)
+                (take former-seq yomi-len)
+                former-seq))
+         (seq (tutcode-kanji-list->sequence pc yomi)))
+        (tutcode-postfix-commit pc (string-list-concat seq) yomi))
+      ;; ÆÉ¤ß¤Îʸ»ú¿ô¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤
+      (if (> former-len 0)
+        (begin
+          (tutcode-context-set-mazegaki-yomi-all! pc former-all)
+          (tutcode-context-set-postfix-yomi-len! pc former-len)
+          (tutcode-context-set-head! pc
+            (tutcode-kanji-list->sequence pc former-seq))
+ (tutcode-context-set-state! pc 'tutcode-state-postfix-kanji2seq))))))
+
+;;; ¸åÃÖ·¿¤Î´Á»ú¢ªÆþÎÏ¥·¡¼¥±¥ó¥¹ÊÑ´¹¥â¡¼¥É»þ¤Î¥­¡¼ÆþÎϤò½èÍý¤¹¤ë¡£
+;;; @param key ÆþÎϤµ¤ì¤¿¥­¡¼
+;;; @param key-state ¥³¥ó¥È¥í¡¼¥ë¥­¡¼Åù¤Î¾õÂÖ
+(define (tutcode-proc-state-postfix-kanji2seq c key key-state)
+  (let*
+    ((pc (tutcode-find-descendant-context c))
+     (head (tutcode-context-head pc))
+     (yomi-len (tutcode-context-postfix-yomi-len pc))
+     (yomi-all (tutcode-context-mazegaki-yomi-all pc))
+     (update-context!
+      (lambda (new-yomi-len)
+        (tutcode-context-set-postfix-yomi-len! pc new-yomi-len)
+        (tutcode-context-set-head! pc
+          (tutcode-kanji-list->sequence pc (take yomi-all new-yomi-len)))))
+     (commit
+      (lambda ()
+        (let*
+ ((len (if (and tutcode-delete-leading-delimiter-on-postfix-kanji2seq?
+                         (> (length yomi-all) yomi-len)
+                         (member (list-ref yomi-all yomi-len)
+                          tutcode-postfix-kanji2seq-delimiter-char-list))
+                  (+ yomi-len 1)
+                  yomi-len))
+           (yomi (take yomi-all len)))
+        (tutcode-postfix-commit pc (string-list-concat head) yomi)))))
+    (cond
+      ((tutcode-cancel-key? key key-state)
+        (tutcode-flush pc))
+      ((or (tutcode-commit-key? key key-state)
+           (tutcode-return-key? key key-state))
+        (commit)
+        (tutcode-flush pc))
+      ((tutcode-mazegaki-relimit-right-key? key key-state)
+        (if (> yomi-len 1)
+          (update-context! (- yomi-len 1))))
+      ((tutcode-mazegaki-relimit-left-key? key key-state)
+        (if (> (length yomi-all) yomi-len)
+          (update-context! (+ yomi-len 1))))
+      (else
+        (commit)
+        (tutcode-flush pc)
+        (tutcode-proc-state-on pc key key-state)))))
+
 ;;; ľÀÜÆþÎϾõÂ֤ΤȤ­¤Î¥­¡¼ÆþÎϤò½èÍý¤¹¤ë¡£
 ;;; @param c ¥³¥ó¥Æ¥­¥¹¥È¥ê¥¹¥È
 ;;; @param key ÆþÎϤµ¤ì¤¿¥­¡¼
@@ -3555,6 +3740,11 @@
             (tutcode-katakana-convert head
               (not (tutcode-context-katakana-mode? pc)))))
         (tutcode-flush pc)))
+     (rk-append-flush
+      (lambda ()
+        (if tutcode-keep-illegal-sequence?
+ (tutcode-context-set-head! pc (append (rk-context-seq rkc) head)))
+        (rk-flush rkc)))
      ;; reset-candidate-window¤Ç¥ê¥»¥Ã¥È¤µ¤ì¤ë¤Î¤ÇÊݸ¤·¤Æ¤ª¤¯
      (predicting?
       (eq? (tutcode-context-predicting pc) 'tutcode-predicting-prediction))
@@ -3581,10 +3771,10 @@
           ((and (tutcode-kana-toggle-key? key key-state)
                 (not (tutcode-context-latin-conv pc))
                 (not kigou2-mode?))
-           (rk-flush rkc)
+           (rk-append-flush)
            (tutcode-context-kana-toggle pc))
           ((tutcode-kigou2-toggle-key? key key-state)
-           (rk-flush rkc)
+           (rk-append-flush)
            (tutcode-toggle-kigou2-mode pc))
           ((tutcode-backspace-key? key key-state)
            (if (> (length (rk-context-seq rkc)) 0)
@@ -3605,7 +3795,7 @@
            (tutcode-toggle-stroke-help pc))
           ((and tutcode-use-prediction?
                 (tutcode-begin-completion-key? key key-state))
-           (rk-flush rkc)
+           (rk-append-flush)
            (if (not predicting?)
              (tutcode-check-prediction pc #t)))
;; ¸õÊä¿ô¤¬1¸Ä¤Î¾ì¹ç¡¢ÊÑ´¹¸å¼«Æ°³ÎÄꤵ¤ì¤Æconverting¥â¡¼¥É¤ËÆþ¤é¤Ê¤¤
@@ -3654,7 +3844,16 @@
              (set! res (charcode->string key))))
           ((not (rk-expect-key? rkc (charcode->string key)))
            (if (> (length (rk-context-seq rkc)) 0)
-             (rk-flush rkc)
+             (begin
+               (cond
+                 ((tutcode-verbose-stroke-key? key key-state)
+                   (tutcode-context-set-head! pc
+                     (append (rk-context-seq rkc) head)))
+                 (tutcode-keep-illegal-sequence?
+                   (tutcode-context-set-head! pc
+                     (append (rk-context-seq rkc) head))
+                   (set! res (charcode->string key))))
+               (rk-flush rkc))
              ;; space¥­¡¼¤Ç¤ÎÊÑ´¹³«»Ï?
              ;; (space¤Ï¥­¡¼¥·¡¼¥±¥ó¥¹¤Ë´Þ¤Þ¤ì¤ë¾ì¹ç¤¬¤¢¤ë¤Î¤Ç¡¢
              ;;  rk-expect¤Ëspace¤¬Ìµ¤¤¤³¤È¤¬¾ò·ï)
@@ -4233,10 +4432,7 @@
                                 postfix-yomi-len)))
                (commit-str (tutcode-prepare-commit-string pc)))
           (if (> postfix-yomi-len 0)
-            (begin
-              (tutcode-postfix-delete-text pc postfix-yomi-len)
-              (tutcode-commit pc commit-str)
-              (tutcode-undo-prepare-postfix pc commit-str yomi))
+            (tutcode-postfix-commit pc commit-str yomi)
             (tutcode-commit pc commit-str)))
         (tutcode-proc-state-on pc key key-state)))))

@@ -4874,7 +5070,7 @@
       '(tutcode-state-yomi tutcode-state-bushu tutcode-state-converting
         tutcode-state-interactive-bushu tutcode-state-kigou
         tutcode-state-code tutcode-state-history
-        tutcode-state-postfix-katakana))))
+        tutcode-state-postfix-katakana tutcode-state-postfix-kanji2seq))))

 ;;; ¥­¡¼¤¬²¡¤µ¤ì¤¿¤È¤­¤Î½èÍý¤Î¿¶¤êʬ¤±¤ò¹Ô¤¦¡£
 ;;; @param c ¥³¥ó¥Æ¥­¥¹¥È¥ê¥¹¥È
@@ -4917,6 +5113,9 @@
           ((tutcode-state-postfix-katakana)
            (tutcode-proc-state-postfix-katakana pc key key-state)
            (tutcode-update-preedit pc))
+          ((tutcode-state-postfix-kanji2seq)
+           (tutcode-proc-state-postfix-kanji2seq pc key key-state)
+           (tutcode-update-preedit pc))
           (else
            (tutcode-proc-state-off pc key key-state)
            (if (tutcode-state-has-preedit? c) ; ºÆµ¢³Ø½¬»þ
@@ -5574,6 +5773,26 @@
             '(tutcode-postfix-katakana-8-start))
           (make-subrule tutcode-postfix-katakana-9-start-sequence
             '(tutcode-postfix-katakana-9-start))
+          (make-subrule tutcode-postfix-kanji2seq-start-sequence
+            '(tutcode-postfix-kanji2seq-start))
+          (make-subrule tutcode-postfix-kanji2seq-1-start-sequence
+            '(tutcode-postfix-kanji2seq-1-start))
+          (make-subrule tutcode-postfix-kanji2seq-2-start-sequence
+            '(tutcode-postfix-kanji2seq-2-start))
+          (make-subrule tutcode-postfix-kanji2seq-3-start-sequence
+            '(tutcode-postfix-kanji2seq-3-start))
+          (make-subrule tutcode-postfix-kanji2seq-4-start-sequence
+            '(tutcode-postfix-kanji2seq-4-start))
+          (make-subrule tutcode-postfix-kanji2seq-5-start-sequence
+            '(tutcode-postfix-kanji2seq-5-start))
+          (make-subrule tutcode-postfix-kanji2seq-6-start-sequence
+            '(tutcode-postfix-kanji2seq-6-start))
+          (make-subrule tutcode-postfix-kanji2seq-7-start-sequence
+            '(tutcode-postfix-kanji2seq-7-start))
+          (make-subrule tutcode-postfix-kanji2seq-8-start-sequence
+            '(tutcode-postfix-kanji2seq-8-start))
+          (make-subrule tutcode-postfix-kanji2seq-9-start-sequence
+            '(tutcode-postfix-kanji2seq-9-start))
           (make-subrule tutcode-auto-help-redisplay-sequence
             '(tutcode-auto-help-redisplay))
           (make-subrule tutcode-help-sequence

Reply via email to