[uim-commit] r419 - trunk/scm
yamaken at freedesktop.org
yamaken at freedesktop.org
Mon Jan 31 04:41:18 PST 2005
Author: yamaken
Date: 2005-01-31 04:41:14 -0800 (Mon, 31 Jan 2005)
New Revision: 419
Modified:
trunk/scm/init.scm
trunk/scm/lazy-load.scm
trunk/scm/plugin.scm
Log:
* scm/init.scm
- (load-modules): Load actually enabled IMs only when (not
enable-lazy-loading?) rather than stupidly loading all installed
modules
* scm/plugin.scm
- (load-enabled-modules): New procedure moved and renamed from
load-stub-ims of scm/lazy-load.scm
* scm/lazy-load.scm
- (load-stub-ims): Remove
- (stub-im-generate-stub-im-list): Modify the stub-im template as
require-module'ing when (not enable-lazy-loading?)
Modified: trunk/scm/init.scm
===================================================================
--- trunk/scm/init.scm 2005-01-31 12:20:02 UTC (rev 418)
+++ trunk/scm/init.scm 2005-01-31 12:41:14 UTC (rev 419)
@@ -51,14 +51,12 @@
(define load-modules
(lambda ()
(if (getenv "LIBUIM_VANILLA")
- (set! enable-lazy-loading? #f))
+ (set! enable-lazy-loading? #f)
+ (begin
+ (if enable-lazy-loading?
+ (require "lazy-load.scm"))
+ (load-enabled-modules)))
- (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))))
Modified: trunk/scm/lazy-load.scm
===================================================================
--- trunk/scm/lazy-load.scm 2005-01-31 12:20:02 UTC (rev 418)
+++ trunk/scm/lazy-load.scm 2005-01-31 12:41:14 UTC (rev 419)
@@ -78,13 +78,15 @@
(name-str (symbol->string name)))
(string-append
"(if (memq '" name-str " enabled-im-list)\n"
- " (register-stub-im\n"
- " '" name-str "\n"
- " \"" (im-lang im) "\"\n"
- " \"" (im-encoding im) "\"\n"
- " \"" (im-name-label im) "\"\n"
- " \"" (im-short-desc im) "\"\n"
- " \"" (im-module-name im) "\"))\n")))
+ " (if enable-lazy-loading?\n"
+ " (register-stub-im\n"
+ " '" name-str "\n"
+ " \"" (im-lang im) "\"\n"
+ " \"" (im-encoding im) "\"\n"
+ " \"" (im-name-label im) "\"\n"
+ " \"" (im-short-desc im) "\"\n"
+ " \"" (im-module-name im) "\")\n"
+ " (require-module \"" (im-module-name im) "\")))\n")))
im-names)))
;; side effect: invoke require-module for all IM listed in
@@ -94,13 +96,3 @@
(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/plugin.scm
===================================================================
--- trunk/scm/plugin.scm 2005-01-31 12:20:02 UTC (rev 418)
+++ trunk/scm/plugin.scm 2005-01-31 12:41:14 UTC (rev 419)
@@ -130,3 +130,14 @@
(append orig-module-list installed-im-module-list))
(set! enabled-im-list
(append orig-enabled-list enabled-im-list))))))))
+
+
+;; TODO: write test
+(define load-enabled-modules
+ (lambda ()
+ (let* ((user-module-dir (string-append (getenv "HOME") "/.uim.d/plugin/"))
+ (file "stub-ims.scm") ;; should be renamed
+ (user-file (string-append user-module-dir file)))
+ (and (try-load file)
+ (or (try-load user-file)
+ #t)))))
More information about the Uim-commit
mailing list