[uim-commit] r1863 - branches/0.4/scm

yamaken at freedesktop.org yamaken at freedesktop.org
Thu Oct 20 20:44:21 PDT 2005


Author: yamaken
Date: 2005-10-20 20:44:12 -0700 (Thu, 20 Oct 2005)
New Revision: 1863

Modified:
   branches/0.4/scm/custom-rt.scm
   branches/0.4/scm/custom.scm
   branches/0.4/scm/prime-custom.scm
Log:
* scm/custom.scm
* scm/prime-custom.scm
* scm/custom-rt.scm
  - Port r1861-1862 from trunk


Modified: branches/0.4/scm/custom-rt.scm
===================================================================
--- branches/0.4/scm/custom-rt.scm	2005-10-21 01:48:45 UTC (rev 1862)
+++ branches/0.4/scm/custom-rt.scm	2005-10-21 03:44:12 UTC (rev 1863)
@@ -64,6 +64,7 @@
 				".scm")))
       (try-load path))))
 
+;; TODO: disable all newly defined customs when an error occurred in loading
 ;; full implementation
 (define require-custom
   (lambda (filename)

Modified: branches/0.4/scm/custom.scm
===================================================================
--- branches/0.4/scm/custom.scm	2005-10-21 01:48:45 UTC (rev 1862)
+++ branches/0.4/scm/custom.scm	2005-10-21 03:44:12 UTC (rev 1863)
@@ -391,16 +391,12 @@
 ;; API
 (define custom-group-label
   (lambda (gsym)
-    (if (custom-group-rec gsym)
-	(custom-group-rec-label (custom-group-rec gsym))
-	(string-append "Error: " gsym " not found."))))
+    (custom-group-rec-label (custom-group-rec gsym))))
 
 ;; API
 (define custom-group-desc
   (lambda (gsym)
-    (if (custom-group-rec gsym)
-	(custom-group-rec-desc (custom-group-rec gsym))
-	(string-append "Error: " gsym " not found."))))
+    (custom-group-rec-desc (custom-group-rec gsym))))
 
 ;; API
 (define custom-group-subgroups
@@ -510,6 +506,14 @@
 			(cdr groups)))
 	   (modified-groups (cons primary-grp subgrps))
 	   (crec (custom-rec-new sym default modified-groups type label desc)))
+      ;; See also require-custom for error handling TODO
+      (for-each (lambda (gsym)
+		  (or (custom-group-rec gsym)
+		      (error (string-append "undefined group '"
+					    (symbol->string gsym)
+					    "' is referred by "
+					    (symbol->string sym)))))
+		modified-groups)
       (set! custom-rec-alist (alist-replace crec custom-rec-alist))
       (custom-call-hook-procs primary-grp custom-group-update-hooks)
       (if (not (symbol-bound? sym))

Modified: branches/0.4/scm/prime-custom.scm
===================================================================
--- branches/0.4/scm/prime-custom.scm	2005-10-21 01:48:45 UTC (rev 1862)
+++ branches/0.4/scm/prime-custom.scm	2005-10-21 03:44:12 UTC (rev 1863)
@@ -47,7 +47,7 @@
   (_ "Japanese specific settings"))
 
 (define-custom 'prime-custom-default-language 'Japanese
-  '(prime global)
+  '(prime)
   (list 'choice
 	(list 'Japanese (_ "Japanese") (_ "Japanese"))
 	(list 'English  (_ "English")  (_ "English")))
@@ -55,7 +55,7 @@
   (_ "long description will be here."))
 
 (define-custom 'prime-auto-register-mode? #t
-  '(prime global)
+  '(prime)
   '(boolean)
   (_ "Enable auto register mode")
   (_ "long description will be here."))



More information about the uim-commit mailing list