Hiroyuki Komatsu
komat****@users*****
2004年 12月 10日 (金) 19:52:05 JST
Index: prime/uim/prime.scm diff -u prime/uim/prime.scm:1.1.2.6 prime/uim/prime.scm:1.1.2.7 --- prime/uim/prime.scm:1.1.2.6 Thu Dec 9 18:20:51 2004 +++ prime/uim/prime.scm Fri Dec 10 19:52:04 2004 @@ -151,6 +151,38 @@ (prime-keymap-get-command (cdr keymap) key key-state)) )))) +(define prime-keymap-latin-mode + '( + (prime-on-key? . prime-command-japanese-mode) + (prime-any-key? . prime-command-latin-input) + )) + +(define prime-keymap-wide-latin-mode + '( + (prime-on-key? . prime-command-japanese-mode) + (prime-normal-key? . prime-command-wide-latin-input) + (prime-any-key? . prime-command-commit-raw) + )) + +(define prime-keymap-fund-state + '( + (prime-wide-latin-key? . prime-command-wide-latin-mode) + (prime-latin-key? . prime-command-latin-mode) + ;; Typing mode key bindings + (prime-typing-mode-hiragana-key? . prime-command-mode-hiragana) + (prime-typing-mode-katakana-key? . prime-command-mode-katakana) + (prime-typing-mode-hankana-key? . prime-command-mode-hankana) + (prime-typing-mode-wideascii-key? . prime-command-mode-wideascii) + (prime-typing-mode-ascii-key? . prime-command-mode-ascii) + + (prime-space-key? . prime-command-fund-space) + (prime-altspace-key? . prime-command-fund-altspace) + (prime-with-control-key? . prime-command-commit-raw) + (prime-ja-direct-key? . prime-command-fund-commit-ja-direct) + (prime-symbol-key? . prime-command-commit-raw) + (prime-any-key? . prime-command-fund-input) + )) + (define prime-keymap-register-fund-state '( (prime-prev-candidate-key? . prime-command-register-fund-cancel) @@ -188,38 +220,6 @@ (prime-any-key? . prime-command-fund-input) )) -(define prime-keymap-latin-mode - '( - (prime-on-key? . prime-command-japanese-mode) - (prime-any-key? . prime-command-latin-input) - )) - -(define prime-keymap-wide-latin-mode - '( - (prime-on-key? . prime-command-japanese-mode) - (prime-normal-key? . prime-command-wide-latin-input) - (prime-any-key? . prime-command-commit-raw) - )) - -(define prime-keymap-fund-state - '( - (prime-wide-latin-key? . prime-command-wide-latin-mode) - (prime-latin-key? . prime-command-latin-mode) - ;; Typing mode key bindings - (prime-typing-mode-hiragana-key? . prime-command-mode-hiragana) - (prime-typing-mode-katakana-key? . prime-command-mode-katakana) - (prime-typing-mode-hankana-key? . prime-command-mode-hankana) - (prime-typing-mode-wideascii-key? . prime-command-mode-wideascii) - (prime-typing-mode-ascii-key? . prime-command-mode-ascii) - - (prime-space-key? . prime-command-fund-space) - (prime-altspace-key? . prime-command-fund-altspace) - (prime-with-control-key? . prime-command-commit-raw) - (prime-ja-direct-key? . prime-command-fund-commit-ja-direct) - (prime-symbol-key? . prime-command-commit-raw) - (prime-any-key? . prime-command-fund-input) - )) - (define prime-keymap-preedit-state '( (prime-register-key? . prime-command-register-mode) @@ -273,31 +273,31 @@ (prime-any-key? . prime-command-preedit-input) )) -(define prime-keymap-register-conv-state +(define prime-keymap-conv-state '( - (prime-next-candidate-key? . prime-command-register-conv-next) + (prime-register-key? . prime-command-register-mode) + (prime-next-candidate-key? . prime-command-conv-next) (prime-prev-candidate-key? . prime-command-conv-prev) (prime-cancel-key? . prime-command-conv-cancel) (prime-backspace-key? . prime-command-conv-cancel) - (prime-commit-key? . prime-command-register-conv-commit) - (prime-cand-select-key? . prime-command-register-conv-select) + (prime-commit-key? . prime-command-conv-commit) + (prime-cand-select-key? . prime-command-conv-select) (prime-symbol-key? . prime-command-pass) (prime-with-control-key? . prime-command-pass) - (prime-any-key? . prime-command-register-conv-input) + (prime-any-key? . prime-command-conv-input) )) -(define prime-keymap-conv-state +(define prime-keymap-register-conv-state '( - (prime-register-key? . prime-command-register-mode) - (prime-next-candidate-key? . prime-command-conv-next) + (prime-next-candidate-key? . prime-command-register-conv-next) (prime-prev-candidate-key? . prime-command-conv-prev) (prime-cancel-key? . prime-command-conv-cancel) (prime-backspace-key? . prime-command-conv-cancel) - (prime-commit-key? . prime-command-conv-commit) - (prime-cand-select-key? . prime-command-conv-select) + (prime-commit-key? . prime-command-register-conv-commit) + (prime-cand-select-key? . prime-command-register-conv-select) (prime-symbol-key? . prime-command-pass) (prime-with-control-key? . prime-command-pass) - (prime-any-key? . prime-command-conv-input) + (prime-any-key? . prime-command-register-conv-input) )) ;;;; ------------------------------------------------------------ @@ -377,7 +377,7 @@ (define prime-context-reset-preedit-line! (lambda (context) - (prime-engine-edit-erase (prime-context-session-default context)))) + (prime-engine-edit-erase (prime-context-session context)))) ;; This returns a duplicated list of the current preedition. (define prime-context-copy-preedit-line @@ -703,10 +703,7 @@ (define prime-command-register-mode (lambda (context key key-state) - (let ((learning-word (prime-context-learning-word context))) - (if learning-word - (prime-register-mode-on context)) - ))) + (prime-register-mode-on context))) ;;;; ------------------------------------------------------------ @@ -766,7 +763,8 @@ (define prime-command-register-conv-commit (lambda (context key key-state) (print "prime-command-register-conv-commit") - (prime-commit-to-register-buffer context (prime-get-current-candidate context)) + (prime-commit-to-register-buffer context + (prime-get-current-candidate context)) )) (define prime-command-conv-select @@ -943,12 +941,12 @@ (lambda (context key key-state) (prime-register-mode-off context) - (prime-context-reset-register-line! context) - (prime-context-set-nth! context 0) (prime-context-set-state! context 'prime-state-preedit) )) +;; This registers the specified word to the PRIME dictionary and +;; reset the status to the normal fund mode. (define prime-command-register-fund-commit (lambda (context key key-state) (print "prime-command-register-fund-commit") @@ -958,7 +956,8 @@ (let ((word-data (list (list "basekey" learning-word) (list "base" registered)))) (prime-commit-word-data context word-data) - (prime-register-mode-off context)))) + (prime-register-mode-off context) + (prime-command-preedit-cancel context key key-state)))) )) (define prime-command-register-fund-cursor-left-edge @@ -985,9 +984,12 @@ (define prime-proc-call-command (lambda (keymap context key key-state) + (print "prime-proc-call-command") (let ((command (prime-keymap-get-command keymap key key-state))) (if command - (begin ((symbol-value command) context key key-state) #t) + (begin + ((symbol-value command) context key key-state) + #t) #f)))) (define prime-push-key @@ -1428,7 +1430,8 @@ (define prime-register-mode-off (lambda (context) - (prime-context-set-learning-word! context #f) + (prime-context-reset-register-line! context) + (prime-context-set-learning-word! context #f) (prime-context-set-session! context (prime-context-session-default context)) )) Index: prime/uim/ChangeLog diff -u prime/uim/ChangeLog:1.1.2.6 prime/uim/ChangeLog:1.1.2.7 --- prime/uim/ChangeLog:1.1.2.6 Thu Dec 9 18:30:21 2004 +++ prime/uim/ChangeLog Fri Dec 10 19:52:04 2004 @@ -1,3 +1,8 @@ +2004-12-10 Hiroyuki Komatsu <komat****@taiya*****> + + * prime.scm (prime-command-register-fund-commit): + Fixed a bug that the state does not change to the fund mode. + 2004-12-09 Hiroyuki Komatsu <komat****@taiya*****> * uim-prime 0.9.3-RC1: