[uim-commit] r1862 - trunk/scm

yamaken at freedesktop.org yamaken at freedesktop.org
Thu Oct 20 18:48:48 PDT 2005


Author: yamaken
Date: 2005-10-20 18:48:45 -0700 (Thu, 20 Oct 2005)
New Revision: 1862

Modified:
   trunk/scm/custom-rt.scm
   trunk/scm/custom.scm
Log:
* scm/prime-custom.scm
  - (custom-group-label, custom-group-desc): Revert R5RS-incompatible
    and inappropriate responsibility error handling added in r1126
  - (define-custom): Add existence check for groups
* scm/custom-rt.scm
  - (require-custom): Add a TODO comment


Modified: trunk/scm/custom-rt.scm
===================================================================
--- trunk/scm/custom-rt.scm	2005-10-21 01:20:12 UTC (rev 1861)
+++ trunk/scm/custom-rt.scm	2005-10-21 01:48:45 UTC (rev 1862)
@@ -101,6 +101,7 @@
   (lambda (gsym)
     (try-load (custom-file-path gsym))))
 
+;; TODO: disable all newly defined customs when an error occurred in loading
 ;; full implementation
 (define require-custom
   (lambda (filename)

Modified: trunk/scm/custom.scm
===================================================================
--- trunk/scm/custom.scm	2005-10-21 01:20:12 UTC (rev 1861)
+++ trunk/scm/custom.scm	2005-10-21 01:48:45 UTC (rev 1862)
@@ -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
@@ -503,6 +499,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))



More information about the uim-commit mailing list