[uim-commit] r389 - in trunk: scm test

yamaken at freedesktop.org yamaken at freedesktop.org
Sat Jan 29 10:55:23 PST 2005


Author: yamaken
Date: 2005-01-29 10:55:21 -0800 (Sat, 29 Jan 2005)
New Revision: 389

Added:
   trunk/scm/manage-modules.scm
Modified:
   trunk/scm/Makefile.am
   trunk/scm/im-custom.scm
   trunk/scm/im.scm
   trunk/scm/init.scm
   trunk/scm/lazy-load.scm
   trunk/scm/load-action.scm
   trunk/scm/plugin.scm
   trunk/test/test-action.scm
   trunk/test/test-im.scm
   trunk/test/test-lazy-load.scm
Log:
* This commit simplifies complicated IM loading (including
  lazy-loading) process involving several state variables,

* scm/init.scm
  - (enable-action?): New variable
  - (load-modules): New procedure
  - Make direct IM lazy-loadable
  - Avoid full loading of IMs when LIBUIM_VANILLA=1
  - Move (require-custom "im-custom.scm") from im.scm
  - Move (require "key.scm") from im.scm
  - Simplify complicated IM loading process including lazy-loading
  - Resolve stub-im inconsistency problem between actually installed
    modules and generated in custom-global.scm
  - Support per-user plugin configuration file
    ~/.uim.d/plugin/installed-modules.scm
  - Support per-user stub-im file file
    ~/.uim.d/plugin/stub-ims.scm
* scm/im.scm
  - (register-im): Simplify rejection condition
  - Move (require-custom "im-custom.scm") to init.scm
  - Move (require "key.scm") to init.scm
* scm/plugin.scm
  - (installed-im-module-list): New variable
  - (load-module-conf): New procedure
* scm/im-custom.scm
  - (custom-installed-im-list):
    * Redefine as procedure
    * Remove conditional evaluation
  - (custom enabled-im-list):
    * Replace default value with '(direct) because normal
      initialization of libuim prepares proper enabled-im-list
    * Replace range definition in accordance with the condition
      custom-full-featured?
    * Remove complicated bootstrapping
  - (custom-hook-literalize-enabled-im-list): Removed. This also
    withdraws per-user-enabled-im-list-loaded? and
    im-lazy-loading-enabled?
  - (custom enable-lazy-loading?): New custom variable
* scm/lazy-load.scm
  - (stub-im-generate-stub-im-list):
    * Replace enabled-im-list acquisition code in accordance with the
      simplification
    * Modify stub-im definition code in accordance with simplification
      of lazy-loading process
  - (stub-im-generate-all-stub-im-list): Load all
    installed-im-module-list explicitly in accordance with change of
    IM loading process
  - (load-stub-ims): New procedure
* scm/load-action.scm
  - Replace conditional variable disable-action with enable-action?
* scm/manage-modules.scm
  - New file. Generates input method module configurations for plugin
    installation
  - (generate-installed-modules-scm, generate-stub-ims-scm): New
    procedure
* scm/Makefile.am
  - (scm_DATA): Replace enabled-ims.scm with stub-ims.scm
  - (SCM_FILES): Add manage-modules.scm
  - (installed-modules.scm):
    * Replace generation rule with manage-modules.scm
    * Now installed-modules.scm also contains enabled-im-list in
      addition to installed-im-module-list
  - (enabled-ims.scm): Withdraw the file and generation rule
  - (stub-ims.scm): New generation rule

* test/test-lazy-load.scm
  - (test stub-im-generate-stub-im-list, test
    stub-im-generate-all-stub-im-list): Follow the specification
    change
* test/test-im.scm
  - (testcase im im-management, testcase im im-custom):
    * Apply following changes to setup process to follow the
      specification changes
    * Load IM modules explicitly
    * Add test-im and test-im2 to enabled-im-list
* test/test-action.scm
  - (testcase action):
    * Load IM modules explicitly in setup process to follow the
      specification changes


