[uim-commit] r2150 - trunk/scm
ekato at freedesktop.org
ekato at freedesktop.org
Tue Nov 15 18:11:59 PST 2005
Author: ekato
Date: 2005-11-15 18:11:54 -0800 (Tue, 15 Nov 2005)
New Revision: 2150
Modified:
trunk/scm/skk-key-custom.scm
trunk/scm/skk.scm
Log:
* scm/skk-key-custom.scm (skk-commit-with-conv-completion-key) :
New custom key setting. The default is Contol-Alt-j.
* scm/skk.scm (skk-commit-with-conv-completion) : New function.
Commit the first candidate converted from completed word. See
[Anthy-dev: 2627].
(skk-proc-state-kanji) : Fix indent. Check
skk-commit-with-conv-completion-key.
Modified: trunk/scm/skk-key-custom.scm
===================================================================
--- trunk/scm/skk-key-custom.scm 2005-11-15 23:48:44 UTC (rev 2149)
+++ trunk/scm/skk-key-custom.scm 2005-11-16 02:11:54 UTC (rev 2150)
@@ -178,6 +178,11 @@
(_ "[SKK] begin conversion with completion")
(_ "long description will be here"))
+(define-custom 'skk-commit-with-conv-completion-key '("<IgnoreCase><Control><Alt>j")
+ '(skk-keys2 skk-keys-completion)
+ '(key)
+ (_ "[SKK] commit the first candidate with completion")
+ (_ "long description will be here"))
(define-custom 'skk-special-midashi-key '("<IgnoreShift>>" "<IgnoreShift><" "<IgnoreShift>?")
'(skk-keys2)
Modified: trunk/scm/skk.scm
===================================================================
--- trunk/scm/skk.scm 2005-11-15 23:48:44 UTC (rev 2149)
+++ trunk/scm/skk.scm 2005-11-16 02:11:54 UTC (rev 2150)
@@ -1163,6 +1163,66 @@
(cadr seq)
#f))))
+(define skk-commit-with-conv-completion
+ (lambda (sc)
+ (if (and
+ skk-dcomp-activate?
+ (not (skk-rk-pending? sc))
+ (not (string=? (skk-context-dcomp-word sc) "")))
+ (if (skk-lib-get-entry
+ (skk-context-dcomp-word sc) "" "" skk-use-numeric-conversion?)
+ (begin
+ (skk-context-set-head! sc '())
+ (skk-string-list-to-context-head
+ sc
+ (string-to-list (skk-context-dcomp-word sc)))
+ (skk-context-set-nth! sc 0)
+ (skk-commit sc (skk-prepare-commit-string sc))
+ (begin
+ (skk-commit sc (skk-context-dcomp-word sc))
+ (skk-flush sc))))
+ (begin
+ (skk-append-residual-kana sc)
+ (if (not (null? (skk-context-head sc)))
+ (let ((dcomp (skk-lib-get-dcomp-word
+ (skk-make-string
+ (skk-context-head sc)
+ (skk-context-kana-mode sc)))))
+ (if (not (string=? dcomp ""))
+ (begin
+ (skk-context-set-head! sc '())
+ (skk-string-list-to-context-head
+ sc
+ (string-to-list dcomp))
+ (if (skk-lib-get-entry
+ (skk-make-string
+ (skk-context-head sc) skk-type-hiragana)
+ ""
+ ""
+ skk-use-numeric-conversion?)
+ (begin
+ (skk-context-set-nth! sc 0)
+ (skk-commit sc (skk-prepare-commit-string sc)))
+ (begin
+ (skk-commit sc dcomp)
+ (skk-flush sc))))
+ (begin
+ (if (skk-lib-get-entry
+ (skk-make-string
+ (skk-context-head sc) skk-type-hiragana)
+ ""
+ ""
+ skk-use-numeric-conversion?)
+ (begin
+ (skk-context-set-nth! sc 0)
+ (skk-commit sc (skk-prepare-commit-string sc)))
+ (begin
+ (skk-commit sc (skk-make-string
+ (skk-context-head sc)
+ (skk-context-kana-mode sc)))
+ (skk-flush sc))))))
+ (skk-flush sc))))))
+
(define skk-proc-state-kanji
(lambda (c key key-state)
(let* ((sc (skk-find-descendant-context c))
@@ -1236,9 +1296,9 @@
(not (skk-rk-pending? sc))
(not (string=? (skk-context-dcomp-word sc) "")))
(let ((sl (string-to-list (skk-context-dcomp-word sc))))
- (skk-context-set-head! sc '())
- (skk-string-list-to-context-head sc sl)
- (skk-begin-conversion sc))
+ (skk-context-set-head! sc '())
+ (skk-string-list-to-context-head sc sl)
+ (skk-begin-conversion sc))
(begin
(skk-append-residual-kana sc)
(let ((sl (string-to-list
@@ -1258,6 +1318,11 @@
(skk-flush sc)))))))
#f)
#t)
+ (if (skk-commit-with-conv-completion-key? key key-state)
+ (begin
+ (skk-commit-with-conv-completion sc)
+ #f)
+ #t)
;; Then check latin-conv status before key handling of hiragana/katakana
(if (skk-context-latin-conv sc)
(begin
More information about the uim-commit
mailing list