Revision: 4c3b3e88f9a0
Author: KIHARA Hideto <[email protected]>
Date: Fri Apr 27 21:44:54 2012
Log: Add custom tutcode-show-pending-rk? to show pending key sequences.
* scm/tutcode-custom.scm
- (tutcode-show-pending-rk?): New custom.
* scm/tutcode.scm
- (tutcode-do-update-preedit):
Show pending key sequences if tutcode-show-pending-rk? is #t.
- (tutcode-key-press-handler-internal):
Call tutcode-update-preedit if tutcode-show-pending-rk? is #t.
http://code.google.com/p/uim/source/detail?r=4c3b3e88f9a0
Modified:
/scm/tutcode-custom.scm
/scm/tutcode.scm
=======================================
--- /scm/tutcode-custom.scm Sun Apr 8 00:38:31 2012
+++ /scm/tutcode-custom.scm Fri Apr 27 21:44:54 2012
@@ -104,6 +104,12 @@
(N_ "Enable vi-cooperative mode")
(N_ "long description will be here."))
+(define-custom 'tutcode-show-pending-rk? #f
+ '(tutcode)
+ '(boolean)
+ (N_ "Show pending key sequences")
+ (N_ "long description will be here."))
+
(define-custom 'tutcode-use-dvorak? #f
'(tutcode)
'(boolean)
=======================================
--- /scm/tutcode.scm Sat Apr 14 18:11:27 2012
+++ /scm/tutcode.scm Fri Apr 27 21:44:54 2012
@@ -343,8 +343,6 @@
;;; generic.scm¤ò¥Ù¡¼¥¹¤Ë¤·¤Æ°Ê²¼¤ÎÊѹ¹¤ò¤·¤Æ¤¤¤ë¡£
;;; * ¥¡¼¥·¡¼¥±¥ó¥¹Ãæ¤Î¥¹¥Ú¡¼¥¹¤¬Í¸ú¤Ë¤Ê¤ë¤è¤¦¤ËÊѹ¹¡£
;;; * ¤Ò¤é¤¬¤Ê/¥«¥¿¥«¥Ê¥â¡¼¥É¤ÎÀÚ¤êÂØ¤¨¤òÄɲá£
-;;; * rkÆþÎÏÃæ¤Î̤³ÎÄê(preedit)ʸ»úÎó¤Îɽ¼¨¤ò¤·¤Ê¤¤¤è¤¦¤Ë¤·¤¿
-;;; (Emacs¤ÎT/TUT-CodeÆþÎϴĶtc2¤Ç¤Ïɽ¼¨¤·¤Ê¤¤¤Î¤Ç¤½¤ì¤Ë¹ç¤ï¤»¤Æ)¡£
;;; * ¸ò¤¼½ñ¤ÊÑ´¹¤Ç¤ÏSKK·Á¼°¤Î¼½ñ¤ò»È¤¦¤Î¤Ç¡¢
;;; skk.scm¤Î¤«¤Ê´Á»úÊÑ´¹½èÍý¤«¤éɬÍפÊÉôʬ¤ò¼è¤ê¹þ¤ß¡£
;;; * Éô¼ó¹çÀ®ÊÑ´¹µ¡Ç½¤òÄɲá£
@@ -2674,6 +2672,9 @@
(let ((h (string-list-concat (tutcode-context-head pc))))
(if (string? h)
(im-pushback-preedit pc preedit-none h)))
+ (if tutcode-show-pending-rk?
+ (im-pushback-preedit pc preedit-underline
+ (rk-pending (tutcode-context-rk-context pc))))
(im-pushback-preedit pc preedit-cursor "")
(set! cursor-shown? #t)
(if (> (tutcode-lib-get-nr-predictions pc) 0)
@@ -2706,7 +2707,13 @@
(if (string? h)
(im-pushback-preedit pc preedit-none h)))))
(if (not cursor-shown?)
- (im-pushback-preedit pc preedit-cursor ""))))
+ (begin
+ (if (and tutcode-show-pending-rk?
+ (memq stat '(tutcode-state-on tutcode-state-yomi
+ tutcode-state-bushu)))
+ (im-pushback-preedit pc preedit-underline
+ (rk-pending (tutcode-context-rk-context pc))))
+ (im-pushback-preedit pc preedit-cursor "")))))
;;; preeditɽ¼¨¤ò¹¹¿·¤¹¤ë¡£
(define (tutcode-update-preedit pc)
@@ -5746,7 +5753,7 @@
(case (tutcode-context-state pc)
((tutcode-state-on)
(tutcode-proc-state-on pc key key-state)
- (if (or
+ (if (or tutcode-show-pending-rk?
;; ¸ò¤¼½ñ¤ÊÑ´¹¤äÉô¼ó¹çÀ®ÊÑ´¹³«»Ï¡£¢¤¤ä¢¥¤òɽ¼¨¤¹¤ë
(tutcode-state-has-preedit? c)
;; ʸ»ú¿ô»ØÄê¸åÃÖ·¿¸ò¤¼½ñ¤ÊÑ´¹¤ÎºÆµ¢³Ø½¬¥¥ã¥ó¥»¥ë
@@ -5784,7 +5791,8 @@
(tutcode-update-preedit pc))
(else
(tutcode-proc-state-off pc key key-state)
- (if (tutcode-state-has-preedit? c) ; ºÆµ¢³Ø½¬»þ
+ (if (or tutcode-show-pending-rk?
+ (tutcode-state-has-preedit? c)) ; ºÆµ¢³Ø½¬»þ
(tutcode-update-preedit pc))))
(if (or tutcode-use-stroke-help-window?
(not (eq? tutcode-stroke-help-with-kanji-combination-guide