[uim-commit] r340 - trunk/scm

ekato@freedesktop.org ekato@freedesktop.org
Thu Jan 20 22:28:07 PST 2005


Author: ekato
Date: 2005-01-20 22:28:04 -0800 (Thu, 20 Jan 2005)
New Revision: 340

Modified:
   trunk/scm/skk-custom.scm
   trunk/scm/skk.scm
Log:
* scm/skk-custom.scm (skk-auto-start-henkan?) : New custom
  boolean variable.  Default is #t.
* scm/skk.scm (skk-auto-start-henkan-keyword-list) : New list of
  characters for starting auto conversion.
(skk-proc-state-kanji) : Enable auto conversion with some specific
  characters.


Modified: trunk/scm/skk-custom.scm
===================================================================
--- trunk/scm/skk-custom.scm	2005-01-20 22:09:27 UTC (rev 339)
+++ trunk/scm/skk-custom.scm	2005-01-21 06:28:04 UTC (rev 340)
@@ -102,6 +102,12 @@
   (_ "Commit candidate by heading label keys")
   (_ "long description will be here."))
 
+(define-custom 'skk-auto-start-henkan? #t
+  '(skk advanced)
+  '(boolean)
+  (_ "Enable auto convertion with key input of specific characters")
+  (_ "long description will be here."))
+
 (define-custom 'skk-dic-file-name (string-append (sys-datadir)
 						 "/skk/SKK-JISYO.L")
   '(skk)

Modified: trunk/scm/skk.scm
===================================================================
--- trunk/scm/skk.scm	2005-01-20 22:09:27 UTC (rev 339)
+++ trunk/scm/skk.scm	2005-01-21 06:28:04 UTC (rev 340)
@@ -77,6 +77,8 @@
 (define-key skk-vi-escape-key? '("escape" "<Control>["))
 (define-key skk-state-direct-no-preedit-nop-key? '("<Control>j" "<Control>J"))
 
+(define skk-auto-start-henkan-keyword-list '("¤ò" "¡¢" "¡£" "¡¥" "¡¤" "¡©" "¡×" "¡ª" "¡¨" "¡§" ")" ";" ":" "¡Ë" "¡É" "¡Û" "¡Ù" "¡Õ" "¡Ó" "¡Ñ" "¡Ï" "¡Í" "}" "]" "?" "." "," "!"))
+
 ;; style specification
 (define skk-style-spec
   '(;; (style-element-name . validator)
@@ -1140,20 +1142,32 @@
 	       (rk-push-key!
 		rkc
 		(charcode->string key)))
-	 (if (and res
-		  (= stat 'skk-state-kanji)
-		  (or
-		   (list? (car res))
-		   (not (string=? (car res) ""))))
-	     (skk-append-string sc res))
-	 (if (and res
-	 	  (= stat 'skk-state-okuri)
-		  (or
-		   (list? (car res))
-		   (not (string=? (car res) ""))))
-	     (begin
-	       (skk-append-okuri-string sc res)
-	       (skk-begin-conversion sc)))))
+	 (and
+	  (if (and
+	       skk-auto-start-henkan?
+	       (string-find skk-auto-start-henkan-keyword-list (car res)))
+	      (begin
+		(skk-context-set-okuri! sc (list res))
+		(skk-begin-conversion sc)
+		#f)
+	      #t)
+	  (if (and res
+		   (= stat 'skk-state-kanji)
+		   (or
+		    (list? (car res))
+		    (not (string=? (car res) ""))))
+	      (begin
+		(skk-append-string sc res)
+		#t)
+	      #t)
+	   (if (and res
+	 	    (= stat 'skk-state-okuri)
+		    (or
+		     (list? (car res))
+		     (not (string=? (car res) ""))))
+	       (begin
+		 (skk-append-okuri-string sc res)
+		 (skk-begin-conversion sc))))))
       #f)))
 
 (define skk-setup-child-context



More information about the Uim-commit mailing list