sekka 0.8.7 → 0.8.8
Sign up to get free protection for your applications and to get access to all the features.
- data/emacs/sekka.el +104 -66
- data/lib/sekka/sekkaversion.rb +1 -1
- metadata +18 -9
data/emacs/sekka.el
CHANGED
@@ -236,27 +236,15 @@ non-nil で明示的に呼びだすまでGoogleIMEは起動しない。"
|
|
236
236
|
|
237
237
|
(defvar sekka-init nil)
|
238
238
|
|
239
|
+
|
239
240
|
;;
|
240
241
|
;; 初期化
|
241
242
|
;;
|
242
243
|
(defun sekka-init ()
|
243
|
-
;; 最初の n 件のリストを取得する
|
244
|
-
(defun sekka-take (arg-list n)
|
245
|
-
(let ((lst '()))
|
246
|
-
(dotimes (i n (reverse lst))
|
247
|
-
(let ((item (nth i arg-list)))
|
248
|
-
(when item
|
249
|
-
(push item lst))))))
|
250
|
-
|
251
244
|
(when (not sekka-init)
|
252
245
|
;; ユーザー語彙のロード + サーバーへの登録
|
253
246
|
(sekka-register-userdict-internal)
|
254
|
-
|
255
|
-
;; Emacs終了時の処理
|
256
|
-
(add-hook 'kill-emacs-hook
|
257
|
-
(lambda ()
|
258
|
-
;; 何もすることは無い
|
259
|
-
t))
|
247
|
+
|
260
248
|
;; 初期化完了
|
261
249
|
(setq sekka-init t)))
|
262
250
|
|
@@ -573,12 +561,12 @@ non-nil で明示的に呼びだすまでGoogleIMEは起動しない。"
|
|
573
561
|
;; カーソル前の文字種を返却する関数
|
574
562
|
(eval-and-compile
|
575
563
|
(if (>= emacs-major-version 20)
|
576
|
-
(
|
577
|
-
(
|
578
|
-
|
579
|
-
|
580
|
-
(defalias 'char-category nil))) ; for byte compiler
|
564
|
+
(defun sekka-char-charset (ch)
|
565
|
+
(let ((result (char-charset ch)))
|
566
|
+
(sekka-debug-print (format "sekka-char-charset:1(%s) => %s\n" ch result))
|
567
|
+
result))
|
581
568
|
(defun sekka-char-charset (ch)
|
569
|
+
(sekka-debug-print (format "sekka-char-charset:2(%s) => %s\n" ch (char-category)))
|
582
570
|
(cond ((equal (char-category ch) "a") 'ascii)
|
583
571
|
((equal (char-category ch) "k") 'katakana-jisx0201)
|
584
572
|
((string-match "[SAHK]j" (char-category ch)) 'japanese-jisx0208)
|
@@ -624,52 +612,72 @@ non-nil で明示的に呼びだすまでGoogleIMEは起動しない。"
|
|
624
612
|
word))
|
625
613
|
|
626
614
|
(defun sekka-display-function (b e select-mode)
|
627
|
-
(
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
615
|
+
(let ((insert-word (sekka-get-display-string))
|
616
|
+
(word (buffer-substring-no-properties b e)))
|
617
|
+
(cond
|
618
|
+
((and (not select-mode)
|
619
|
+
(string-equal insert-word word))
|
620
|
+
;; sekka-markersの更新
|
621
|
+
(setq sekka-fence-start (progn
|
622
|
+
(goto-char b)
|
623
|
+
(point-marker)))
|
624
|
+
(setq sekka-fence-end (progn
|
625
|
+
(goto-char e)
|
626
|
+
(point-marker)))
|
627
|
+
(setq sekka-markers
|
628
|
+
(cons sekka-fence-start sekka-fence-end))
|
629
|
+
|
630
|
+
;; 確定文字列の作成
|
631
|
+
(setq sekka-last-fix insert-word)
|
632
|
+
|
633
|
+
(sekka-debug-print (format "don't touch:[%s] point:%d-%d\n" insert-word (marker-position sekka-fence-start) (marker-position sekka-fence-end))))
|
633
634
|
|
634
|
-
|
635
|
-
|
635
|
+
(t
|
636
|
+
(setq sekka-henkan-separeter (if sekka-use-fence " " ""))
|
637
|
+
(when sekka-henkan-kouho-list
|
638
|
+
;; UNDO抑制開始
|
639
|
+
(sekka-disable-undo)
|
640
|
+
|
641
|
+
(delete-region b e)
|
636
642
|
|
637
|
-
|
643
|
+
;; リスト初期化
|
644
|
+
(setq sekka-markers '())
|
638
645
|
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
(start (point-marker))
|
645
|
-
(_cur sekka-cand-cur)
|
646
|
-
(_len sekka-cand-len)
|
647
|
-
(insert-word (sekka-get-display-string)))
|
648
|
-
(progn
|
649
|
-
(insert insert-word)
|
650
|
-
(message (format "[%s] candidate (%d/%d)" insert-word (+ _cur 1) _len))
|
651
|
-
(let* ((end (point-marker))
|
652
|
-
(ov (make-overlay start end)))
|
653
|
-
|
654
|
-
;; 確定文字列の作成
|
655
|
-
(setq sekka-last-fix insert-word)
|
656
|
-
|
657
|
-
;; 選択中の場所を装飾する。
|
658
|
-
(when select-mode
|
659
|
-
(overlay-put ov 'face 'default)
|
660
|
-
(overlay-put ov 'face 'highlight))
|
661
|
-
(setq sekka-markers (cons start end))
|
662
|
-
(sekka-debug-print (format "insert:[%s] point:%d-%d\n" insert-word (marker-position start) (marker-position end))))))
|
663
|
-
|
664
|
-
;; fenceの範囲を設定する
|
665
|
-
(when select-mode (insert "|"))
|
666
|
-
(setq sekka-fence-end (point-marker))
|
646
|
+
(setq sekka-last-fix "")
|
647
|
+
|
648
|
+
;; 変換したpointの保持
|
649
|
+
(setq sekka-fence-start (point-marker))
|
650
|
+
(when select-mode (insert "|"))
|
667
651
|
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
652
|
+
(let* (
|
653
|
+
(start (point-marker))
|
654
|
+
(_cur sekka-cand-cur)
|
655
|
+
(_len sekka-cand-len))
|
656
|
+
(progn
|
657
|
+
(insert insert-word)
|
658
|
+
(message (format "[%s] candidate (%d/%d)" insert-word (+ _cur 1) _len))
|
659
|
+
(let* ((end (point-marker))
|
660
|
+
(ov (make-overlay start end)))
|
661
|
+
|
662
|
+
;; 確定文字列の作成
|
663
|
+
(setq sekka-last-fix insert-word)
|
664
|
+
|
665
|
+
;; 選択中の場所を装飾する。
|
666
|
+
(when select-mode
|
667
|
+
(overlay-put ov 'face 'default)
|
668
|
+
(overlay-put ov 'face 'highlight))
|
669
|
+
(setq sekka-markers (cons start end))
|
670
|
+
(sekka-debug-print (format "insert:[%s] point:%d-%d\n" insert-word (marker-position start) (marker-position end))))))
|
671
|
+
|
672
|
+
;; fenceの範囲を設定する
|
673
|
+
(when select-mode (insert "|"))
|
674
|
+
(setq sekka-fence-end (point-marker))
|
675
|
+
|
676
|
+
(sekka-debug-print (format "total-point:%d-%d\n"
|
677
|
+
(marker-position sekka-fence-start)
|
678
|
+
(marker-position sekka-fence-end)))
|
679
|
+
;; UNDO再開
|
680
|
+
(sekka-enable-undo))))))
|
673
681
|
|
674
682
|
|
675
683
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
@@ -963,10 +971,15 @@ non-nil で明示的に呼びだすまでGoogleIMEは起動しない。"
|
|
963
971
|
|
964
972
|
(defun sekka-history-gc ()
|
965
973
|
;; sekka-history-stack中の無効なマークを持つエントリを削除する
|
974
|
+
(sekka-debug-print (format "sekka-history-gc before len=%d\n" (length sekka-history-stack)))
|
975
|
+
|
966
976
|
(let ((temp-list '()))
|
967
977
|
(mapcar
|
968
978
|
(lambda (alist)
|
969
979
|
(let ((markers (sekka-assoc-ref 'markers alist nil)))
|
980
|
+
(sekka-debug-print (format "markers=%S\n" markers))
|
981
|
+
(sekka-debug-print (format "marker-position car=%d\n" (marker-position (car markers))))
|
982
|
+
(sekka-debug-print (format "marker-position cdr=%d\n" (marker-position (cdr markers))))
|
970
983
|
(when (and (marker-position (car markers)) ;; 存在するバッファを指しているか
|
971
984
|
(marker-position (cdr markers)))
|
972
985
|
(if (= (marker-position (car markers))
|
@@ -979,6 +992,8 @@ non-nil で明示的に呼びだすまでGoogleIMEは起動しない。"
|
|
979
992
|
(push alist temp-list)))))
|
980
993
|
sekka-history-stack)
|
981
994
|
|
995
|
+
(sekka-debug-print (format "sekka-history-gc temp-list len=%d\n" (length temp-list)))
|
996
|
+
|
982
997
|
;; temp-list から limit 件数だけコピーする
|
983
998
|
(setq sekka-history-stack '())
|
984
999
|
(mapcar
|
@@ -986,7 +1001,8 @@ non-nil で明示的に呼びだすまでGoogleIMEは起動しない。"
|
|
986
1001
|
(when (< (length sekka-history-stack)
|
987
1002
|
sekka-history-stack-limit)
|
988
1003
|
(push alist sekka-history-stack)))
|
989
|
-
(reverse temp-list)))
|
1004
|
+
(reverse temp-list)))
|
1005
|
+
(sekka-debug-print (format "sekka-history-gc after len=%d\n" (length sekka-history-stack))))
|
990
1006
|
|
991
1007
|
|
992
1008
|
;;確定ヒストリから、指定_pointに変換済の単語が埋まっているかどうか調べる
|
@@ -1060,6 +1076,8 @@ non-nil で明示的に呼びだすまでGoogleIMEは起動しない。"
|
|
1060
1076
|
・カーソルから行頭方向にローマ字列が続く範囲でローマ字漢字変換を行う。"
|
1061
1077
|
(interactive)
|
1062
1078
|
; (print last-command) ; DEBUG
|
1079
|
+
(sekka-debug-print "sekka-rK-trans()")
|
1080
|
+
|
1063
1081
|
|
1064
1082
|
(cond
|
1065
1083
|
;; タイマーイベントを設定しない条件
|
@@ -1092,6 +1110,7 @@ non-nil で明示的に呼びだすまでGoogleIMEは起動しない。"
|
|
1092
1110
|
|
1093
1111
|
(cond
|
1094
1112
|
(sekka-select-mode
|
1113
|
+
(sekka-debug-print "<<sekka-select-mode>>\n")
|
1095
1114
|
;; 候補選択モード中に呼出されたら、keymapから再度候補選択モードに入る
|
1096
1115
|
(funcall (lookup-key sekka-select-mode-map sekka-rK-trans-key)))
|
1097
1116
|
|
@@ -1100,6 +1119,7 @@ non-nil で明示的に呼びだすまでGoogleIMEは起動しない。"
|
|
1100
1119
|
(cond
|
1101
1120
|
|
1102
1121
|
((eq (sekka-char-charset (preceding-char)) 'ascii)
|
1122
|
+
(sekka-debug-print (format "ascii? (%s) => t\n" (preceding-char)))
|
1103
1123
|
;; カーソル直前が alphabet だったら
|
1104
1124
|
(let ((end (point))
|
1105
1125
|
(gap (sekka-skip-chars-backward)))
|
@@ -1124,6 +1144,7 @@ non-nil で明示的に呼びだすまでGoogleIMEは起動しない。"
|
|
1124
1144
|
)))))
|
1125
1145
|
|
1126
1146
|
((sekka-kanji (preceding-char))
|
1147
|
+
(sekka-debug-print (format "sekka-kanji(%s) => t\n" (preceding-char)))
|
1127
1148
|
|
1128
1149
|
;; カーソル直前が 全角で漢字以外 だったら候補選択モードに移行する。
|
1129
1150
|
;; また、最後に確定した文字列と同じかどうかも確認する。
|
@@ -1136,7 +1157,11 @@ non-nil で明示的に呼びだすまでGoogleIMEは起動しない。"
|
|
1136
1157
|
(sekka-display-function
|
1137
1158
|
(marker-position (car sekka-markers))
|
1138
1159
|
(marker-position (cdr sekka-markers))
|
1139
|
-
t)))
|
1160
|
+
t)))
|
1161
|
+
|
1162
|
+
(t
|
1163
|
+
(sekka-debug-print (format "<<OTHER:non-ascii,non-kanji>> (%s)\n" (preceding-char))))))))
|
1164
|
+
|
1140
1165
|
|
1141
1166
|
|
1142
1167
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
@@ -1276,7 +1301,7 @@ sekka-modeがONの間中呼び出される可能性がある。"
|
|
1276
1301
|
(setq sekka-timer-rest (- sekka-timer-rest 1))
|
1277
1302
|
|
1278
1303
|
;; カーソルがsekka-realtime-guide-limit-lines をはみ出していないかチェック
|
1279
|
-
(sekka-debug-print (format "sekka-last-lineno [%d] : current-line" sekka-last-lineno (line-number-at-pos (point))))
|
1304
|
+
(sekka-debug-print (format "sekka-last-lineno [%d] : current-line\n" sekka-last-lineno (line-number-at-pos (point))))
|
1280
1305
|
(when (< 0 sekka-realtime-guide-limit-lines)
|
1281
1306
|
(let ((diff-lines (abs (- (line-number-at-pos (point)) sekka-last-lineno))))
|
1282
1307
|
(when (<= sekka-realtime-guide-limit-lines diff-lines)
|
@@ -1318,6 +1343,11 @@ sekka-modeがONの間中呼び出される可能性がある。"
|
|
1318
1343
|
(overlay-put sekka-guide-overlay 'face 'sekka-guide-face))))
|
1319
1344
|
|
1320
1345
|
|
1346
|
+
(defun sekka-stop-realtime-guide ()
|
1347
|
+
(when (eq this-command 'keyboard-quit)
|
1348
|
+
(setq sekka-timer-rest 0)))
|
1349
|
+
|
1350
|
+
|
1321
1351
|
;;;
|
1322
1352
|
;;; human interface
|
1323
1353
|
;;;
|
@@ -1367,6 +1397,8 @@ point から行頭方向に同種の文字列が続く間を漢字変換しま
|
|
1367
1397
|
|
1368
1398
|
;; sekka-mode を変更する共通関数
|
1369
1399
|
(defun sekka-mode-internal (arg global)
|
1400
|
+
(sekka-debug-print "sekka-mode-internal :1\n")
|
1401
|
+
|
1370
1402
|
(or (local-variable-p 'sekka-mode (current-buffer))
|
1371
1403
|
(make-local-variable 'sekka-mode))
|
1372
1404
|
(if global
|
@@ -1378,7 +1410,13 @@ point から行頭方向に同種の文字列が続く間を漢字変換しま
|
|
1378
1410
|
(> (prefix-numeric-value arg) 0))))
|
1379
1411
|
(when sekka-sticky-shift
|
1380
1412
|
(add-hook 'sekka-mode-hook 'sekka-sticky-shift-init-function))
|
1381
|
-
(when sekka-mode (run-hooks 'sekka-mode-hook))
|
1413
|
+
(when sekka-mode (run-hooks 'sekka-mode-hook))
|
1414
|
+
|
1415
|
+
(sekka-debug-print "sekka-mode-internal :2\n")
|
1416
|
+
|
1417
|
+
;; Ctrl-G押下時、リアルタイムガイドをOFFにするhook
|
1418
|
+
(add-hook 'post-command-hook 'sekka-stop-realtime-guide)
|
1419
|
+
(add-hook 'pre-command-hook 'sekka-stop-realtime-guide))
|
1382
1420
|
|
1383
1421
|
|
1384
1422
|
;; buffer local な sekka-mode を削除する関数
|
@@ -1417,7 +1455,7 @@ point から行頭方向に同種の文字列が続く間を漢字変換しま
|
|
1417
1455
|
(setq default-input-method "japanese-sekka")
|
1418
1456
|
|
1419
1457
|
(defconst sekka-version
|
1420
|
-
"0.8.
|
1458
|
+
"0.8.8" ;;SEKKA-VERSION
|
1421
1459
|
)
|
1422
1460
|
(defun sekka-version (&optional arg)
|
1423
1461
|
"入力モード変更"
|
data/lib/sekka/sekkaversion.rb
CHANGED
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sekka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 47
|
5
|
+
prerelease:
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 8
|
8
|
-
-
|
9
|
-
version: 0.8.
|
9
|
+
- 8
|
10
|
+
version: 0.8.8
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Kiyoka Nishiyama
|
@@ -14,8 +15,7 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2011-
|
18
|
-
default_executable:
|
18
|
+
date: 2011-07-30 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rubyforge
|
@@ -25,6 +25,7 @@ dependencies:
|
|
25
25
|
requirements:
|
26
26
|
- - ">="
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
+
hash: 3
|
28
29
|
segments:
|
29
30
|
- 0
|
30
31
|
version: "0"
|
@@ -38,6 +39,7 @@ dependencies:
|
|
38
39
|
requirements:
|
39
40
|
- - ">="
|
40
41
|
- !ruby/object:Gem::Version
|
42
|
+
hash: 3
|
41
43
|
segments:
|
42
44
|
- 0
|
43
45
|
version: "0"
|
@@ -51,6 +53,7 @@ dependencies:
|
|
51
53
|
requirements:
|
52
54
|
- - ">="
|
53
55
|
- !ruby/object:Gem::Version
|
56
|
+
hash: 3
|
54
57
|
segments:
|
55
58
|
- 0
|
56
59
|
version: "0"
|
@@ -64,6 +67,7 @@ dependencies:
|
|
64
67
|
requirements:
|
65
68
|
- - ">="
|
66
69
|
- !ruby/object:Gem::Version
|
70
|
+
hash: 3
|
67
71
|
segments:
|
68
72
|
- 0
|
69
73
|
version: "0"
|
@@ -77,6 +81,7 @@ dependencies:
|
|
77
81
|
requirements:
|
78
82
|
- - ">="
|
79
83
|
- !ruby/object:Gem::Version
|
84
|
+
hash: 3
|
80
85
|
segments:
|
81
86
|
- 0
|
82
87
|
version: "0"
|
@@ -90,11 +95,12 @@ dependencies:
|
|
90
95
|
requirements:
|
91
96
|
- - "="
|
92
97
|
- !ruby/object:Gem::Version
|
98
|
+
hash: 15
|
93
99
|
segments:
|
94
100
|
- 0
|
95
101
|
- 5
|
96
|
-
-
|
97
|
-
version: 0.5.
|
102
|
+
- 2
|
103
|
+
version: 0.5.2
|
98
104
|
type: :runtime
|
99
105
|
version_requirements: *id006
|
100
106
|
- !ruby/object:Gem::Dependency
|
@@ -105,6 +111,7 @@ dependencies:
|
|
105
111
|
requirements:
|
106
112
|
- - ">="
|
107
113
|
- !ruby/object:Gem::Version
|
114
|
+
hash: 3
|
108
115
|
segments:
|
109
116
|
- 0
|
110
117
|
version: "0"
|
@@ -118,6 +125,7 @@ dependencies:
|
|
118
125
|
requirements:
|
119
126
|
- - ">="
|
120
127
|
- !ruby/object:Gem::Version
|
128
|
+
hash: 3
|
121
129
|
segments:
|
122
130
|
- 0
|
123
131
|
version: "0"
|
@@ -172,7 +180,6 @@ files:
|
|
172
180
|
- test/sharp-number.nnd
|
173
181
|
- test/skk-azik-table.nnd
|
174
182
|
- test/util.nnd
|
175
|
-
has_rdoc: true
|
176
183
|
homepage: http://github.com/kiyoka/sekka
|
177
184
|
licenses: []
|
178
185
|
|
@@ -186,6 +193,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
186
193
|
requirements:
|
187
194
|
- - ">="
|
188
195
|
- !ruby/object:Gem::Version
|
196
|
+
hash: 49
|
189
197
|
segments:
|
190
198
|
- 1
|
191
199
|
- 9
|
@@ -196,13 +204,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
196
204
|
requirements:
|
197
205
|
- - ">="
|
198
206
|
- !ruby/object:Gem::Version
|
207
|
+
hash: 3
|
199
208
|
segments:
|
200
209
|
- 0
|
201
210
|
version: "0"
|
202
211
|
requirements: []
|
203
212
|
|
204
213
|
rubyforge_project:
|
205
|
-
rubygems_version: 1.
|
214
|
+
rubygems_version: 1.7.2
|
206
215
|
signing_key:
|
207
216
|
specification_version: 3
|
208
217
|
summary: Sekka is a SKK like input method.
|