Revision: 7361
Author: deton.kih
Date: Thu Nov 3 03:57:28 2011
Log: * scm/tutcode-key-custom.scm
- (tutcode-help-clipboard-sequence): New custom.
* scm/tutcode.scm
- (tutcode-stroke-help-update-alist-with-rule):
Add label for help on clipboard key sequence.
- (tutcode-help-clipboard): New function.
- (tutcode-proc-state-on):
Add check of help on clipboard key sequence.
- (tutcode-custom-set-mazegaki/bushu-start-sequence!):
Add help on clipboard key sequence.
http://code.google.com/p/uim/source/detail?r=7361
Modified:
/trunk/scm/tutcode-key-custom.scm
/trunk/scm/tutcode.scm
=======================================
--- /trunk/scm/tutcode-key-custom.scm Mon Oct 31 04:08:08 2011
+++ /trunk/scm/tutcode-key-custom.scm Thu Nov 3 03:57:28 2011
@@ -245,6 +245,12 @@
(N_ "[TUT-Code] display help for char at current position")
(N_ "long description will be here"))
+(define-custom 'tutcode-help-clipboard-sequence ""
+ '(tutcode-keys1)
+ '(string ".*")
+ (N_ "[TUT-Code] display help for string on clipboard")
+ (N_ "long description will be here"))
+
(define-custom 'tutcode-undo-sequence ""
'(tutcode-keys1)
'(string ".*")
=======================================
--- /trunk/scm/tutcode.scm Wed Nov 2 15:14:56 2011
+++ /trunk/scm/tutcode.scm Thu Nov 3 03:57:28 2011
@@ -1890,6 +1890,7 @@
((tutcode-postfix-mazegaki-inflection-9-start) "¡½9")
((tutcode-auto-help-redisplay) "¢ã")
((tutcode-help) "¡©")
+ ((tutcode-help-clipboard) "?c")
((tutcode-undo) "¢Î")
(else cand)))
(cand-hint
@@ -2031,6 +2032,17 @@
(if (positive? (length former-seq))
(tutcode-check-auto-help-window-begin pc former-seq () #t))))
+;;; ¥¯¥ê¥Ã¥×¥Ü¡¼¥ÉÆâ¤Îʸ»ú¤ÎÂǤÁÊý¤òɽ¼¨¤¹¤ë¡£
+;;; (surrounding text API¤ò»È¤Ã¤Æ¥¯¥ê¥Ã¥×¥Ü¡¼¥É¤«¤éʸ»ú¤ò¼èÆÀ)
+(define (tutcode-help-clipboard pc)
+ (and-let*
+ ((len (length tutcode-auto-help-cand-str-list))
+ (ustr (im-acquire-text pc 'clipboard 'beginning 0 len))
+ (latter (ustr-latter-seq ustr))
+ (latter-seq (and (pair? latter) (string-to-list (car latter)))))
+ (if (positive? (length latter-seq))
+ (tutcode-check-auto-help-window-begin pc latter-seq () #t))))
+
;;; ¼«Æ°¥Ø¥ë¥×¤Îɽ·Á¼°É½¼¨¤Ë»È¤¦alist¤ò¹¹¿·¤¹¤ë¡£
;;;
alist¤Ï°Ê²¼¤Î¤è¤¦¤ËÂǸ°¤ò¼¨¤¹¥é¥Ù¥ëʸ»ú¤È¡¢³ºÅö¥»¥ë¤Ëɽ¼¨¤¹¤ëʸ»úÎó¤Î¥ê¥¹¥È
;;; Îã:(("y" "2" "1") ("t" "3")) ; ("y" "y" "t")¤È¤¤¤¦¥¹¥È¥í¡¼¥¯¤òɽ¤¹¡£
@@ -2857,6 +2869,8 @@
(tutcode-undo pc))
((eq? res 'tutcode-help)
(tutcode-help pc))
+ ((eq? res 'tutcode-help-clipboard)
+ (tutcode-help-clipboard pc))
((eq? res 'tutcode-auto-help-redisplay)
(tutcode-auto-help-redisplay pc))))))))))
@@ -5352,6 +5366,8 @@
'(tutcode-auto-help-redisplay))
(make-subrule tutcode-help-sequence
'(tutcode-help))
+ (make-subrule tutcode-help-clipboard-sequence
+ '(tutcode-help-clipboard))
(make-subrule tutcode-undo-sequence
'(tutcode-undo)))))))