[uim-commit] r1414 - in branches/0.4: doc scm test

yamaken at freedesktop.org yamaken at freedesktop.org
Sun Sep 4 13:36:01 PDT 2005


Author: yamaken
Date: 2005-09-04 13:35:59 -0700 (Sun, 04 Sep 2005)
New Revision: 1414

Modified:
   branches/0.4/doc/COMPATIBILITY
   branches/0.4/scm/custom-rt.scm
   branches/0.4/scm/custom.scm
   branches/0.4/scm/hangul.scm
   branches/0.4/scm/im-custom.scm
   branches/0.4/scm/key.scm
   branches/0.4/scm/util.scm
   branches/0.4/test/test-util.scm
Log:
* doc/COMPATIBILITY
* test/test-util.scm
* scm/custom.scm
* scm/util.scm
* scm/im-custom.scm
* scm/hangul.scm
* scm/key.scm
* scm/custom-rt.scm
  - Port r1413 from trunk


Modified: branches/0.4/doc/COMPATIBILITY
===================================================================
--- branches/0.4/doc/COMPATIBILITY	2005-09-04 20:23:19 UTC (rev 1413)
+++ branches/0.4/doc/COMPATIBILITY	2005-09-04 20:35:59 UTC (rev 1414)
@@ -58,6 +58,38 @@
 The changes are described below in most recently updated order.
 
 ------------------------------------------------------------------------------
+Summary: Obsolete some misc Scheme APIs
+Affects: IM developers
+Updates: Scheme API
+Version: 0.5, 0.4.9
+Revision: ac1413
+Date: 2005-09-05
+Modifier: YamaKen
+Related:
+URL:
+Changes:
+  (removed) bitwise-or
+      (new) bitwise-ior
+  (removed) enclose-another-env
+      (new) %%enclose-another-env
+  (removed) toplevel-env
+      (new) interaction-environment
+Description:
+  Obsolete inappropriate or wrong API with new appropriate ones.
+------------------------------------------------------------------------------
+Summary: An experimental custom variable reloading API
+Affects: Helper program developers, Bridge developers
+Updates: C API, Helper protocol
+Version: 0.5
+Revision: ac1160, ac1161, ac1162
+Date: 2005-08-09
+Modifier: TOKUNAGA Hiroyuki, YamaKen
+Related: bug #3620
+URL:
+Changes:
+  (new) uim_custom_broadcast_reload_request()
+Description:
+------------------------------------------------------------------------------
 Summary: default IM switching responsibility separation from uim_switch_im()
 Affects: Bridge developers
 Updates: C API

Modified: branches/0.4/scm/custom-rt.scm
===================================================================
--- branches/0.4/scm/custom-rt.scm	2005-09-04 20:23:19 UTC (rev 1413)
+++ branches/0.4/scm/custom-rt.scm	2005-09-04 20:35:59 UTC (rev 1414)
@@ -156,7 +156,7 @@
 	   (let ((key-val (custom-modify-key-predicate-names val)))
 	     (eval (list 'define (symbolconc sym '?)
 			 (list 'make-key-predicate (list 'quote key-val)))
-		   toplevel-env))
+		   (interaction-environment)))
 	   #t)
 	  ((custom-exist? sym #f)
 	   (set-symbol-value! sym val)
@@ -179,7 +179,7 @@
 				    (list 'quote default)
 				    default)))
 	    (eval (list 'define sym quoted-default)
-		  toplevel-env)
+		  (interaction-environment))
 	    (if (custom-key-exist? sym)
 		;; already define-key'ed in ~/.uim
 		(custom-call-hook-procs sym custom-set-hooks)
@@ -187,7 +187,7 @@
 		  (if (eq? (car type)
 			   'key)
 		      (eval (list 'define (symbolconc sym '?) list)
-			    toplevel-env))
+			    (interaction-environment)))
 		  (custom-set-value! sym default))))))))  ;; to apply hooks
 
 ;; lightweight implementation

