Author: yamakenz
Date: Sat Sep  8 09:27:57 2007
New Revision: 4947

Modified:
   trunk/scm/look.scm
   trunk/uim/uim-util.c
   trunk/uim/uim.c

Log:
* uim/uim-util.c
  - (file_stat_mode): Make returning #f instead of raising error. This
    is the same behavior of uim 1.4.x ([uim-ja 55])
* uim/uim.c
  - (fatal_error_hook): Change error message
* scm/look.scm
  - (look-load-personal-dict): Revert r4941 since the change of
    file_stat_mode() make it unneeded


Modified: trunk/scm/look.scm
==============================================================================
--- trunk/scm/look.scm  (original)
+++ trunk/scm/look.scm  Sat Sep  8 09:27:57 2007
@@ -233,23 +233,21 @@
       (im-update-preedit lc))))
 
 (define (look-load-personal-dict lc)
-  (guard (err
-          (else #f))
-        (if (file-readable? look-personal-dict-filename)
-            (let ((dict (call-with-input-file look-personal-dict-filename
-                          (lambda (port)
-                            (im-clear-preedit lc)
-                            (im-pushback-preedit
-                             lc preedit-reverse
-                             "[loading...]")
-                            (im-update-preedit lc)
-                            (guard (err
-                                    (else #f))
-                                   (read port))))))
-              (if (and dict
-                       (not (null? dict))
-                       (= (car dict) look-prepared-words))
-                  (look-context-set-dict! lc (cdr dict))))))
+  (if (file-readable? look-personal-dict-filename)
+      (let ((dict (call-with-input-file look-personal-dict-filename
+                   (lambda (port)
+                     (im-clear-preedit lc)
+                     (im-pushback-preedit
+                      lc preedit-reverse
+                      "[loading...]")
+                     (im-update-preedit lc)
+                     (guard (err
+                             (else #f))
+                       (read port))))))
+       (if (and dict
+                (not (null? dict))
+                (= (car dict) look-prepared-words))
+           (look-context-set-dict! lc (cdr dict)))))
   (im-clear-preedit lc)
   (im-update-preedit lc))
 

Modified: trunk/uim/uim-util.c
==============================================================================
--- trunk/uim/uim-util.c        (original)
+++ trunk/uim/uim-util.c        Sat Sep  8 09:27:57 2007
@@ -86,7 +86,7 @@
 
   err = stat(REFER_C_STR(filename), &st);
   if (err)
-    ERROR_OBJ("stat failed for file", filename);
+    return uim_scm_f();  /* intentionally returns #f instead of error */
 
   return MAKE_BOOL((st.st_mode & mode) == mode);
 }

Modified: trunk/uim/uim.c
==============================================================================
--- trunk/uim/uim.c     (original)
+++ trunk/uim/uim.c     Sat Sep  8 09:27:57 2007
@@ -80,7 +80,7 @@
 fatal_error_hook(void)
 {
   /* actual error message is already printed by the Scheme interpreter */
-  uim_fatal_error("an unrecoverable error raised from Scheme interpreter");
+  uim_fatal_error("an unhandled error raised from Scheme interpreter");
 }
 
 int

Reply via email to