Author: yamamoto
Date: Sun Aug 14 08:43:29 2005
New Revision: 1197

Modified:
   trunk/scm/anthy-custom.scm
   trunk/scm/anthy-key-custom.scm
   trunk/scm/anthy.scm
   trunk/scm/generic-key-custom.scm

Log:
* scm/{anthy.scm, anthy-custom.scm, anthy-key-custom.scm}:
  New config option anthy-use-with-vi?.
  It is anthy version of skk-use-with-vi?.

* scm/generic-key-custom.scm:
  Add "<Control>[" to generic-cancel-key.


Modified: trunk/scm/anthy-custom.scm
==============================================================================
--- trunk/scm/anthy-custom.scm  (original)
+++ trunk/scm/anthy-custom.scm  Sun Aug 14 08:43:29 2005
@@ -282,3 +282,9 @@
                 'custom-set-hooks
                 (lambda ()
                   (anthy-configure-widgets)))
+
+(define-custom 'anthy-use-with-vi? #f
+  '(anthy special-op)
+  '(boolean)
+  (_ "Friendly for vi user")
+  (_ "long description will be here."))

Modified: trunk/scm/anthy-key-custom.scm
==============================================================================
--- trunk/scm/anthy-key-custom.scm      (original)
+++ trunk/scm/anthy-key-custom.scm      Sun Aug 14 08:43:29 2005
@@ -234,3 +234,9 @@
               '(key)
               (_ "[Anthy] go right")
               (_ "long description will be here"))
+
+(define-custom 'anthy-vi-escape-key '("escape" "<Control>[")
+               '(anthy-keys3)
+              '(key)
+              (_ "[Anthy] anthy-vi-escape-key?")
+              (_ "long description will be here"))

Modified: trunk/scm/anthy.scm
==============================================================================
--- trunk/scm/anthy.scm (original)
+++ trunk/scm/anthy.scm Sun Aug 14 08:43:29 2005
@@ -417,6 +417,14 @@
          (direct (ja-direct (charcode->string key)))
          (rule (anthy-context-input-rule ac)))
       (cond
+       ((and anthy-use-with-vi?
+             (anthy-vi-escape-key? key key-state))
+       (begin
+         (anthy-flush ac)
+         (anthy-context-set-on! ac #f)
+         (anthy-context-set-wide-latin! ac #f)
+          (anthy-commit-raw ac)))
+
        ((anthy-wide-latin-key? key key-state)
        (begin
          (anthy-flush ac)
@@ -920,6 +928,13 @@
           (w (or (ja-direct char)
                  (ja-wide char))))
       (cond
+       ((and anthy-use-with-vi?
+             (anthy-vi-escape-key? key key-state))
+       (begin
+         (anthy-flush ac)
+         (anthy-context-set-wide-latin! ac #f)
+          (anthy-commit-raw ac)))
+
        ((anthy-on-key? key key-state)
        (anthy-flush ac)
        (anthy-context-set-on! ac #t))
@@ -946,8 +961,7 @@
                (anthy-proc-wide-latin ac key key-state)
                (anthy-proc-raw-state ac key key-state))))
     ;; preedit
-    (anthy-update-preedit ac)
-))
+    (anthy-update-preedit ac)))
 
 
 (define anthy-release-key-handler

Modified: trunk/scm/generic-key-custom.scm
==============================================================================
--- trunk/scm/generic-key-custom.scm    (original)
+++ trunk/scm/generic-key-custom.scm    Sun Aug 14 08:43:29 2005
@@ -65,7 +65,7 @@
               (_ "[Global] commit")
               (_ "long description will be here"))
 
-(define-custom 'generic-cancel-key '("escape" "<IgnoreCase><Control>g")
+(define-custom 'generic-cancel-key '("escape" "<Control>[" 
"<IgnoreCase><Control>g")
                '(global-keys1)
               '(key)
               (_ "[Global] cancel")

Reply via email to