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

yamaken@freedesktop.org yamaken@freedesktop.org
Sun Jan 9 00:24:59 PST 2005


Author: yamaken
Date: 2005-01-09 00:24:56 -0800 (Sun, 09 Jan 2005)
New Revision: 182

Modified:
   trunk/scm/custom-vars.scm
   trunk/scm/custom.scm
   trunk/test/test-custom.scm
   trunk/uim/uim-custom.c
Log:
* scm/custom.scm
  - All changes are validated by test-custom.scm
  - (custom-canonical-value-as-string): Rename to custom-value-as-literal
  - (custom-value-as-literal): Renamed from custom-canonical-value-as-string
  - (custom-canonical-definition-as-string): Rename to
    custom-definition-as-literal
  - (custom-definition-as-literal):
    * Renamed from custom-canonical-definition-as-string
    * Merge custom-as-string
  - (custom-as-string): Remove to merge into custom-definition-as-literal
* scm/custom-vars.scm
  - (custom-hook-literalize-preserved-default-im-name): Follow the renamings
* uim/uim-custom.c
  - (uim_custom_value_as_literal, uim_custom_definition_as_literal): Follow
    the renamings
* test/test-custom.scm
  - (test custom-canonical-value-as-string): Rename to
    custom-value-as-literal
  - (test custom-value-as-literal):
    * Renamed from custom-canonical-value-as-string
    * Follow the renaming

  - (test custom-canonical-definition-as-string): Rename to
    custom-definition-as-literal
  - (test custom-definition-as-literal):
    * Renamed from custom-canonical-definition-as-string
    * Follow the renaming
    * Merge test custom-as-string
  - (test custom-as-string): Remove to merge into custom-definition-as-literal


Modified: trunk/scm/custom-vars.scm
===================================================================
--- trunk/scm/custom-vars.scm	2005-01-09 08:01:03 UTC (rev 181)
+++ trunk/scm/custom-vars.scm	2005-01-09 08:24:56 UTC (rev 182)
@@ -175,7 +175,7 @@
 (define custom-hook-literalize-preserved-default-im-name
   (lambda ()
     (string-append
-     (custom-canonical-definition-as-string 'custom-preserved-default-im-name)
+     (custom-definition-as-literal 'custom-preserved-default-im-name)
      "\n"
      "(define default-im-name "
      (if default-im-name

Modified: trunk/scm/custom.scm
===================================================================
--- trunk/scm/custom.scm	2005-01-09 08:01:03 UTC (rev 181)
+++ trunk/scm/custom.scm	2005-01-09 08:24:56 UTC (rev 182)
@@ -338,7 +338,7 @@
     (custom-rec-desc (custom-rec sym))))
 
 ;; API
-(define custom-canonical-value-as-string
+(define custom-value-as-literal
   (lambda (sym)
     (let ((val (custom-value sym))
 	  (type (custom-type sym))
@@ -364,19 +364,15 @@
        ((eq? type 'key)
 	"")))))  ;; TODO
 
-(define custom-canonical-definition-as-string
+(define custom-definition-as-literal
   (lambda (sym)
     (let ((var (symbol->string sym))
-	  (val (custom-canonical-value-as-string sym)))
-      (string-append
-       "(define " var " " val ")"))))
-
-(define custom-as-string
-  (lambda (sym)
-    (let ((hooked (custom-call-hook-procs sym custom-literalize-hooks)))
+	  (val (custom-value-as-literal sym))
+	  (hooked (custom-call-hook-procs sym custom-literalize-hooks)))
       (if (not (null? hooked))
 	  (apply string-append hooked)
-	  (custom-canonical-definition-as-string sym)))))
+	  (string-append
+	   "(define " var " " val ")")))))
 
 ;; API
 ;; TODO: implement after uim 0.4.6 depending on scm-nested-eval

Modified: trunk/test/test-custom.scm
===================================================================
--- trunk/test/test-custom.scm	2005-01-09 08:01:03 UTC (rev 181)
+++ trunk/test/test-custom.scm	2005-01-09 08:24:56 UTC (rev 182)
@@ -29,7 +29,7 @@
 ;;; SUCH DAMAGE.
 ;;;;
 
-;; This file is tested with revision 176 of new repository
+;; This file is tested with revision 182 of new repository
 
 ;; TODO:
 ;;
@@ -1250,41 +1250,40 @@
    (assert-equal "long description will be here."
 		 (uim '(custom-desc 'test-dic-file-name))))
 
