[uim-commit] r179 - in trunk: scm test

yamaken@freedesktop.org yamaken@freedesktop.org
Sat Jan 8 23:45:22 PST 2005


Author: yamaken
Date: 2005-01-08 23:45:20 -0800 (Sat, 08 Jan 2005)
New Revision: 179

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-validator-alist): Rename 'symbol' to 'choice'
  - (custom-valid-symbol?): Rename to custom-valid-choice?
  - (custom-valid-choice?):
    * Renamed from custom-valid-symbol?
    * Follow the renamings
  - (record custom-symbol-rec): Rename to custom-choice-rec
  - (record custom-choice-rec): Renamed from custom-symbol-rec
  - (custom-symbol-label): Rename to custom-choice-label
  - (custom-choice-label):
    * Renamed from custom-symbol-label
    * Follow the renamings
  - (custom-symbol-desc): Rename to custom-choice-desc
  - (custom-choice-desc):
    * Renamed from custom-symbol-desc
    * Follow the renamings
  - (custom-range, custom-canonical-value-as-string): Follow the renamings
* scm/custom-vars.scm
  - (custom uim-color, custom custom-preserved-default-im-name, custom
    skk-style): Replace custom type 'symbol' with 'choice'
* test/test-custom.scm
  - (test custom-valid-symbol?): Rename to custom-valid-choice?
  - (test custom-valid-choice?):
    * Renamed from custom-valid-symbol?
    * Follow the renamings
  - (test custom-symbol-rec-new): Rename to custom-choice-rec-new
  - (test custom-choice-rec-new):
    * Renamed from custom-symbol-rec-new
    * Follow the renamings
  - (test custom-symbol-label): Rename to custom-choice-label
  - (test custom-choice-label):
    * Renamed from custom-symbol-label
    * Follow the renamings
  - (test custom-symbol-desc): Rename to custom-choice-desc
  - (test custom-choice-desc):
    * Renamed from custom-symbol-desc
    * Follow the renamings
  - (testcase custom hooks): Follow the renamings in setup
  - (test custom-type): Follow the renamings


Modified: trunk/scm/custom-vars.scm
===================================================================
--- trunk/scm/custom-vars.scm	2005-01-09 07:21:17 UTC (rev 178)
+++ trunk/scm/custom-vars.scm	2005-01-09 07:45:20 UTC (rev 179)
@@ -95,7 +95,7 @@
 
 (define-custom 'uim-color 'uim-color-uim
   '(global)
-  '(symbol
+  '(choice
     (uim-color-uim "uim" "uim native")
     (uim-color-atok "ATOK like" "Similar to ATOK"))
   (_ "Preedit color")