Modified: branches/0.4/scm/custom.scm
===================================================================
--- branches/0.4/scm/custom.scm	2005-09-04 20:23:19 UTC (rev 1413)
+++ branches/0.4/scm/custom.scm	2005-09-04 20:35:59 UTC (rev 1414)
@@ -518,7 +518,7 @@
 				    (list 'quote default)
 				    default)))
 	    (eval (list 'define sym quoted-default)
-		  toplevel-env)
+		  (interaction-environment))
 	    (custom-set-value! sym default)))  ;; to apply hooks
       (for-each (lambda (subgrp)
 		  (let ((registered (custom-group-subgroups primary-grp)))
@@ -571,7 +571,7 @@
 	       (let ((key-val (custom-modify-key-predicate-names val)))
 		 (eval (list 'define (symbolconc sym '?)
 			     (list 'make-key-predicate (list 'quote key-val)))
-		       toplevel-env)))
+		       (interaction-environment))))
 	   (custom-call-hook-procs sym custom-set-hooks)
 	   (custom-call-hook-procs sym custom-update-hooks)
 	   (let ((post-activities (map-activities)))

Modified: branches/0.4/scm/hangul.scm
===================================================================
--- branches/0.4/scm/hangul.scm	2005-09-04 20:23:19 UTC (rev 1413)
+++ branches/0.4/scm/hangul.scm	2005-09-04 20:35:59 UTC (rev 1414)
@@ -40,8 +40,8 @@
 	 (generic-commit-key?
 	  (make-key-predicate '(" " generic-return-key?)))
 	 (generic-proc-input-state-with-preedit-with-this-env
-	  (enclose-another-env generic-proc-input-state-with-preedit
-	  		       (the-environment))))
+	  (%%enclose-another-env generic-proc-input-state-with-preedit
+				 (the-environment))))
     (lambda (gc key state rkc)  ;; "gc" stands for "generic-context"
       (generic-proc-input-state-with-preedit-with-this-env gc key state rkc))))
 
@@ -54,7 +54,7 @@
 	 (generic-proc-input-state-with-preedit
 	  hangul-proc-on-mode-with-preedit)
 	 (generic-proc-input-state-with-this-env
-	  (enclose-another-env generic-proc-input-state (the-environment))))
+	  (%%enclose-another-env generic-proc-input-state (the-environment))))
     (lambda (gc key state)  ;; "gc" stands for "generic-context"
       (generic-proc-input-state-with-this-env gc key state))))
 
@@ -62,7 +62,7 @@
 (define hangul-key-press-handler
   (let* ((generic-proc-input-state hangul-proc-on-mode)
 	 (generic-key-press-handler-with-this-env
-	  (enclose-another-env generic-key-press-handler (the-environment))))
+	  (%%enclose-another-env generic-key-press-handler (the-environment))))
     (lambda (gc key state)
       (generic-key-press-handler-with-this-env gc key state))))
 