-  ("test custom-canonical-value-as-string"
+  ("test custom-value-as-literal"
    (assert-equal "'test-style-ddskk"
-		 (uim '(custom-canonical-value-as-string 'test-style)))
+		 (uim '(custom-value-as-literal 'test-style)))
    (assert-equal "#t"
-		 (uim '(custom-canonical-value-as-string 'test-use-candidate-window?)))
+		 (uim '(custom-value-as-literal 'test-use-candidate-window?)))
    (assert-equal "10"
-		 (uim '(custom-canonical-value-as-string 'test-nr-candidate-max)))
+		 (uim '(custom-value-as-literal 'test-nr-candidate-max)))
    (assert-equal "\"a string\""
-		 (uim '(custom-canonical-value-as-string 'test-string)))
+		 (uim '(custom-value-as-literal 'test-string)))
    (assert-equal "\"/usr/share/skk/SKK-JISYO.L\""
-		 (uim '(custom-canonical-value-as-string 'test-dic-file-name))))
+		 (uim '(custom-value-as-literal 'test-dic-file-name))))
 
-  ("test custom-canonical-definition-as-string"
+  ("test custom-definition-as-literal"
    (assert-equal "(define test-style 'test-style-ddskk)"
-		 (uim '(custom-canonical-definition-as-string 'test-style)))
+		 (uim '(custom-definition-as-literal 'test-style)))
    (assert-equal "(define test-use-candidate-window? #t)"
-		 (uim '(custom-canonical-definition-as-string 'test-use-candidate-window?)))
+		 (uim '(custom-definition-as-literal 'test-use-candidate-window?)))
    (assert-equal "(define test-nr-candidate-max 10)"
-		 (uim '(custom-canonical-definition-as-string 'test-nr-candidate-max)))
+		 (uim '(custom-definition-as-literal 'test-nr-candidate-max)))
    (assert-equal "(define test-string \"a string\")"
-		 (uim '(custom-canonical-definition-as-string 'test-string)))
+		 (uim '(custom-definition-as-literal 'test-string)))
    (assert-equal "(define test-dic-file-name \"/usr/share/skk/SKK-JISYO.L\")"
-		 (uim '(custom-canonical-definition-as-string 'test-dic-file-name))))
-
-  ("test custom-as-string"
+		 (uim '(custom-definition-as-literal 'test-dic-file-name)))
+   ;; hooked
    (assert-equal "(define test-style 'test-style-ddskk)"
-		 (uim '(custom-as-string 'test-style)))
+		 (uim '(custom-definition-as-literal 'test-style)))
    (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-definition-as-literal 'test-style)))
    (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)))))
+		 (uim '(custom-definition-as-literal 'test-style)))))
 
 (define-uim-test-case "testcase custom interfaces"
   (setup

Modified: trunk/uim/uim-custom.c
===================================================================
--- trunk/uim/uim-custom.c	2005-01-09 08:01:03 UTC (rev 181)
+++ trunk/uim/uim-custom.c	2005-01-09 08:24:56 UTC (rev 182)
@@ -1012,7 +1012,7 @@
 char *
 uim_custom_value_as_literal(const char *custom_sym)
 {
-  return uim_custom_get_str(custom_sym, "custom-canonical-value-as-string");
+  return uim_custom_get_str(custom_sym, "custom-value-as-literal");
 }
 
 /**
@@ -1025,7 +1025,7 @@
 char *
 uim_custom_definition_as_literal(const char *custom_sym)
 {
-  return uim_custom_get_str(custom_sym, "custom-as-string");
+  return uim_custom_get_str(custom_sym, "custom-definition-as-literal");
 }
 
 /**



More information about the Uim-commit mailing list