Revision: 7194
Author:   deton.kih
Date:     Fri Jul  8 16:50:46 2011
Log:      * Merge r7193 from trunk.
http://code.google.com/p/uim/source/detail?r=7194

Modified:
 /branches/1.7/scm/tutcode-custom.scm
 /branches/1.7/scm/tutcode.scm

=======================================
--- /branches/1.7/scm/tutcode-custom.scm        Fri Jul  8 16:26:42 2011
+++ /branches/1.7/scm/tutcode-custom.scm        Fri Jul  8 16:50:46 2011
@@ -245,6 +245,12 @@
   (N_ "Show real keys on auto help window")
   (N_ "long description will be here."))

+(define-custom 'tutcode-bushu-help-filename ""
+  '(tutcode candwin)
+  '(pathname regular-file)
+  (N_ "bushu.help file for auto help")
+  (N_ "long description will be here."))
+
 ;; prediction/completion
 (define-custom 'tutcode-use-completion? #f
   '(tutcode tutcode-prediction)
=======================================
--- /branches/1.7/scm/tutcode.scm       Fri Jul  8 16:31:05 2011
+++ /branches/1.7/scm/tutcode.scm       Fri Jul  8 16:50:46 2011
@@ -134,7 +134,9 @@
 ;;;  - ¡Ö+¡×¸åÉÕ¤­Ê¸»ú:½Ï¸ì¥¬¥¤¥É¤ÎºÇ½ªÂǸ°¤Ç¤¢¤ë¤³¤È¤òɽ¤·¤Þ¤¹¡£
 ;;; * ¼«Æ°¥Ø¥ë¥×ɽ¼¨µ¡Ç½(ɽ·Á¼°¤Î¸õÊ䥦¥£¥ó¥É¥¦¤òήÍÑ)
 ;;;   ¸ò¤¼½ñ¤­ÊÑ´¹¤äÉô¼ó¹çÀ®ÊÑ´¹¤ÇÆþÎϤ·¤¿Ê¸»ú¤ÎÂǤÁÊý¤òɽ¼¨¤·¤Þ¤¹¡£
-;;;   Éô¼ó¹çÀ®ÊýË¡¤â¡¢´Êñ¤Ê¹çÀ®¤Ë´Ø¤·¤Æ¤Ïɽ¼¨²Äǽ¤Ç¤¹¡£
+;;;   Éô¼ó¹çÀ®ÊýË¡¤Î¥Ø¥ë¥×¤Ï¡¢bushu.help¥Õ¥¡¥¤¥ë¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ì¤Ð
+;;;   Æóʬõº÷¤·¤ÆÉ½¼¨¤·¤Þ¤¹¡£bushu.helpÆâ¤Ë¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ç¤â¡¢
+;;;   ´Êñ¤ÊÉô¼ó¹çÀ®¤Ë´Ø¤·¤Æ¤Ïɽ¼¨²Äǽ¤Ç¤¹¡£
 ;;;   Îã:¸ò¤¼½ñ¤­ÊÑ´¹¤Ç¡Öͫݵ¡×¤ò³ÎÄꤷ¤¿¾ì¹ç
 ;;;    ¨£¨¡¨¨¨¡¨¨¨¡¨¨¨¡¨¨¨¡¨¨¨¡¨¨¨¡¨¡¨¡¨¡¨¡¨¡¨¨¨¡¨¨¨¡¨¨¨¡¨¡¨¡¨¨¨¡¨¤
 ;;;    ¨¢  ¨¢  ¨¢  ¨¢  ¨¢  ¨¢  ¨¢            ¨¢  ¨¢  ¨¢      ¨¢  ¨¢
@@ -276,6 +278,7 @@
 (require "tutcode-bushudic.scm") ;Éô¼ó¹çÀ®ÊÑ´¹¼­½ñ
 (require "tutcode-kigoudic.scm") ;µ­¹æÆþÎϥ⡼¥ÉÍѤε­¹æÉ½
 (require "tutcode-dialog.scm"); ¸ò¤¼½ñ¤­ÊÑ´¹¼­½ñ¤«¤é¤Îºï½ü³Îǧ¥À¥¤¥¢¥í¥°
+(require "tutcode-bushu.scm")
 (require "japanese.scm") ; for ja-wide or ja-make-kana-str{,-list}
 (require "ustr.scm")

@@ -834,8 +837,6 @@
     (if tutcode-use-recursive-learning?
       (tutcode-context-set-editor! tc (tutcode-editor-new tc)))
     (tutcode-context-set-dialog! tc (tutcode-dialog-new tc))
-    (if tutcode-use-interactive-bushu-conversion?
-      (require "tutcode-bushu.scm"))
     (if (or tutcode-use-completion? tutcode-use-prediction?)
       (begin
         (tutcode-context-set-prediction-ctx! tc (predict-make-meta-search))
@@ -3839,6 +3840,18 @@
     (and res
       (cdr res))))

+;;; ¼«Æ°¥Ø¥ë¥×:bushu.help¥Õ¥¡¥¤¥ë¤ò¸¡º÷¤·¤ÆÂоÝʸ»ú¤Î¥Ø¥ë¥×(2¤Ä¤ÎÉô¼ó)¤ò¼èÆÀ¤¹¤ë
+;;; @param c ÂоÝʸ»ú
+;;; @return ¥Ø¥ë¥×¤Ëɽ¼¨¤¹¤ë¾ðÊó(2¤Ä¤ÎÉô¼ó¤Î¥ê¥¹¥È)¡£¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï#f
+(define (tutcode-bushu-help-lookup c)
+  (and (not (string=? tutcode-bushu-help-filename "")) ; ¥Ç¥Õ¥©¥ë¥È¤Ï""
+    (let*
+      ((looked (tutcode-bushu-search c tutcode-bushu-help-filename))
+       (lst (and looked (tutcode-bushu-parse-entry looked))))
+      (and lst
+        (>= (length lst) 2)
+        (take lst 2)))))
+
 ;;; ¼«Æ°¥Ø¥ë¥×:ÂоÝʸ»ú¤òÉô¼ó¹çÀ®¤¹¤ë¤Î¤ËɬÍפȤʤ롢
 ;;; ³°»ú¤Ç¤Ê¤¤2¤Ä¤Îʸ»ú¤Î¥ê¥¹¥È¤òÊÖ¤¹
 ;;; Îã: "·Ò" => (((("," "o"))("·â")) ((("f" "q"))("»å")))
@@ -3848,7 +3861,8 @@
 ;;;  ¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï#f
 (define (tutcode-auto-help-bushu-decompose c rule)
   (let*
-    ((bushu (tutcode-bushu-decompose c))
+    ((bushu (or (tutcode-bushu-help-lookup c)
+                (tutcode-bushu-decompose c)))
      (b1 (and bushu (car bushu)))
      (b2 (and bushu (cadr bushu)))
      (seq1 (and b1 (tutcode-auto-help-get-stroke b1 rule)))

Reply via email to