Modified: trunk/scm/Makefile.am
===================================================================
--- trunk/scm/Makefile.am	2005-01-29 16:35:32 UTC (rev 388)
+++ trunk/scm/Makefile.am	2005-01-29 18:55:21 UTC (rev 389)
@@ -1,10 +1,11 @@
 EXTRA_DIST = $(SCM_FILES)
 scmdir = $(datadir)/uim
-scm_DATA = $(SCM_FILES) installed-modules.scm enabled-ims.scm
+scm_DATA = $(SCM_FILES) installed-modules.scm stub-ims.scm
 SCM_FILES = plugin.scm im.scm im-custom.scm lazy-load.scm init.scm \
  default.scm \
  util.scm key.scm ustr.scm action.scm load-action.scm i18n.scm \
  uim-sh.scm custom.scm custom-rt.scm \
+ manage-modules.scm \
  direct.scm \
  rk.scm \
  generic.scm generic-custom.scm generic-key-custom.scm \
@@ -57,19 +58,21 @@
 #  module_names += "scim"
 endif
 
+# TODO: resolve dependency to $(top_builddir)/uim/uim-sh in proper way
 installed-modules.scm: $(SCM_FILES)
-	echo ";; The described order of input methods affects which IM is preferred" >$@ && \
-	echo ";; at the default IM selection process for each locale. i.e. list" >>$@ && \
-	echo ";; preferable IM first for each language" >>$@ && \
-	echo -n "(define installed-im-module-list '(" >>$@ && \
-	echo -n '$(module_names)' >>$@ && \
-	echo '))' >>$@
+	$(MAKE) -C $(top_builddir)/uim uim-sh && \
+	echo -n >$@ && \
+	echo "(define installed-im-module-list '(" '$(module_names)' ")) \
+	      (require \"manage-modules.scm\") \
+	      (generate-installed-modules-scm)" \
+	| LIBUIM_VERBOSE=1 LIBUIM_VANILLA=1 LIBUIM_SCM_FILES=${PWD} \
+	  $(top_builddir)/uim/uim-sh -B >>$@
 
 # TODO: resolve dependency to $(top_builddir)/uim/uim-sh in proper way
-enabled-ims.scm: installed-modules.scm
+stub-ims.scm: installed-modules.scm
 	$(MAKE) -C $(top_builddir)/uim uim-sh && \
-	echo ";; Don't edit this file manually" >$@ && \
-	echo '(require "custom.scm") \
-	      (puts (custom-hook-literalize-enabled-im-list))' \
+	echo -n >$@ && \
+	echo "(require \"manage-modules.scm\") \
+	      (generate-stub-ims-scm)" \
 	| LIBUIM_VERBOSE=1 LIBUIM_VANILLA=1 LIBUIM_SCM_FILES=${PWD} \
 	  $(top_builddir)/uim/uim-sh -B >>$@

