[uim-commit] r178 - in trunk: scm test
yamaken@freedesktop.org
yamaken@freedesktop.org
Sat Jan 8 23:21:20 PST 2005
Author: yamaken
Date: 2005-01-08 23:21:17 -0800 (Sat, 08 Jan 2005)
New Revision: 178
Modified:
trunk/scm/custom-vars.scm
trunk/scm/custom.scm
trunk/test/test-custom.scm
Log:
* scm/custom.scm
- All changes are validated by test-custom.scm
- (custom-activity-hook): Rename to custom-activity-hooks
- (custom-update-hook): Rename to custom-update-hooks
- (custom-get-hook): Rename to custom-get-hooks
- (custom-set-hook): Rename to custom-set-hooks
- (custom-literalize-hook): Rename to custom-literalize-hooks
- (custom-activity-hooks): Renamed from custom-activity-hook
- (custom-update-hooks): Renamed from custom-update-hook
- (custom-get-hooks): Renamed from custom-get-hook
- (custom-set-hooks): Renamed from custom-set-hook
- (custom-literalize-hooks): Renamed from custom-literalize-hook
- (custom-value, custom-set!, custom-active?, custom-as-string,
custom-register-update-cb): Follow the renamings
* scm/custom-vars.scm
- (custom custom-preserved-default-im-name, custom
custom-activate-default-im-name?, custom
custom-preserved-default-im-name, custom
custom-activate-default-im-name?, custom
custom-preserved-default-im-name, custom
custom-preserved-default-im-name, custom switch-im-key?, custom
custom-preserved-canna-server-name, custom
custom-activate-canna-server-name?, custom canna-server-name,
custom custom-activate-canna-server-name?, custom
custom-preserved-canna-server-name): Follow the renamings
* test/test-custom.scm
- (test custom-update-hook): Rename to custom-update-hooks
- (test custom-update-hook (self update)): Rename to custom-update-hooks
(self update)
- (test custom-get-hook): Rename to custom-get-hooks
- (test custom-get-hook (self update)): Rename to custom-get-hooks (self
update)
- (test custom-set-hook): Rename to custom-set-hooks
- (test custom-set-hook (self update)): Rename to custom-set-hooks (self
update)
- (test custom-update-hooks): Renamed from custom-update-hook
- (test custom-update-hooks (self update)): Renamed from custom-update-hook
(self update)
- (test custom-get-hooks): Renamed from custom-get-hook
- (test custom-get-hooks (self update)): Renamed from custom-get-hook (self
update)
- (test custom-set-hooks): Renamed from custom-set-hook
- (test custom-set-hooks (self update)): Renamed from custom-set-hook (self
update)
- (test custom-active?, test custom-update-hooks, test
custom-update-hooks (self update), test custom-get-hooks, test
custom-get-hooks (self update), test custom-set-hooks, test
custom-set-hooks (self update), test custom-as-string): Follow the
renamings
Modified: trunk/scm/custom-vars.scm
===================================================================
--- trunk/scm/custom-vars.scm 2005-01-09 06:39:59 UTC (rev 177)
+++ trunk/scm/custom-vars.scm 2005-01-09 07:21:17 UTC (rev 178)
@@ -138,7 +138,7 @@
;; activity dependency
(custom-add-hook 'custom-preserved-default-im-name
- 'custom-activity-hook
+ 'custom-activity-hooks
(lambda ()
custom-activate-default-im-name?))
@@ -151,10 +151,10 @@
;; decode #f from default-im-name
(custom-add-hook 'custom-activate-default-im-name?
- 'custom-get-hook
+ 'custom-get-hooks
custom-hook-get-default-im-name)
(custom-add-hook 'custom-preserved-default-im-name
- 'custom-get-hook
+ 'custom-get-hooks
custom-hook-get-default-im-name)
(define custom-hook-set-default-im-name
@@ -166,10 +166,10 @@
;; encode #f into default-im-name
(custom-add-hook 'custom-activate-default-im-name?
- 'custom-set-hook
+ 'custom-set-hooks
custom-hook-set-default-im-name)
(custom-add-hook 'custom-preserved-default-im-name
- 'custom-set-hook
+ 'custom-set-hooks
custom-hook-set-default-im-name)
(define custom-hook-literalize-preserved-default-im-name
@@ -184,7 +184,7 @@
")")))
(custom-add-hook 'custom-preserved-default-im-name
- 'custom-literalize-hook
+ 'custom-literalize-hooks
custom-hook-literalize-preserved-default-im-name)
;;
@@ -208,7 +208,7 @@
;; activity dependency
(custom-add-hook 'switch-im-key?
- 'custom-activity-hook
+ 'custom-activity-hooks
(lambda ()
enable-im-switch))
@@ -321,7 +321,7 @@
;; activity dependency
(custom-add-hook 'custom-preserved-canna-server-name
- 'custom-activity-hook
+ 'custom-activity-hooks
(lambda ()
custom-activate-canna-server-name?))
@@ -334,10 +334,10 @@
;; decode #f from canna-server-name
(custom-add-hook 'custom-activate-canna-server-name?
- 'custom-get-hook
+ 'custom-get-hooks
custom-hook-get-canna-server-name)
(custom-add-hook 'canna-server-name
- 'custom-get-hook
+ 'custom-get-hooks
custom-hook-get-canna-server-name)
(define custom-hook-set-canna-server-name
@@ -348,10 +348,10 @@
;; encode #f into canna-server-name
(custom-add-hook 'custom-activate-canna-server-name?
- 'custom-set-hook
+ 'custom-set-hooks
custom-hook-set-canna-server-name)
(custom-add-hook 'custom-preserved-canna-server-name
- 'custom-set-hook
+ 'custom-set-hooks
custom-hook-set-canna-server-name)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Modified: trunk/scm/custom.scm
===================================================================
--- trunk/scm/custom.scm 2005-01-09 06:39:59 UTC (rev 177)
+++ trunk/scm/custom.scm 2005-01-09 07:21:17 UTC (rev 178)
@@ -41,11 +41,11 @@
(define custom-group-rec-alist ())
(define custom-subgroup-alist ())
-(define custom-activity-hook ())
-(define custom-update-hook ())
-(define custom-get-hook ())
-(define custom-set-hook ())
-(define custom-literalize-hook ())
+(define custom-activity-hooks ())
+(define custom-update-hooks ())
+(define custom-get-hooks ())
+(define custom-set-hooks ())
+(define custom-literalize-hooks ())
(define custom-validator-alist
'((boolean . custom-boolean?)
@@ -255,7 +255,7 @@
;; API
(define custom-value
(lambda (sym)
- (custom-call-hook-procs sym custom-get-hook)
+ (custom-call-hook-procs sym custom-get-hooks)
(let ((val (symbol-value sym)))
(if (custom-valid? sym val)
val
@@ -268,13 +268,13 @@
(let* ((custom-syms (custom-collect-by-group #f))
(pre-activities (map custom-active? custom-syms)))
(set-symbol-value! sym val)
- (custom-call-hook-procs sym custom-set-hook)
+ (custom-call-hook-procs sym custom-set-hooks)
(let ((post-activities (map custom-active? custom-syms)))
(for-each (lambda (another-sym pre post)
(if (or (eq? another-sym sym)
(not (eq? pre post)))
(custom-call-hook-procs another-sym
- custom-update-hook)))
+ custom-update-hooks)))
custom-syms
pre-activities
post-activities)
@@ -282,7 +282,7 @@
(define custom-active?
(lambda (sym)
- (let* ((procs (custom-hook-procs sym custom-activity-hook))
+ (let* ((procs (custom-hook-procs sym custom-activity-hooks))
(activities (map (lambda (proc)
(proc))
procs))
@@ -373,7 +373,7 @@
(define custom-as-string
(lambda (sym)
- (let ((hooked (custom-call-hook-procs sym custom-literalize-hook)))
+ (let ((hooked (custom-call-hook-procs sym custom-literalize-hooks)))
(if (not (null? hooked))
(apply string-append hooked)
(custom-canonical-definition-as-string sym)))))
@@ -400,4 +400,4 @@
(lambda (custom-sym ptr gate-func func)
(and (custom-rec custom-sym)
(let ((cb (lambda () (gate-func func ptr custom-sym))))
- (custom-add-hook custom-sym 'custom-update-hook cb)))))
+ (custom-add-hook custom-sym 'custom-update-hooks cb)))))
Modified: trunk/test/test-custom.scm
===================================================================
--- trunk/test/test-custom.scm 2005-01-09 06:39:59 UTC (rev 177)
+++ trunk/test/test-custom.scm 2005-01-09 07:21:17 UTC (rev 178)
@@ -683,46 +683,46 @@
("test custom-active?"
(uim '(custom-add-hook 'test-custom1
- 'custom-activity-hook
+ 'custom-activity-hooks
(lambda ()
(symbol-bound? 'car))))
(assert-true (uim-bool '(custom-active? 'test-custom1)))
(uim '(custom-add-hook 'test-custom1
- 'custom-activity-hook
+ 'custom-activity-hooks
(lambda ()
(symbol-bound? 'cdr))))
(assert-true (uim-bool '(custom-active? 'test-custom1)))
(uim '(begin
(custom-add-hook 'test-custom1
- 'custom-activity-hook
+ 'custom-activity-hooks
(lambda ()
(symbol-bound? 'test-nonexistent)))))
(assert-false (uim-bool '(custom-active? 'test-custom1)))
(uim '(custom-add-hook 'test-custom1
- 'custom-activity-hook
+ 'custom-activity-hooks
(lambda ()
(symbol-bound? 'cons))))
(assert-false (uim-bool '(custom-active? 'test-custom1))))
- ("test custom-update-hook"
+ ("test custom-update-hooks"
(uim '(custom-add-hook 'test-custom1
- 'custom-activity-hook
+ 'custom-activity-hooks
(lambda ()
(eq? test-custom3 'test-custom3-uim))))
(uim '(custom-add-hook 'test-custom2
- 'custom-activity-hook
+ 'custom-activity-hooks
(lambda ()
(eq? test-custom3 'test-custom3-uim))))
(uim '(custom-add-hook 'test-custom1
- 'custom-update-hook
+ 'custom-update-hooks
(lambda ()
(set! test-custom1-trace
(cons 'updated test-custom1-trace)))))
(uim '(custom-add-hook 'test-custom2
- 'custom-update-hook
+ 'custom-update-hooks
(lambda ()
(set! test-custom2-trace
(cons 'updated test-custom2-trace)))))
@@ -742,13 +742,13 @@
(uim 'test-custom2-trace))
(assert-true (uim-bool '(custom-active? 'test-custom1)))
(assert-true (uim-bool '(custom-active? 'test-custom2))))
- ("test custom-update-hook (self update)"
+ ("test custom-update-hooks (self update)"
(uim '(custom-add-hook 'test-custom1
- 'custom-activity-hook
+ 'custom-activity-hooks
(lambda ()
(eq? test-custom1 'test-custom1-uim))))
(uim '(custom-add-hook 'test-custom1
- 'custom-update-hook
+ 'custom-update-hooks
(lambda ()
(set! test-custom1-trace
(cons 'updated test-custom1-trace)))))
@@ -814,7 +814,7 @@
"Test custom1"
"long description will be here."))))
- ("test custom-get-hook"
+ ("test custom-get-hooks"
(assert-equal ()
(uim 'test-custom1-trace))
(assert-equal 'test-custom1-ddskk
@@ -822,7 +822,7 @@
(assert-equal ()
(uim 'test-custom1-trace))
(uim '(custom-add-hook 'test-custom1
- 'custom-get-hook
+ 'custom-get-hooks
(lambda ()
(set! test-custom1-trace
(cons 'first
@@ -833,7 +833,7 @@
(uim '(custom-value 'test-custom1)))
(assert-equal '(first)
(uim 'test-custom1-trace)))
- ("test custom-get-hook (self update)"
+ ("test custom-get-hooks (self update)"
(assert-equal ()
(uim 'test-custom1-trace))
(assert-equal 'test-custom1-ddskk
@@ -841,7 +841,7 @@
(assert-equal ()
(uim 'test-custom1-trace))
(uim '(custom-add-hook 'test-custom1
- 'custom-get-hook
+ 'custom-get-hooks
(lambda ()
(set! test-custom1
'test-custom1-uim)
@@ -855,7 +855,7 @@
(assert-equal '(first)
(uim 'test-custom1-trace)))
- ("test custom-set-hook"
+ ("test custom-set-hooks"
(assert-equal 'test-custom1-ddskk
(uim '(custom-value 'test-custom1)))
(assert-equal '()
@@ -866,7 +866,7 @@
(assert-equal '()
(uim 'test-custom1-trace))
(uim '(custom-add-hook 'test-custom1
- 'custom-set-hook
+ 'custom-set-hooks
(lambda ()
(set! test-custom1-trace
(cons 'second
@@ -880,7 +880,7 @@
(uim '(custom-value 'test-custom1)))
(assert-equal '(second)
(uim 'test-custom1-trace)))
- ("test custom-set-hook (self update)"
+ ("test custom-set-hooks (self update)"
(assert-equal 'test-custom1-ddskk
(uim '(custom-value 'test-custom1)))
(assert-equal '()
@@ -891,7 +891,7 @@
(assert-equal '()
(uim 'test-custom1-trace))
(uim '(custom-add-hook 'test-custom1
- 'custom-set-hook
+ 'custom-set-hooks
(lambda ()
(set! test-custom1
'test-custom1-canna)
@@ -1277,11 +1277,11 @@
("test custom-as-string"
(assert-equal "(define test-style 'test-style-ddskk)"
(uim '(custom-as-string 'test-style)))
- (uim '(custom-add-hook 'test-style 'custom-literalize-hook
+ (uim '(custom-add-hook 'test-style 'custom-literalize-hooks
(lambda () "(define test-style 'hooked)")))
(assert-equal "(define test-style 'hooked)"
(uim '(custom-as-string 'test-style)))
- (uim '(custom-add-hook 'test-style 'custom-literalize-hook
+ (uim '(custom-add-hook 'test-style 'custom-literalize-hooks
(lambda () "(define test-style 'hooked2)")))
(assert-equal "(define test-style 'hooked2)(define test-style 'hooked)"
(uim '(custom-as-string 'test-style)))))
More information about the Uim-commit
mailing list