@@ -120,7 +120,7 @@
 (define-custom 'custom-preserved-default-im-name (im-name (find-default-im #f))
   '(global default-im-name)
   (cons
-   'symbol
+   'choice
    (reverse (map (lambda (im)
 		   (let* ((sym (im-name im))
 			  (cname-proc (symbolconc sym '-im-canonical-name))
@@ -421,7 +421,7 @@
 
 (define-custom 'skk-style 'skk-style-ddskk-like
   '(skk advanced)
-  '(symbol
+  '(choice
     (skk-style-ddskk-like "ddskk" "Similar to ddskk")
     (skk-style-uim "uim" "uim native"))
   (_ "Visual style")

Modified: trunk/scm/custom.scm
===================================================================
--- trunk/scm/custom.scm	2005-01-09 07:21:17 UTC (rev 178)
+++ trunk/scm/custom.scm	2005-01-09 07:45:20 UTC (rev 179)
@@ -52,7 +52,7 @@
     (integer   . custom-integer?)
     (string    . custom-string?)
     (pathname  . pathname?)
-    (symbol    . custom-valid-symbol?)
+    (choice    . custom-valid-choice?)
     (key       . key-definition?)))
 
 (define anything?
@@ -77,31 +77,31 @@
   (lambda (str)
     (string? str)))
 
-(define custom-valid-symbol?
+(define custom-valid-choice?
   (lambda arg
     (let* ((sym (car arg))
-	   (symbol-rec-alist (cdr arg)))
+	   (choice-rec-alist (cdr arg)))
       (and (symbol? sym)
-	   (assq sym symbol-rec-alist)
+	   (assq sym choice-rec-alist)
 	   #t))))
 
-(define-record 'custom-symbol-rec
+(define-record 'custom-choice-rec
   '((sym   #f)
     (label "")
     (desc  "")))
 
-(define custom-symbol-label
+(define custom-choice-label
   (lambda (custom-sym val-sym)
     (let* ((sym-rec-alist (custom-type-attrs custom-sym))
 	   (srec (assq val-sym sym-rec-alist))
-	   (label (custom-symbol-rec-label srec)))
+	   (label (custom-choice-rec-label srec)))
       label)))
 
-(define custom-symbol-desc
+(define custom-choice-desc
   (lambda (custom-sym val-sym)
     (let* ((sym-rec-alist (custom-type-attrs custom-sym))
 	   (srec (assq val-sym sym-rec-alist))
-	   (desc (custom-symbol-rec-desc srec)))
+	   (desc (custom-choice-rec-desc srec)))
       desc)))
 
 ;; only accepts single strict-key-str (not or'ed, not a variable reference)
@@ -322,8 +322,8 @@
     (let* ((type (custom-type sym))
 	   (attrs (custom-type-attrs sym)))
       (cond
-       ((eq? type 'symbol)
-	(map custom-symbol-rec-sym attrs))
+       ((eq? type 'choice)
+	(map custom-choice-rec-sym attrs))
        (else
 	attrs)))))
 
@@ -359,7 +359,7 @@
 	(as-string val))
        ((eq? type 'pathname)
 	(as-string val))
-       ((eq? type 'symbol)
+       ((eq? type 'choice)
 	(string-append "'" (symbol->string val)))
        ((eq? type 'key)
 	"")))))  ;; TODO

Modified: trunk/test/test-custom.scm
===================================================================
--- trunk/test/test-custom.scm	2005-01-09 07:21:17 UTC (rev 178)
+++ trunk/test/test-custom.scm	2005-01-09 07:45:20 UTC (rev 179)
@@ -110,44 +110,44 @@
    (assert-true  (uim-bool '(pathname? "~/.uim")))
    (assert-true  (uim-bool '(pathname? "share/uim/bar.scm")))
    (assert-true  (uim-bool '(pathname? "baz.scm"))))
-  ("test custom-valid-symbol?"
-   (assert-false (uim-bool '(custom-valid-symbol?
+  ("test custom-valid-choice?"
+   (assert-false (uim-bool '(custom-valid-choice?
 			     #f
 			     '(uim-color-uim "uim" "uim native")
 			     '(uim-color-atok "ATOK like" "Similar to ATOK"))))
-   (assert-false (uim-bool '(custom-valid-symbol?
+   (assert-false (uim-bool '(custom-valid-choice?
 			     "foo"
 			     '(uim-color-uim "uim" "uim native")
 			     '(uim-color-atok "ATOK like" "Similar to ATOK"))))
-   (assert-false (uim-bool '(custom-valid-symbol?
+   (assert-false (uim-bool '(custom-valid-choice?
 			     -1
 			     '(uim-color-uim "uim" "uim native")
 			     '(uim-color-atok "ATOK like" "Similar to ATOK"))))
-   (assert-false (uim-bool '(custom-valid-symbol?
+   (assert-false (uim-bool '(custom-valid-choice?
 			     0
 			     '(uim-color-uim "uim" "uim native")
 			     '(uim-color-atok "ATOK like" "Similar to ATOK"))))
-   (assert-false (uim-bool '(custom-valid-symbol?
+   (assert-false (uim-bool '(custom-valid-choice?
 			     1
 			     '(uim-color-uim "uim" "uim native")
 			     '(uim-color-atok "ATOK like" "Similar to ATOK"))))
-   (assert-false (uim-bool '(custom-valid-symbol?
+   (assert-false (uim-bool '(custom-valid-choice?
 			     10
 			     '(uim-color-uim "uim" "uim native")
 			     '(uim-color-atok "ATOK like" "Similar to ATOK"))))
-   (assert-false (uim-bool '(custom-valid-symbol?
+   (assert-false (uim-bool '(custom-valid-choice?
 			     ()
 			     '(uim-color-uim "uim" "uim native")
 			     '(uim-color-atok "ATOK like" "Similar to ATOK"))))
-   (assert-false (uim-bool '(custom-valid-symbol?
+   (assert-false (uim-bool '(custom-valid-choice?
 			     '(1 "2" 'three)
 			     '(uim-color-uim "uim" "uim native")
 			     '(uim-color-atok "ATOK like" "Similar to ATOK"))))
-   (assert-true  (uim-bool '(custom-valid-symbol?
+   (assert-true  (uim-bool '(custom-valid-choice?
 			     'uim-color-uim
 			     '(uim-color-uim "uim" "uim native")
 			     '(uim-color-atok "ATOK like" "Similar to ATOK"))))
-   (assert-false (uim-bool '(custom-valid-symbol?
+   (assert-false (uim-bool '(custom-valid-choice?
 			     'uim-color-nonexistent
 			     '(uim-color-uim "uim" "uim native")
 			     '(uim-color-atok "ATOK like" "Similar to ATOK")))))
@@ -179,29 +179,29 @@
    (lambda ()
      (uim '(require "custom.scm"))))
 
-  ("test custom-symbol-rec-new"
+  ("test custom-choice-rec-new"
    (assert-equal (uim '(list #f "" ""))
-		 (uim '(custom-symbol-rec-new))))
+		 (uim '(custom-choice-rec-new))))
 
-  ("test custom-symbol-label"
+  ("test custom-choice-label"
    (assert-equal "uim"
-		 (uim '(custom-symbol-label 'uim-color 'uim-color-uim)))
+		 (uim '(custom-choice-label 'uim-color 'uim-color-uim)))
    (assert-equal "ATOK like"
-		 (uim '(custom-symbol-label 'uim-color 'uim-color-atok)))
+		 (uim '(custom-choice-label 'uim-color 'uim-color-atok)))
    (assert-error (lambda ()
-                   (uim '(custom-symbol-label 'uim-color
+                   (uim '(custom-choice-label 'uim-color
                                               'uim-color-nonexistent))))
    (assert-error (lambda ()
-                   (uim '(custom-symbol-label 'uim-nonexistent
+                   (uim '(custom-choice-label 'uim-nonexistent
                                               'uim-nonexistent)))))
-  ("test custom-symbol-desc"
+  ("test custom-choice-desc"
    (assert-equal "uim native"
-		 (uim '(custom-symbol-desc 'uim-color 'uim-color-uim)))
+		 (uim '(custom-choice-desc 'uim-color 'uim-color-uim)))
    (assert-equal "Similar to ATOK"
-		 (uim '(custom-symbol-desc 'uim-color 'uim-color-atok)))
-   (assert-error (lambda () (uim '(custom-symbol-desc 'uim-color
+		 (uim '(custom-choice-desc 'uim-color 'uim-color-atok)))
+   (assert-error (lambda () (uim '(custom-choice-desc 'uim-color
                                                       'uim-color-nonexistent))))
-   (assert-error (lambda () (uim '(custom-symbol-desc 'uim-nonexistent
+   (assert-error (lambda () (uim '(custom-choice-desc 'uim-nonexistent
                                                       'uim-nonexistent))))))
 
 (define-uim-test-case "testcase custom custom-group"
@@ -374,7 +374,7 @@
      (uim '(define test-custom3-trace ()))
      (uim '(define-custom 'test-custom1 'test-custom1-ddskk
 	     '(global)
-	     '(symbol
+	     '(choice
 	       (test-custom1-uim "uim" "uim native")
 	       (test-custom1-ddskk "ddskk like" "Similar to ddskk")
 	       (test-custom1-canna "canna like" "Similar to canna"))
@@ -382,7 +382,7 @@
 	     "long description will be here."))
      (uim '(define-custom 'test-custom2 'test-custom2-ddskk
 	     '(global)
-	     '(symbol
+	     '(choice
 	       (test-custom2-uim "uim" "uim native")
 	       (test-custom2-ddskk "ddskk like" "Similar to ddskk")
 	       (test-custom2-canna "canna like" "Similar to canna"))
@@ -390,7 +390,7 @@
 	     "long description will be here."))
      (uim '(define-custom 'test-custom3 'test-custom3-ddskk
 	     '(global)
-	     '(symbol
+	     '(choice
 	       (test-custom3-uim "uim" "uim native")
 	       (test-custom3-ddskk "ddskk like" "Similar to ddskk")
 	       (test-custom3-canna "canna like" "Similar to canna"))
@@ -807,7 +807,7 @@
      (uim '(define test-custom3-trace ()))
      (uim '(define-custom 'test-custom1 'test-custom1-ddskk
 	     '(global)
-	     '(symbol
+	     '(choice
 	       (test-custom1-uim "uim" "uim native")
 	       (test-custom1-ddskk "ddskk like" "Similar to ddskk")
 	       (test-custom1-canna "canna like" "Similar to canna"))
@@ -918,7 +918,7 @@
 
    (uim '(define-custom 'test-style 'test-style-ddskk
 	   '(global)
-	   '(symbol
+	   '(choice
 	     (test-style-uim "uim" "uim native")
 	     (test-style-ddskk "ddskk like" "Similar to ddskk")
 	     (test-style-canna "canna like" "Similar to canna"))
@@ -933,7 +933,7 @@
      (uim '(require "custom.scm"))
      (uim '(define-custom 'test-style 'test-style-ddskk
 	     '(global)
-	     '(symbol
+	     '(choice
 	       (test-style-uim "uim" "uim native")
 	       (test-style-ddskk "ddskk like" "Similar to ddskk")
 	       (test-style-canna "canna like" "Similar to canna"))
@@ -961,7 +961,7 @@
 	     "long description will be here."))
      (uim '(define-custom 'test-modelist 'hiragana
 	     '(test)
-	     '(symbol
+	     '(choice
 	       (hiragana "hiragana" "hiragana")
 	       (katakana "katakana" "katakana")
 	       (latin "latin" "latin")
@@ -1190,7 +1190,7 @@
 		 (uim '(custom-groups 'test-dic-file-name))))
 
   ("test custom-type"
-   (assert-equal 'symbol
+   (assert-equal 'choice
 		 (uim '(custom-type 'test-style)))
    (assert-equal 'boolean
 		 (uim '(custom-type 'test-use-candidate-window?)))



More information about the Uim-commit mailing list