Modified: trunk/scm/im-custom.scm
===================================================================
--- trunk/scm/im-custom.scm	2005-01-29 16:35:32 UTC (rev 388)
+++ trunk/scm/im-custom.scm	2005-01-29 18:55:21 UTC (rev 389)
@@ -129,42 +129,38 @@
 ;;
 
 (define custom-installed-im-list
-  (begin
-    (if (symbol-bound? 'installed-im-module-list)
-	(for-each require-module installed-im-module-list))
-    (custom-im-list-as-choice-rec (reverse
-				   (alist-delete 'direct im-list eq?)))))
+  (lambda ()
+    (let ((orig-enabled-im-list enabled-im-list))
+      (set! enabled-im-list ())  ;; enable all IMs
+      (for-each require-module installed-im-module-list)
+      (set! enabled-im-list orig-enabled-im-list)
+      (custom-im-list-as-choice-rec (reverse
+				     (alist-delete 'direct im-list eq?))))))
 
-(define-custom 'enabled-im-list
-               (map custom-choice-rec-sym custom-installed-im-list)
+(define-custom 'enabled-im-list '(direct)
   '(global)
   (cons
    'ordered-list
-   custom-installed-im-list)
+   (if custom-full-featured?
+       (custom-installed-im-list)
+       ()))
   (_ "Enabled input methods")
   (_ "long description will be here."))
 
-;; bootstrap
-(if (and (symbol-bound? 'installed-im-module-list)
-	 (null? enabled-im-list))
-    (custom-set-value! 'enabled-im-list
-		       (map custom-choice-rec-sym custom-installed-im-list)))
-
-(define custom-hook-literalize-enabled-im-list
-  (lambda ()
-    (require "lazy-load.scm")
-    (string-append
-     "(define enabled-im-list "
-     (custom-value-as-literal 'enabled-im-list)
-     ")\n"
-     "(define per-user-enabled-im-list-loaded? #t)\n"
-     "(define im-lazy-loading-enabled? #t)\n\n"
-     (string-join "\n" (stub-im-generate-stub-im-list enabled-im-list)))))
-
 (custom-add-hook 'enabled-im-list
-		 'custom-literalize-hooks
-		 custom-hook-literalize-enabled-im-list)
+		 'custom-get-hooks
+		 (lambda ()
+		   (set! enabled-im-list (remove (lambda (name)
+						   (eq? name
+							'direct))
+						 enabled-im-list))))
 
+(define-custom 'enable-lazy-loading? #t
+  '(global advanced)
+  '(boolean)
+  (_ "Enable lazy input method loading for fast startup")
+  (_ "long description will be here."))
+
 ;;
 ;; im-switching
 ;;

Modified: trunk/scm/im.scm
===================================================================
--- trunk/scm/im.scm	2005-01-29 16:35:32 UTC (rev 388)
+++ trunk/scm/im.scm	2005-01-29 18:55:21 UTC (rev 389)
@@ -102,15 +102,15 @@
 	  (set! im-list (cons direct-im
 			      ordinary-im-list))))))
 
+;; TODO: rewrite test
 ;; accepts overwrite register
 ;; returns initial register or not
 (define register-im
   (lambda (name lang encoding label-name short-desc init-arg init release
 		mode key-press key-release reset
 		get-candidate set-candidate-index prop)
-    (and (or (memq name enabled-im-list)
-	     (not (assq 'direct im-list))  ;; bootstrap
-	     custom-full-featured?)
+    (and (or (null? enabled-im-list)  ;; bootstrap
+	     (memq name enabled-im-list))
 	 (let ((im (im-new name lang encoding label-name short-desc
 			   init-arg init release
 			   mode key-press key-release reset
@@ -311,6 +311,3 @@
 (define set-candidate-index
   (lambda (id idx)
     (invoke-handler im-set-candidate-index-handler id idx)))
-
-(require "key.scm")
-(require-custom "im-custom.scm")

Modified: trunk/scm/init.scm
===================================================================
--- trunk/scm/init.scm	2005-01-29 16:35:32 UTC (rev 388)
+++ trunk/scm/init.scm	2005-01-29 18:55:21 UTC (rev 389)
@@ -34,10 +34,7 @@
 ;; configuration for special platforms such as embedded environments
 ;;   -- YamaKen 2005-01-29
 
-(require "plugin.scm");
-(require "custom-rt.scm");
-(require "im.scm");
-(load "installed-modules.scm")
+(define enable-action? #t)
 
 (define load-user-conf
   (lambda ()
@@ -50,21 +47,34 @@
       (let ((succeeded (try-load file)))
 	(verbose orig-verbose)
 	succeeded))))
-      
 
-(or (and (symbol-bound? 'per-user-enabled-im-list-loaded?)
-	 per-user-enabled-im-list-loaded?)
-    (and (symbol-bound? 'im-lazy-loading-enabled?)
-	 im-lazy-loading-enabled?
-	 (try-load "enabled-ims.scm"))
-    (begin
-      (for-each require-module installed-im-module-list)
-      (define enabled-im-list (reverse (cons 'direct
-					     (map im-name im-list))))))
+(define load-modules
+  (lambda ()
+    (if (getenv "LIBUIM_VANILLA")
+	(set! enable-lazy-loading? #f))
 
-;; must be loaded at last of IMs
-(require-module "direct")
+    (or (getenv "LIBUIM_VANILLA")
+	(and enable-lazy-loading?
+	     (require "lazy-load.scm")
+	     (load-stub-ims))
+	(for-each require-module installed-im-module-list))
 
+    (if (not (memq 'direct enabled-im-list))
+	(set! enabled-im-list (append enabled-im-list '(direct))))
+
+    ;; must be loaded at last of IMs
+    (if (not (retrieve-im 'direct))
+	(require-module "direct"))))
+
+(require "plugin.scm");
+(require "custom-rt.scm");
+(require "key.scm")
+(require "im.scm");
+
+(load-module-conf)
+(require-custom "im-custom.scm")
+(load-modules)
+
 (or (getenv "LIBUIM_VANILLA")
     (load-user-conf)
     (load "default.scm"))

Modified: trunk/scm/lazy-load.scm
===================================================================
--- trunk/scm/lazy-load.scm	2005-01-29 16:35:32 UTC (rev 388)
+++ trunk/scm/lazy-load.scm	2005-01-29 18:55:21 UTC (rev 389)
@@ -65,29 +65,42 @@
 	   )
 	  (im-set-module-name! (retrieve-im name) module-name)))))
 
+;; TODO: rewrite test
 ;; side effect: invoke require-module for all installed IM modules
 (define stub-im-generate-stub-im-list
   (lambda (im-names)
-    (for-each require-module installed-im-module-list)
+    (let ((orig-enabled-im-list enabled-im-list))
+      (set! enabled-im-list ())  ;; enable all IMs
+      (for-each require-module installed-im-module-list)
+      (set! enabled-im-list orig-enabled-im-list))
     (map (lambda (name)
 	   (let* ((im (retrieve-im name))
 		  (name-str (symbol->string name)))
 	     (string-append
-	      "(if im-lazy-loading-enabled?\n"
-	      "  (begin\n"
-	      "    (require \"lazy-load.scm\")\n"
+	      "(if (memq '" name-str " enabled-im-list)\n"
 	      "    (register-stub-im\n"
 	      "     '" name-str "\n"
 	      "     \"" (im-lang im) "\"\n"
 	      "     \"" (im-encoding im) "\"\n"
 	      "     \"" (im-label-name im) "\"\n"
 	      "     \"" (im-short-desc im) "\"\n"
-	      "     \"" (im-module-name im) "\")))\n")))
+	      "     \"" (im-module-name im) "\"))\n")))
 	 im-names)))
 
 ;; side effect: invoke require-module for all IM listed in
 ;; installed-im-module-list
 (define stub-im-generate-all-stub-im-list
   (lambda ()
+    (for-each require-module installed-im-module-list)
     (stub-im-generate-stub-im-list (map im-name
 					(reverse im-list)))))
+
+;; TODO: write test
+(define load-stub-ims
+  (lambda ()
+    (let* ((user-module-dir (string-append (getenv "HOME") "/.uim.d/plugin/"))
+	   (file "stub-ims.scm")
+	   (user-file (string-append user-module-dir file)))
+      (and (try-load file)
+	   (or (try-load user-file)
+	       #t)))))

Modified: trunk/scm/load-action.scm
===================================================================
--- trunk/scm/load-action.scm	2005-01-29 16:35:32 UTC (rev 388)
+++ trunk/scm/load-action.scm	2005-01-29 18:55:21 UTC (rev 389)
@@ -29,8 +29,8 @@
 ;;; SUCH DAMAGE.
 ;;;;
 
-(if (and (symbol-bound? 'disable-action)
-	 disable-action)
+(if enable-action?
+    (require "action.scm")
     (begin
       (define do-nothing
 	(lambda args
@@ -43,5 +43,4 @@
       (define context-init-widgets do-nothing)
       (define context-update-widgets do-nothing)
       (define context-prop-activate-handler do-nothing)
-      (define context-mode-handler do-nothing))
-    (require "action.scm"))
+      (define context-mode-handler do-nothing)))

Added: trunk/scm/manage-modules.scm
===================================================================
--- trunk/scm/manage-modules.scm	2005-01-29 16:35:32 UTC (rev 388)
+++ trunk/scm/manage-modules.scm	2005-01-29 18:55:21 UTC (rev 389)
@@ -0,0 +1,59 @@
+;;; manage-modules.scm: Generates input method module configurations
+;;;
+;;; Copyright (c) 2005 uim Project http://uim.freedesktop.org/
+;;;
+;;; All rights reserved.
+;;;
+;;; Redistribution and use in source and binary forms, with or without
+;;; modification, are permitted provided that the following conditions
+;;; are met:
+;;; 1. Redistributions of source code must retain the above copyright
+;;;    notice, this list of conditions and the following disclaimer.
+;;; 2. Redistributions in binary form must reproduce the above copyright
+;;;    notice, this list of conditions and the following disclaimer in the
+;;;    documentation and/or other materials provided with the distribution.
+;;; 3. Neither the name of authors nor the names of its contributors
+;;;    may be used to endorse or promote products derived from this software
+;;;    without specific prior written permission.
+;;;
+;;; THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+;;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+;;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+;;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+;;; OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+;;; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+;;; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+;;; OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+;;; SUCH DAMAGE.
+;;;;
+
+(require "lazy-load.scm")
+(require "custom.scm")
+(require-custom "im-custom.scm")
+
+;; TODO: write test
+;; define installed-im-module-list before invocation
+(define generate-installed-modules-scm
+  (lambda ()
+    (set! enabled-im-list
+	  (map custom-choice-rec-sym (custom-installed-im-list)))
+    (puts
+     (string-append
+      ";; The described order of input methods affects which IM is preferred\n"
+      ";; at the default IM selection process for each locale. i.e. list\n"
+      ";; preferable IM first for each language\n"
+      "(define installed-im-module-list "
+      (custom-list-as-literal installed-im-module-list)
+      ")\n"
+      (custom-definition-as-literal 'enabled-im-list)
+      "\n"))))
+
+;; TODO: write test
+(define generate-stub-ims-scm
+  (lambda ()
+    (puts
+     (string-append
+      ";; Don't edit this file manually\n"
+      (string-join "\n" (stub-im-generate-all-stub-im-list))))))

Modified: trunk/scm/plugin.scm
===================================================================
--- trunk/scm/plugin.scm	2005-01-29 16:35:32 UTC (rev 388)
+++ trunk/scm/plugin.scm	2005-01-29 18:55:21 UTC (rev 389)
@@ -101,6 +101,7 @@
 ;; feel bad about the meaning of 'module', post your opinion to
 ;; uim at fdo.
 
+(define installed-im-module-list ())
 (define currently-loading-module-name #f)
 
 ;;
@@ -113,3 +114,19 @@
 			 (try-require (string-append module-name ".scm")))))
       (set! currently-loading-module-name #f)
       succeeded)))
+
+;; TODO: write test
+(define load-module-conf
+  (lambda ()
+    (let* ((user-module-dir (string-append (getenv "HOME") "/.uim.d/plugin/"))
+	   (conf-file "installed-modules.scm")
+	   (user-conf-file (string-append user-module-dir conf-file)))
+      (try-load conf-file)
+      (if (not (getenv "LIBUIM_VANILLA"))
+	  (let ((orig-module-list installed-im-module-list)
+		(orig-enabled-list enabled-im-list))
+	    (and (try-load user-conf-file)
+		 (set! installed-im-module-list
+		       (append orig-module-list installed-im-module-list))
+		 (set! enabled-im-list
+		       (append orig-enabled-list enabled-im-list))))))))

Modified: trunk/test/test-action.scm
===================================================================
--- trunk/test/test-action.scm	2005-01-29 16:35:32 UTC (rev 388)
+++ trunk/test/test-action.scm	2005-01-29 18:55:21 UTC (rev 389)
@@ -29,7 +29,7 @@
 ;;; SUCH DAMAGE.
 ;;;;
 
-;; This file is tested with revision 1648
+;; This file is tested with revision 389 of new repository
 
 (use test.unit)
 
@@ -43,6 +43,7 @@
 	 (require "load-action.scm")
 	 (require "rk.scm")
 	 (require "japanese.scm")
+	 (require-module "anthy")
 
 	 (set! widget-proto-list ())
 	 (set! action-list ())

Modified: trunk/test/test-im.scm
===================================================================
--- trunk/test/test-im.scm	2005-01-29 16:35:32 UTC (rev 388)
+++ trunk/test/test-im.scm	2005-01-29 18:55:21 UTC (rev 389)
@@ -49,6 +49,12 @@
   (setup
    (lambda ()
      (uim '(begin
+	     (require-module "anthy")
+	     (require-module "canna")
+	     (require-module "skk")
+	     (require-module "tcode")
+	     (set! enabled-im-list (append enabled-im-list
+					   '(test-im test-im2)))
 	     (for-each require-module installed-im-module-list)
 	     (define prev-im #f)
 	     (define prev-nr-ims (length im-list))
@@ -842,6 +848,14 @@
   )
 
 (define-uim-test-case "testcase im im-custom"
+  (setup
+   (lambda ()
+     (uim '(begin
+	     (require-module "anthy")
+	     (require-module "canna")
+	     (require-module "skk")
+	     (require-module "tcode")))))
+
   ("test custom-im-list-as-choice-rec"
    (assert-equal '((canna "Canna" "Japanese Kana Kanji Conversion Engine, Canna")
 		   (skk "SKK" "Uim's SKK like input method")

Modified: trunk/test/test-lazy-load.scm
===================================================================
--- trunk/test/test-lazy-load.scm	2005-01-29 16:35:32 UTC (rev 388)
+++ trunk/test/test-lazy-load.scm	2005-01-29 18:55:21 UTC (rev 389)
@@ -132,120 +132,108 @@
 		 (uim '(stub-im-generate-stub-im-list ())))
    (assert-equal (list
 		  (string-append
-		   "(if im-lazy-loading-enabled?\n"
-		   "  (begin\n"
-		   "    (require \"lazy-load.scm\")\n"
+		   "(if (memq 'hangul2 enabled-im-list)\n"
 		   "    (register-stub-im\n"
 		   "     'hangul2\n"
 		   "     \"ko\"\n"
 		   "     \"UTF-8\"\n"
 		   "     \"Hangul (2-bul)\"\n"
 		   "     \"2-bul style hangul input method\"\n"
-		   "     \"hangul\")))\n"))
+		   "     \"hangul\"))\n"))
 		 (uim '(stub-im-generate-stub-im-list '(hangul2))))
    (assert-equal (list
 		  (string-append
-		   "(if im-lazy-loading-enabled?\n"
-		   "  (begin\n"
-		   "    (require \"lazy-load.scm\")\n"
+		   "(if (memq 'hangul3 enabled-im-list)\n"
 		   "    (register-stub-im\n"
 		   "     'hangul3\n"
 		   "     \"ko\"\n"
 		   "     \"UTF-8\"\n"
 		   "     \"Hangul (3-bul)\"\n"
 		   "     \"3-bul style hangul input method\"\n"
-		   "     \"hangul\")))\n"))
+		   "     \"hangul\"))\n"))
 		 (uim '(stub-im-generate-stub-im-list '(hangul3))))
    (assert-equal (list
 		  (string-append
-		   "(if im-lazy-loading-enabled?\n"
-		   "  (begin\n"
-		   "    (require \"lazy-load.scm\")\n"
+		   "(if (memq 'tcode enabled-im-list)\n"
 		   "    (register-stub-im\n"
 		   "     'tcode\n"
 		   "     \"ja\"\n"
 		   "     \"EUC-JP\"\n"
 		   "     \"T-Code\"\n"
 		   "     \"T-Code\"\n"
-		   "     \"tcode\")))\n"))
+		   "     \"tcode\"))\n"))
 		 (uim '(stub-im-generate-stub-im-list '(tcode))))
 
    (assert-equal (list
 		  (string-append
-		   "(if im-lazy-loading-enabled?\n"
-		   "  (begin\n"
-		   "    (require \"lazy-load.scm\")\n"
+		   "(if (memq 'hangul2 enabled-im-list)\n"
 		   "    (register-stub-im\n"
 		   "     'hangul2\n"
 		   "     \"ko\"\n"
 		   "     \"UTF-8\"\n"
 		   "     \"Hangul (2-bul)\"\n"
 		   "     \"2-bul style hangul input method\"\n"
-		   "     \"hangul\")))\n")
+		   "     \"hangul\"))\n")
 		  (string-append
-		   "(if im-lazy-loading-enabled?\n"
-		   "  (begin\n"
-		   "    (require \"lazy-load.scm\")\n"
+		   "(if (memq 'tcode enabled-im-list)\n"
 		   "    (register-stub-im\n"
 		   "     'tcode\n"
 		   "     \"ja\"\n"
 		   "     \"EUC-JP\"\n"
 		   "     \"T-Code\"\n"
 		   "     \"T-Code\"\n"
-		   "     \"tcode\")))\n")
+		   "     \"tcode\"))\n")
 		  (string-append
-		   "(if im-lazy-loading-enabled?\n"
-		   "  (begin\n"
-		   "    (require \"lazy-load.scm\")\n"
+		   "(if (memq 'hangul3 enabled-im-list)\n"
 		   "    (register-stub-im\n"
 		   "     'hangul3\n"
 		   "     \"ko\"\n"
 		   "     \"UTF-8\"\n"
 		   "     \"Hangul (3-bul)\"\n"
 		   "     \"3-bul style hangul input method\"\n"
-		   "     \"hangul\")))\n"))
+		   "     \"hangul\"))\n"))
 		 (uim '(stub-im-generate-stub-im-list '(hangul2 tcode hangul3)))))
 
   ("test stub-im-generate-all-stub-im-list"
-   (uim '(set! im-list (filter (lambda (im)
-				 (case (im-name im)
-				   ((hangul2 hangul3 tcode) #t)
-				   (else #f)))
-			       im-list)))
+   (uim '(set! im-list ()))
+   (uim '(set! installed-im-module-list '("tcode" "hangul")))
    (assert-equal (list
 		  (string-append
-		   "(if im-lazy-loading-enabled?\n"
-		   "  (begin\n"
-		   "    (require \"lazy-load.scm\")\n"
+		   "(if (memq 'tcode enabled-im-list)\n"
 		   "    (register-stub-im\n"
 		   "     'tcode\n"
 		   "     \"ja\"\n"
 		   "     \"EUC-JP\"\n"
 		   "     \"T-Code\"\n"
 		   "     \"T-Code\"\n"
-		   "     \"tcode\")))\n")
+		   "     \"tcode\"))\n")
 		  (string-append
-		   "(if im-lazy-loading-enabled?\n"
-		   "  (begin\n"
-		   "    (require \"lazy-load.scm\")\n"
+		   "(if (memq 'hangul2 enabled-im-list)\n"
 		   "    (register-stub-im\n"
 		   "     'hangul2\n"
 		   "     \"ko\"\n"
 		   "     \"UTF-8\"\n"
 		   "     \"Hangul (2-bul)\"\n"
 		   "     \"2-bul style hangul input method\"\n"
-		   "     \"hangul\")))\n")
+		   "     \"hangul\"))\n")
 		  (string-append
-		   "(if im-lazy-loading-enabled?\n"
-		   "  (begin\n"
-		   "    (require \"lazy-load.scm\")\n"
+		   "(if (memq 'hangul3 enabled-im-list)\n"
 		   "    (register-stub-im\n"
 		   "     'hangul3\n"
 		   "     \"ko\"\n"
 		   "     \"UTF-8\"\n"
 		   "     \"Hangul (3-bul)\"\n"
 		   "     \"3-bul style hangul input method\"\n"
-		   "     \"hangul\")))\n"))
+		   "     \"hangul\"))\n")
+		  (string-append
+		   "(if (memq 'romaja enabled-im-list)\n"
+		   "    (register-stub-im\n"
+		   "     'romaja\n"
+		   "     \"ko\"\n"
+		   "     \"UTF-8\"\n"
+		   "     \"Hangul (Romaja)\"\n"
+		   "     \"Romaja input style hangul input method\"\n"
+		   "     \"hangul\"))\n"))
 		 (uim '(stub-im-generate-all-stub-im-list)))
 
    (uim '(set! im-list ()))



More information about the Uim-commit mailing list