[uim-commit] r2947 - in trunk: scm uim

yamaken at freedesktop.org yamaken at freedesktop.org
Fri Jan 20 10:24:58 PST 2006


Author: yamaken
Date: 2006-01-20 10:24:54 -0800 (Fri, 20 Jan 2006)
New Revision: 2947

Modified:
   trunk/scm/custom.scm
   trunk/scm/im-custom.scm
   trunk/scm/skk-custom.scm
   trunk/uim/uim-custom.c
Log:
* This commit complement the rest part for bug #5666. Test
  modification and doc/COMPATIBILITY update follows

* scm/custom.scm
  - (custom-pathname?): Add check for pathname-type attr
  - (custom-pathname-type): New procedure
* scm/im-custom.scm
  - (custom eb-dic-path): Follow the change of pathname type
* scm/skk-custom.scm
  - (custom skk-dic-file-name, custom skk-personal-dic-filename,
    custom skk-uim-personal-dic-filename): Ditto
* uim/uim-custom.c
  - (uim_custom_pathname_get): Support the pathname type


Modified: trunk/scm/custom.scm
===================================================================
--- trunk/scm/custom.scm	2006-01-20 17:58:51 UTC (rev 2946)
+++ trunk/scm/custom.scm	2006-01-20 18:24:54 UTC (rev 2947)
@@ -86,8 +86,10 @@
     (string? x)))
 
 (define custom-pathname?
-  (lambda (str)
-    (string? str)))
+  (lambda (str type)
+    (and (string? str)
+	 (symbol? type)
+	 (assq type '(regular-file directory)))))
 
 (define custom-valid-choice?
   (lambda arg
@@ -117,6 +119,10 @@
 			   (custom-exist? key 'key))))
 		key-repls))))
 
+(define custom-pathname-type
+  (lambda (custom-sym)
+    (car (custom-type-attrs custom-sym))))
+
 (define custom-expand-key-references
   (lambda (key)
     (cond

Modified: trunk/scm/im-custom.scm
===================================================================
--- trunk/scm/im-custom.scm	2006-01-20 17:58:51 UTC (rev 2946)
+++ trunk/scm/im-custom.scm	2006-01-20 18:24:54 UTC (rev 2947)
@@ -422,7 +422,7 @@
 (define-custom 'eb-dic-path
   (string-append (getenv "HOME") "/dict")
   '(eb candwin)
-  '(pathname)
+  '(pathname directory)
   (_ "The directory which contains EB dictionary file")
   (_ "long description will be here."))
 

Modified: trunk/scm/skk-custom.scm
===================================================================
--- trunk/scm/skk-custom.scm	2006-01-20 17:58:51 UTC (rev 2946)
+++ trunk/scm/skk-custom.scm	2006-01-20 18:24:54 UTC (rev 2947)
@@ -341,21 +341,21 @@
 (define-custom 'skk-dic-file-name (string-append (sys-datadir)
 						 "/skk/SKK-JISYO.L")
   '(skk-dict)
-  '(pathname)
+  '(pathname regular-file)
   (_ "Dictionary file")
   (_ "long description will be here."))
 
 (define-custom 'skk-personal-dic-filename
   (string-append (getenv "HOME") "/.skk-jisyo")
   '(skk-dict)
-  '(pathname)
+  '(pathname regular-file)
   (_ "Personal dictionary file")
   (_ "long description will be here."))
 
 (define-custom 'skk-uim-personal-dic-filename
   (string-append (getenv "HOME") "/.skk-uim-jisyo")
   '(skk-dict)
-  '(pathname)
+  '(pathname regular-file)
   (_ "Personal dictionary file (dedicated to uim)")
   (_ "long description will be here."))
 

Modified: trunk/uim/uim-custom.c
===================================================================
--- trunk/uim/uim-custom.c	2006-01-20 17:58:51 UTC (rev 2946)
+++ trunk/uim/uim-custom.c	2006-01-20 18:24:54 UTC (rev 2947)
@@ -287,18 +287,21 @@
 uim_custom_pathname_get(const char *custom_sym, const char *getter_proc)
 {
   struct uim_custom_pathname *custom_pathname;
-  char *str;
+  char *str, *type_sym;
   int type;
 
   UIM_EVAL_FSTRING2(NULL, "(%s '%s)", getter_proc, custom_sym);
   return_val = uim_scm_return_value();
+  str = uim_scm_c_str(return_val);
 
-  str = uim_scm_c_str(return_val);
-  /* FIXME: retrieve custom attribute */
-  if (1)
+  UIM_EVAL_FSTRING1(NULL, "(custom-pathname-type '%s)", custom_sym);
+  return_val = uim_scm_return_value();
+  type_sym = uim_scm_c_symbol(return_val);
+  if (strcmp(type_sym, "directory") == 0)
+    type = UCustomPathnameType_Directory;
+  else
     type = UCustomPathnameType_RegularFile;
-  else
-    type = UCustomPathnameType_Directory;
+  free(type_sym);
 
   custom_pathname = uim_custom_pathname_new(str, type);
   if (!custom_pathname)



More information about the uim-commit mailing list