A multilingual input method framework
Revision | dd732e15e590c13f1755e1028ea566cba72634ef (tree) |
---|---|
Time | 2005-09-05 05:35:59 |
Author | yamaken <yamaken@ff9a...> |
Commiter | yamaken |
* 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
@@ -58,6 +58,38 @@ Each change consist of following fields. All fields are required. | ||
58 | 58 | The changes are described below in most recently updated order. |
59 | 59 | |
60 | 60 | ------------------------------------------------------------------------------ |
61 | +Summary: Obsolete some misc Scheme APIs | |
62 | +Affects: IM developers | |
63 | +Updates: Scheme API | |
64 | +Version: 0.5, 0.4.9 | |
65 | +Revision: ac1413 | |
66 | +Date: 2005-09-05 | |
67 | +Modifier: YamaKen | |
68 | +Related: | |
69 | +URL: | |
70 | +Changes: | |
71 | + (removed) bitwise-or | |
72 | + (new) bitwise-ior | |
73 | + (removed) enclose-another-env | |
74 | + (new) %%enclose-another-env | |
75 | + (removed) toplevel-env | |
76 | + (new) interaction-environment | |
77 | +Description: | |
78 | + Obsolete inappropriate or wrong API with new appropriate ones. | |
79 | +------------------------------------------------------------------------------ | |
80 | +Summary: An experimental custom variable reloading API | |
81 | +Affects: Helper program developers, Bridge developers | |
82 | +Updates: C API, Helper protocol | |
83 | +Version: 0.5 | |
84 | +Revision: ac1160, ac1161, ac1162 | |
85 | +Date: 2005-08-09 | |
86 | +Modifier: TOKUNAGA Hiroyuki, YamaKen | |
87 | +Related: bug #3620 | |
88 | +URL: | |
89 | +Changes: | |
90 | + (new) uim_custom_broadcast_reload_request() | |
91 | +Description: | |
92 | +------------------------------------------------------------------------------ | |
61 | 93 | Summary: default IM switching responsibility separation from uim_switch_im() |
62 | 94 | Affects: Bridge developers |
63 | 95 | Updates: C API |
@@ -156,7 +156,7 @@ | ||
156 | 156 | (let ((key-val (custom-modify-key-predicate-names val))) |
157 | 157 | (eval (list 'define (symbolconc sym '?) |
158 | 158 | (list 'make-key-predicate (list 'quote key-val))) |
159 | - toplevel-env)) | |
159 | + (interaction-environment))) | |
160 | 160 | #t) |
161 | 161 | ((custom-exist? sym #f) |
162 | 162 | (set-symbol-value! sym val) |
@@ -179,7 +179,7 @@ | ||
179 | 179 | (list 'quote default) |
180 | 180 | default))) |
181 | 181 | (eval (list 'define sym quoted-default) |
182 | - toplevel-env) | |
182 | + (interaction-environment)) | |
183 | 183 | (if (custom-key-exist? sym) |
184 | 184 | ;; already define-key'ed in ~/.uim |
185 | 185 | (custom-call-hook-procs sym custom-set-hooks) |
@@ -187,7 +187,7 @@ | ||
187 | 187 | (if (eq? (car type) |
188 | 188 | 'key) |
189 | 189 | (eval (list 'define (symbolconc sym '?) list) |
190 | - toplevel-env)) | |
190 | + (interaction-environment))) | |
191 | 191 | (custom-set-value! sym default)))))))) ;; to apply hooks |
192 | 192 | |
193 | 193 | ;; lightweight implementation |
@@ -518,7 +518,7 @@ | ||
518 | 518 | (list 'quote default) |
519 | 519 | default))) |
520 | 520 | (eval (list 'define sym quoted-default) |
521 | - toplevel-env) | |
521 | + (interaction-environment)) | |
522 | 522 | (custom-set-value! sym default))) ;; to apply hooks |
523 | 523 | (for-each (lambda (subgrp) |
524 | 524 | (let ((registered (custom-group-subgroups primary-grp))) |
@@ -571,7 +571,7 @@ | ||
571 | 571 | (let ((key-val (custom-modify-key-predicate-names val))) |
572 | 572 | (eval (list 'define (symbolconc sym '?) |
573 | 573 | (list 'make-key-predicate (list 'quote key-val))) |
574 | - toplevel-env))) | |
574 | + (interaction-environment)))) | |
575 | 575 | (custom-call-hook-procs sym custom-set-hooks) |
576 | 576 | (custom-call-hook-procs sym custom-update-hooks) |
577 | 577 | (let ((post-activities (map-activities))) |
@@ -40,8 +40,8 @@ | ||
40 | 40 | (generic-commit-key? |
41 | 41 | (make-key-predicate '(" " generic-return-key?))) |
42 | 42 | (generic-proc-input-state-with-preedit-with-this-env |
43 | - (enclose-another-env generic-proc-input-state-with-preedit | |
44 | - (the-environment)))) | |
43 | + (%%enclose-another-env generic-proc-input-state-with-preedit | |
44 | + (the-environment)))) | |
45 | 45 | (lambda (gc key state rkc) ;; "gc" stands for "generic-context" |
46 | 46 | (generic-proc-input-state-with-preedit-with-this-env gc key state rkc)))) |
47 | 47 |
@@ -54,7 +54,7 @@ | ||
54 | 54 | (generic-proc-input-state-with-preedit |
55 | 55 | hangul-proc-on-mode-with-preedit) |
56 | 56 | (generic-proc-input-state-with-this-env |
57 | - (enclose-another-env generic-proc-input-state (the-environment)))) | |
57 | + (%%enclose-another-env generic-proc-input-state (the-environment)))) | |
58 | 58 | (lambda (gc key state) ;; "gc" stands for "generic-context" |
59 | 59 | (generic-proc-input-state-with-this-env gc key state)))) |
60 | 60 |
@@ -62,7 +62,7 @@ | ||
62 | 62 | (define hangul-key-press-handler |
63 | 63 | (let* ((generic-proc-input-state hangul-proc-on-mode) |
64 | 64 | (generic-key-press-handler-with-this-env |
65 | - (enclose-another-env generic-key-press-handler (the-environment)))) | |
65 | + (%%enclose-another-env generic-key-press-handler (the-environment)))) | |
66 | 66 | (lambda (gc key state) |
67 | 67 | (generic-key-press-handler-with-this-env gc key state)))) |
68 | 68 |
@@ -197,9 +197,9 @@ | ||
197 | 197 | loaded-sym) |
198 | 198 | ((try-load file) |
199 | 199 | (eval (list 'define loaded-sym #t) |
200 | - toplevel-env) | |
200 | + (interaction-environment)) | |
201 | 201 | (eval (list 'define reloaded-sym #t) |
202 | - toplevel-env) | |
202 | + (interaction-environment)) | |
203 | 203 | loaded-sym) |
204 | 204 | (else |
205 | 205 | #f))))) |
@@ -307,7 +307,7 @@ | ||
307 | 307 | (let* ((modified-key-strs (modify-key-strs-implicitly key-strs)) |
308 | 308 | (predicate (make-key-predicate modified-key-strs))) |
309 | 309 | (eval (list 'define key-predicate-sym predicate) |
310 | - toplevel-env)))) | |
310 | + (interaction-environment))))) | |
311 | 311 | |
312 | 312 | (define valid-key-str? |
313 | 313 | (lambda (key-str) |
@@ -192,6 +192,11 @@ | ||
192 | 192 | ;; definition of 'else' has been moved into slib.c |
193 | 193 | ;(define else #t) |
194 | 194 | |
195 | +;; for eval | |
196 | +(define interaction-environment | |
197 | + (lambda () | |
198 | + ())) | |
199 | + | |
195 | 200 | (define boolean? |
196 | 201 | (lambda (x) |
197 | 202 | (or (eq? x #t) |
@@ -555,7 +560,7 @@ | ||
555 | 560 | (lambda xs |
556 | 561 | (fold bit-and (bitwise-not 0) xs))) |
557 | 562 | |
558 | -(define bitwise-or | |
563 | +(define bitwise-ior | |
559 | 564 | (lambda xs |
560 | 565 | (fold bit-or 0 xs))) |
561 | 566 |
@@ -593,11 +598,8 @@ | ||
593 | 598 | (eq? (symbolconc '* (string->symbol file) '-loaded*) |
594 | 599 | (*catch 'errobj (require file)))))) |
595 | 600 | |
596 | -;; for eval | |
597 | -(define toplevel-env ()) | |
598 | - | |
599 | 601 | ;; used for dynamic environment substitution of closure |
600 | -(define enclose-another-env | |
602 | +(define %%enclose-another-env | |
601 | 603 | (lambda (closure another-env) |
602 | 604 | (let* ((code (%%closure-code closure)) |
603 | 605 | (args (car code)) |
@@ -621,9 +623,9 @@ | ||
621 | 623 | (set-car! (nthcdr index rec) |
622 | 624 | val)))) |
623 | 625 | (eval (list 'define getter-sym getter) |
624 | - toplevel-env) | |
626 | + (interaction-environment)) | |
625 | 627 | (eval (list 'define setter-sym setter) |
626 | - toplevel-env))) | |
628 | + (interaction-environment)))) | |
627 | 629 | rec-spec |
628 | 630 | (iota (length rec-spec))) |
629 | 631 | (let ((creator-sym (symbolconc rec-sym '-new)) |
@@ -647,7 +649,7 @@ | ||
647 | 649 | (else |
648 | 650 | #f)))))) |
649 | 651 | (eval (list 'define creator-sym creator) |
650 | - toplevel-env)))) | |
652 | + (interaction-environment))))) | |
651 | 653 | |
652 | 654 | ;; for direct candidate selection |
653 | 655 | (define number->candidate-index |
@@ -29,7 +29,7 @@ | ||
29 | 29 | ;;; SUCH DAMAGE. |
30 | 30 | ;;;; |
31 | 31 | |
32 | -;; This file is tested with revision 952 (new repository) | |
32 | +;; This file is tested with revision 1413 (new repository) | |
33 | 33 | |
34 | 34 | (use test.unit) |
35 | 35 |
@@ -1315,10 +1315,17 @@ | ||
1315 | 1315 | (uim '(alist-delete 'three alist-sym eq?))))) |
1316 | 1316 | |
1317 | 1317 | (define-uim-test-case "test util Siod specific procedures" |
1318 | - ("test toplevel-env" | |
1319 | - (assert-true (uim-bool '(eval '(symbol-bound? 'filter-map) | |
1320 | - toplevel-env)))) | |
1321 | - ("test enclose-another-env" | |
1318 | + ("test interaction-environment" | |
1319 | + (assert-true (uim-bool '(eval '(symbol-bound? 'filter-map) | |
1320 | + (interaction-environment)))) | |
1321 | + (assert-false (uim-bool '(eval '(symbol-bound? 'filter-baz) | |
1322 | + (interaction-environment)))) | |
1323 | + (uim '(eval (list define 'filter-baz filter-map) | |
1324 | + (interaction-environment))) | |
1325 | + (assert-true (uim-bool '(eval '(symbol-bound? 'filter-baz) | |
1326 | + (interaction-environment)))) | |
1327 | + (assert-true (uim-bool '(eq? filter-baz filter-map)))) | |
1328 | + ("test %%enclose-another-env" | |
1322 | 1329 | (assert-equal 3 |
1323 | 1330 | (uim '(let* ((x 1) |
1324 | 1331 | (y 2) |
@@ -1333,7 +1340,7 @@ | ||
1333 | 1340 | (another-env '((x . 4) |
1334 | 1341 | (y . 6)))) |
1335 | 1342 | (set! closure |
1336 | - (enclose-another-env closure another-env)) | |
1343 | + (%%enclose-another-env closure another-env)) | |
1337 | 1344 | (closure)))) |
1338 | 1345 | ;; causes error since z is not exist in the another-env |
1339 | 1346 | (assert-error (lambda () |
@@ -1345,7 +1352,7 @@ | ||
1345 | 1352 | (another-env '((x . 4) |
1346 | 1353 | (y . 6)))) |
1347 | 1354 | (set! closure |
1348 | - (enclose-another-env closure another-env)) | |
1355 | + (%%enclose-another-env closure another-env)) | |
1349 | 1356 | (closure))))))) |
1350 | 1357 | |
1351 | 1358 | (define-uim-test-case "test util define-record" |