Modified: branches/0.4/scm/im-custom.scm
===================================================================
--- branches/0.4/scm/im-custom.scm	2005-09-04 20:23:19 UTC (rev 1413)
+++ branches/0.4/scm/im-custom.scm	2005-09-04 20:35:59 UTC (rev 1414)
@@ -197,9 +197,9 @@
 		  loaded-sym)
 		 ((try-load file)
 		  (eval (list 'define loaded-sym #t)
-			toplevel-env)
+			(interaction-environment))
 		  (eval (list 'define reloaded-sym #t)
-			toplevel-env)
+			(interaction-environment))
 		  loaded-sym)
 		 (else
 		  #f)))))

Modified: branches/0.4/scm/key.scm
===================================================================
--- branches/0.4/scm/key.scm	2005-09-04 20:23:19 UTC (rev 1413)
+++ branches/0.4/scm/key.scm	2005-09-04 20:35:59 UTC (rev 1414)
@@ -307,7 +307,7 @@
     (let* ((modified-key-strs (modify-key-strs-implicitly key-strs))
 	   (predicate (make-key-predicate modified-key-strs)))
       (eval (list 'define key-predicate-sym predicate)
-	    toplevel-env))))
+	    (interaction-environment)))))
 
 (define valid-key-str?
   (lambda (key-str)

Modified: branches/0.4/scm/util.scm
===================================================================
--- branches/0.4/scm/util.scm	2005-09-04 20:23:19 UTC (rev 1413)
+++ branches/0.4/scm/util.scm	2005-09-04 20:35:59 UTC (rev 1414)
@@ -192,6 +192,11 @@
 ;; definition of 'else' has been moved into slib.c
 ;(define else #t)
 
+;; for eval
+(define interaction-environment
+  (lambda ()
+    ()))
+
 (define boolean?
   (lambda (x)
     (or (eq? x #t)
@@ -555,7 +560,7 @@
   (lambda xs
     (fold bit-and (bitwise-not 0) xs)))
 
-(define bitwise-or
+(define bitwise-ior
   (lambda xs
     (fold bit-or 0 xs)))
 
@@ -593,11 +598,8 @@
 	 (eq? (symbolconc '* (string->symbol file) '-loaded*)
 	      (*catch 'errobj (require file))))))
 
-;; for eval
-(define toplevel-env ())
-
 ;; used for dynamic environment substitution of closure
-(define enclose-another-env
+(define %%enclose-another-env
   (lambda (closure another-env)
     (let* ((code (%%closure-code closure))
 	   (args (car code))
@@ -621,9 +623,9 @@
 				 (set-car! (nthcdr index rec)
 					   val))))
 		  (eval (list 'define getter-sym getter)
-			toplevel-env)
+			(interaction-environment))
 		  (eval (list 'define setter-sym setter)
-			toplevel-env)))
+			(interaction-environment))))
 	      rec-spec
 	      (iota (length rec-spec)))
     (let ((creator-sym (symbolconc rec-sym '-new))
@@ -647,7 +649,7 @@
 			(else
 			 #f))))))
       (eval (list 'define creator-sym creator)
-	    toplevel-env))))
+	    (interaction-environment)))))
 
 ;; for direct candidate selection
 (define number->candidate-index

Modified: branches/0.4/test/test-util.scm
===================================================================
--- branches/0.4/test/test-util.scm	2005-09-04 20:23:19 UTC (rev 1413)
+++ branches/0.4/test/test-util.scm	2005-09-04 20:35:59 UTC (rev 1414)
@@ -29,7 +29,7 @@
 ;;; SUCH DAMAGE.
 ;;;;
 
-;; This file is tested with revision 952 (new repository)
+;; This file is tested with revision 1413 (new repository)
 
 (use test.unit)
 
@@ -1315,10 +1315,17 @@
 		 (uim '(alist-delete 'three alist-sym eq?)))))
 
 (define-uim-test-case "test util Siod specific procedures"
-  ("test toplevel-env"
-   (assert-true (uim-bool '(eval '(symbol-bound? 'filter-map)
-				 toplevel-env))))
-  ("test enclose-another-env"
+  ("test interaction-environment"
+   (assert-true  (uim-bool '(eval '(symbol-bound? 'filter-map)
+				  (interaction-environment))))
+   (assert-false (uim-bool '(eval '(symbol-bound? 'filter-baz)
+				  (interaction-environment))))
+   (uim '(eval (list define 'filter-baz filter-map)
+	       (interaction-environment)))
+   (assert-true  (uim-bool '(eval '(symbol-bound? 'filter-baz)
+				  (interaction-environment))))
+   (assert-true  (uim-bool '(eq? filter-baz filter-map))))
+  ("test %%enclose-another-env"
    (assert-equal 3
 		 (uim '(let* ((x 1)
 			      (y 2)
@@ -1333,7 +1340,7 @@
 			      (another-env '((x . 4)
 					     (y . 6))))
 			 (set! closure
-			       (enclose-another-env closure another-env))
+			       (%%enclose-another-env closure another-env))
 			 (closure))))
    ;; causes error since z is not exist in the another-env
    (assert-error (lambda ()
@@ -1345,7 +1352,7 @@
 				(another-env '((x . 4)
 					       (y . 6))))
 			   (set! closure
-				 (enclose-another-env closure another-env))
+				 (%%enclose-another-env closure another-env))
 			   (closure)))))))
 
 (define-uim-test-case "test util define-record"



More information about the uim-commit mailing list