forked from skk-dev/ddskk
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
skk.el
5510 lines (5187 loc) · 203 KB
/
skk.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;; skk.el --- Daredevil SKK (Simple Kana to Kanji conversion program) -*- coding: iso-2022-jp -*-
;; Copyright (C) 1988-1997 Masahiko Sato <masahiko@kuis.kyoto-u.ac.jp>
;; Copyright (C) 1999-2010 SKK Development Team <skk@ring.gr.jp>
;; Author: Masahiko Sato <masahiko@kuis.kyoto-u.ac.jp>
;; Maintainer: SKK Development Team <skk@ring.gr.jp>
;; Keywords: japanese, mule, input method
;; This file is part of Daredevil SKK.
;; Daredevil SKK is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2, or
;; (at your option) any later version.
;; Daredevil SKK is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with Daredevil SKK, see the file COPYING. If not, write to
;; the Free Software Foundation Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;;; Commentary:
;; SKK-MODE is a mode for inputting Japanese to a current buffer which is
;; composed of four minor modes described below.
;;
;; +---------------+-------- skk-mode -----+--------------------+
;; | | | |
;; | | | |
;; skk-j-mode skk-latin-mode skk-jisx0208-latin-mode skk-abbrev-mode
;; ASCII JISX0208 LATIN ABBREVIATION
;; (C-j wakes up skk-j-mode) (ZEN'KAKU EIMOJI)
;;
;; skk-j-mode-map skk-jisx0208-latin-mode-map
;; skk-latin-mode-map skk-abbrev-mode-map
;;
;; skk-katakana: nil
;; HIRAKANA
;;
;; skk-katakana: t
;; KATAKANA
;;; Code:
(eval-when-compile ; shut up compiler warning.
(defvar enable-character-translation)
(defvar epoch::version)
(defvar jka-compr-compression-info-list)
(defvar message-log-max)
(defvar migemo-isearch-enable-p)
(defvar minibuffer-local-ns-map)
(defvar self-insert-after-hook)
(defvar skk-rdbms-private-jisyo-table)
(defvar this-command-char))
;; Daredevil SKK 13.1 $B$O(B APEL 10.7 $B$rMW5a$9$k!#(B
;; APEL 10.7 $B$O<g$K(B install.el $B$N5!G=$N$?$a$KMW5a$5$l$F$$$k!#(B
;; APEL 10.6 $B$O%;%-%e%j%F%#>e$N=EBg$J7g4Y$KBP1~$7$F$$$k$?$a!"I,?\$G$"$k!#(B
;; make-temp-file() $B$N7g4Y$K$D$$$F$O4X?t(B skk-save-jisyo-original() $B$N%3%a(B
;; $B%s%H$r;2>H!#(B
(eval-when-compile
(require 'cl))
;; Emacs standard library.
(require 'advice)
(require 'easymenu)
(eval-and-compile
;; SKK common.
;; skk $B$N5/F0;~!"(B*-autoloads $B$O2<5-$N#2<oN`$N$&$A$I$A$i$+$K8B$C$FB8:_$9$k!#(B
;; | make $B$G%$%s%9%H!<%k(B | MELPA $B7PM3$G%$%s%9%H!<%k(B
;; $B%U%!%$%kL>(B | skk-autoloads.el | ddskk-autoloads.el
;; provide $B@k8@(B | $B$"$j(B (SKK-MK $B$,@8@.(B) | $B$J$7(B
;;
;; $BC1$J$k(B require $B$@$H(B MELPA $BHG(B $B$G(B Required feature skk-autoloads was
;; not provided $B$H$J$C$F$7$^$&$?$a(B featurep $B$G3NG'$7$F$+$i(B [featurep $B$O(B
;; $B%U%!%$%kFb$K(B provide $B@k8@$,$J$1$l$P(B nil $B$rJV$9(B] require $B$7$F$$$k!#(B
;;
;; leim-list.el $B$H(B skk-setup.el $B$K$bC1$J$k(B require 'skk-autoloads $B$,B8:_$9$k(B
;; $B$,!"(BMELPA $B7PM3$G%$%s%9%H!<%k$7$?(B DDSKK $B$ON>(B el $B$r;HMQ$7$J$$$?$a1F6A$J$$!#(B
(when (featurep 'skk-autoloads)
(require 'skk-autoloads))
(require 'skk-vars)
(require 'skk-macs)
;; SKK version dependent.
(cond ((featurep 'xemacs)
(require 'skk-xemacs))
(t
(require 'skk-emacs)))
;; Shut up, compiler.
(autoload 'skk-jisx0213-henkan-list-filter "skk-jisx0213")
(autoload 'skk-kanagaki-initialize "skk-kanagaki")
(autoload 'skk-rdbms-count-jisyo-candidates "skk-rdbms"))
;; aliases.
(defalias 'skk-toggle-kana 'skk-toggle-characters)
;;;###autoload
(defun skk-mode (&optional arg)
"$BF|K\8lF~NO%b!<%I!#(B
$B%^%$%J!<%b!<%I$N0l<o$G!"%*%j%8%J%k$N%b!<%I$K$O1F6A$rM?$($J$$!#(B
$BIi$N0z?t$rM?$($k$H(B SKK $B%b!<%I$+$iH4$1$k!#(B
An input mode for Japanese, converting romanized phonetic strings to kanji.
A minor mode, it should not affect the use of any major mode or
orthogonal minor modes.
In the initial SKK mode, hiragana submode, the mode line indicator is
\"$B$+$J(B\". Lowercase romaji inputs are automatically converted to
hiragana where possible. The lowercase characters `q' and `l' change
submodes of SKK, and `x' is used as a prefix indicating a small kana.
`q' is used to toggle between hiragana and katakana \(mode line
indicator \"$B%+%J(B\"\) input submodes.
`l' is used to enter ASCII submode \(mode line indicator \"SKK\"\).
Uppercase `L' enters JISX0208 latin \(wide ASCII\) submode \(mode line
indicator \"$BA41Q(B\"\). `\C-j' returns to hiragana submode from either
ASCII submode.
Kanji conversion is complex, but the basic principle is that the user
signals the appropriate stem to be matched against dictionary keys by
the use of uppercase letters. Because SKK does not use grammatical
information, both the beginning and the end of the stem must be marked.
For non-inflected words \(eg, nouns\) consisting entirely of kanji, the
simplest way to invoke conversion is to enter the reading of the kanji,
the first character only in uppercase. A leading \"$B"&(B\" indicates that
kanji conversion is in progress. After entering the reading, press
space. This invokes dictionary lookup, and the hiragana reading will be
redisplayed in kanji as the first candidate. Pressing space again gives
the next candidate. Further presses of space produce further candidates,
as well as a list of the next few candidates in the minibuffer. Eg,
\"Benri\" => \"$B"&$Y$s$j(B\", and pressing space produces \"$B"'JXMx(B\" \(the
solid triangle indicates that conversion is in progress\). Backspace
steps through the candidate list in reverse.
A candidate can be accepted by pressing `\C-j', or by entering a
self-inserting character. \(Unlike other common Japanese input methods,
RET not only accepts the current candidate, but also inserts a line
break.\)
Inflected words \(verbs and adjectives\), like non-inflected words, begin
input with a capital letter. However, for these words the end of the
kanji string is signaled by capitalizing the next mora. Eg, \"TuyoI\"
=> \"$B"'6/$$(B\". If no candidate is available at that point, the inflection
point will be indicated with an asterisk \"*\", and trailing characters
will be displayed until a candidate is recognized. It will be
immediately displayed \(pressing space is not necessary\). Space and
backspace are used to step forward and backward through the list of
candidates.
For more information, see the `skk' topic in Info. \(Japanese only.\)
A tutorial is available in Japanese or English via \\[skk-tutorial].
Use a prefix argument to choose the language. The default is system-
dependent."
(interactive "P")
(setq skk-mode (cond ((null arg)
(not skk-mode))
;; - $B$O(B -1 $B$KJQ49$5$l$k!#(B
((> (prefix-numeric-value arg) 0)
t)
(t
nil)))
(if (not skk-mode)
;; exit skk-mode
(skk-mode-exit)
;; enter into skk-mode.
(unless skk-mode-invoked
;; enter `skk-mode' for the first time in this session.
(skk-mode-invoke))
;; $B0J2<$O(B skk-mode $B$KF~$k$?$S$KKh2s%3!<%k$5$l$k%3!<%I!#(B
(skk-create-file skk-jisyo
"$B6u$N(B SKK $B8D?M<-=q$r:n$j$^$7$?(B"
"I have created an empty SKK Jisyo file for you")
(when (eval-when-compile (featurep 'xemacs))
(easy-menu-add skk-menu))
(skk-require-module)
;; To terminate kana input.
(when (eval-when-compile (featurep 'xemacs))
(make-local-hook 'pre-command-hook))
(skk-add-skk-pre-command)
(when (eval-when-compile (featurep 'xemacs))
(make-local-hook 'post-command-hook))
(add-hook 'post-command-hook 'skk-after-point-move nil 'local)
(skk-search-ja-dic-maybe t)
(skk-j-mode-on)
(run-hooks 'skk-mode-hook)))
;;;###autoload
(defun skk-auto-fill-mode (&optional arg)
"$BF|K\8lF~NO%b!<%I!#<+F0@^$jJV$75!G=IU$-!#(B
$B%^%$%J!<%b!<%I$N0l<o$G!"%*%j%8%J%k$N%b!<%I$K$O1F6A$rM?$($J$$!#(B
$B@5$N0z?t$rM?$($k$H!"6/@)E*$K(B `auto-fill-mode' $B5Z$S(B SKK $B%b!<%I$KF~$k!#(B
$BIi$N0z?t$rM?$($k$H(B `auto-fill-mode' $B5Z$S(B SKK $B%b!<%I$+$iH4$1$k!#(B"
(interactive "P")
(let ((auto-fill
(cond ((null arg)
(not auto-fill-function))
((> (prefix-numeric-value arg) 0)
t))))
(auto-fill-mode (if auto-fill 1 -1))
(skk-mode arg)
(run-hooks 'skk-auto-fill-mode-hook)))
(defun skk-kill-emacs-without-saving-jisyo (&optional query)
"$B8D?M<-=q$rJ]B8$;$:$K(B Emacs $B$r=*N;$9$k!#(B"
(interactive "P")
;; format $B$r0z?t$K;}$?$;$?>l9g$O!"(Bskk-yes-or-no-p $B$r;H$&$H$+$($C$F>iD9$K$J(B
;; $B$k!#(B
(when (yes-or-no-p
(format (if skk-japanese-message-and-error
"$B8D?M<-=q$rJ]B8$;$:$K(B %s $B$r=*N;$7$^$9!#NI$$$G$9$+!)(B "
"Do you really wish to kill %s without saving Jisyo? ")
(if (featurep 'xemacs) "XEmacs" "Emacs")))
(let ((buff (skk-get-jisyo-buffer skk-jisyo 'nomsg)))
(remove-hook 'kill-emacs-hook 'skk-save-jisyo)
(when buff
(set-buffer buff)
(set-buffer-modified-p nil)
(kill-buffer buff))
(save-buffers-kill-emacs query))))
(defun skk-restart ()
"`skk-init-file' $B$N:F%m!<%I5Z$S3F<o:F@_Dj$N8e(B SKK $B%b!<%I$r5/F0$9$k!#(B
$B3F<o%f!<%6JQ?t$r$$$C$?$s=i4|2=$9$k$N$G!"(B~/.emacs.d/init.el $B$G(B SKK $B$N@_Dj$r$7$F$$$k>l9g$O(B
$B;H$&$Y$-$G$J$$!#(B
`skk-kakutei-key' $B$NJQ99$K$OBP1~$G$-$F$$$J$$!#(B"
(interactive)
(skk-save-jisyo)
(setq skk-jisyo-update-vector nil)
(when (featurep 'skk-server)
(skk-disconnect-server))
(setq skk-server-disable-completion nil)
(kill-local-variable 'skk-rule-tree)
(setq skk-rule-tree nil)
;; $B$$$C$=(B unload-feature $B$H$+$7$?$[$&$,$$$$$N$+$b$7$l$J$$!#(B
;; skk-kakutei-key $B$K4X$7$F$O(B minibuffer-local-map $B$J$I$N=hM}$b!#(B
(mapatoms (lambda (sym)
;; skk-user-directory, skk-init-file $B0J30$N(B defcustom $B$G@k8@(B
;; $B$5$l$?JQ?t$N$&$A!"(Bsaved-value $B$r;}$?$J$$$b$N$r:F=i4|2=!#(B
;; $BB>$K$b=|30$9$Y$-JQ?t$,$J$$$+MW8!F$!#(B
(when (and (string-match "^skk-" (symbol-name sym))
(not (memq sym '(skk-user-directory skk-init-file)))
(not (plist-member (symbol-plist sym) 'saved-value))
(plist-member (symbol-plist sym) 'standard-value))
(set-default sym
(eval (car (get sym 'standard-value)))))))
(dolist (feature '(skk-act skk-azik))
(when (featurep feature)
(unload-feature feature)))
(let (skk-mode-invoked)
(skk-mode 1)))
(defun skk-require-module ()
;; skk-mode $B$KF~$k$?$S$K<B9T$5$l$k(B
(when skk-use-viper
(require 'skk-viper))
(when (or skk-servers-list
skk-server-host
(getenv "SKKSERVER"))
(require 'skk-server))
(when (featurep 'skk-server)
(skk-adjust-search-prog-list-for-server-search))
(when skk-auto-okuri-process
(require 'skk-auto)
(skk-adjust-search-prog-list-for-auto-okuri))
(when skk-use-look
(require 'skk-look))
(when (featurep 'skk-jisx0201)
(setq skk-use-jisx0201-input-method t))
(when (or skk-dcomp-activate
skk-dcomp-multiple-activate)
(require 'skk-dcomp))
(when skk-sticky-key
(require 'skk-sticky))
(when skk-show-mode-show
(require 'skk-dcomp)
(require 'skk-show-mode))
(when skk-use-search-web
(require 'skk-search-web)))
(defun skk-mode-exit ()
(let ((skk-mode t)
skk-show-mode-show)
(skk-kakutei))
(skk-mode-off)
(skk-remove-skk-pre-command)
(remove-hook 'post-command-hook
'skk-after-point-move
'local)
(skk-update-modeline)
(when (eval-when-compile (featurep 'xemacs))
(delete-menu-item (list (car skk-menu))))
;;
(dolist (b `("*$B8uJd(B*" "*SKK annotation*" "*$BC14A;z(B*"
" *$B?tCMJQ49%?%$%W(B*" ,skk-list-chars-buffer-name))
(when (get-buffer b)
(kill-buffer b))))
(defun skk-mode-invoke ()
;; $B0lHV:G=i$N(B skk $B5/F0;~$N$_<B9T$5$l$k(B
(when skk-user-directory
(make-directory skk-user-directory t))
(skk-compile-init-file-maybe)
(skk-cus-setup)
(load skk-init-file t)
(skk-adjust-user-option)
(skk-setup-modeline)
(when (default-value 'skk-share-private-jisyo)
(skk-setup-shared-private-jisyo))
(when skk-keep-record
(skk-create-file skk-record-file
"SKK $B$NE}7W>pJsMQ%U%!%$%k$r:n$j$^$7$?(B"
"I have created an SKK record file for you"))
(skk-setup-auto-paren) ; necessary to call before compiling skk-rule-tree.
;; SKK $B3HD%F~NO5!G=$N@_Dj(B
(cond (skk-use-act
;; $B3HD%%m!<%^;zF~NO(B ACT
(require 'skk-act))
(skk-use-azik
;; $B3HD%%m!<%^;zF~NO(B AZIK
(require 'skk-azik))
((featurep 'skk-tutcdef)
;; TUT-code
(require 'skk-tutcode))
(skk-use-kana-keyboard
;; $B2>L>F~NO(B ($BF|K\8l5l(B JIS $B$^$?$O?F;X%7%U%H(B)
(skk-kanagaki-initialize)))
(when (eval-when-compile (featurep 'emacs))
(skk-emacs-prepare-menu))
(when (eval-when-compile (featurep 'emacs))
(skk-setup-charset-list))
(skk-setup-delete-selection-mode)
(when skk-annotation-lookup-DictionaryServices
(skk-annotation-start-python))
(setq skk-mode-invoked t))
;;; setup
(defun skk-setup-shared-private-jisyo ()
;; vector $B$ND9$5$O!"(B`skk-save-jisyo' $B$,<:GT$7$J$$A0Ds$J$i$P(B
;; skk-jisyo-save-count $B$HF1$8$G$h$$!#%(%i!<$=$NB>$G<:GT$9$k2DG=@-$r(B
;; $B9MN8$9$k$H!"$=$l$h$j>/$7D9$$J}$,LdBj$,5/$3$j$K$/$$!#(B
;; ($B0J2<$N6qBNE*$J?t;z$K$O:,5r$O$J$$(B)
(setq skk-jisyo-update-vector
(make-vector (max (* 2 skk-jisyo-save-count)
(+ 20 skk-jisyo-save-count))
nil))
(setq skk-emacs-id
(concat (system-name) ":"
(number-to-string (emacs-pid)) ":"
(mapconcat 'int-to-string (current-time) "") ":"))
(skk-create-file skk-emacs-id-file nil nil 384) ; 0600
(with-temp-buffer
(insert-file-contents skk-emacs-id-file)
(insert skk-emacs-id "\n")
(write-region 1 (point-max) skk-emacs-id-file nil 'nomsg)))
(defun skk-setup-charset-list ()
(setq skk-charset-list
(delq nil (mapcar (lambda (c)
(when (skk-charsetp c)
c))
'(ascii
japanese-jisx0208
japanese-jisx0213-1
japanese-jisx0213-2
japanese-jisx0213.2004-1
katakana-jisx0201
latin-jisx0201
japanese-jisx0212
japanese-jisx0208-1978)))))
(defun skk-setup-keymap ()
"SKK $B$N%-!<$r@_Dj$9$k!#(B"
(cond (skk-j-mode
(skk-define-j-mode-map)
(skk-setup-j-mode-map-options))
(skk-latin-mode
(skk-define-latin-mode-map)
(skk-setup-latin-mode-map-options))
(skk-jisx0208-latin-mode
(skk-define-jisx0208-latin-mode-map)
(skk-setup-jisx0208-latin-mode-map-options))
(skk-abbrev-mode
(skk-define-abbrev-mode-map)
(skk-setup-abbrev-mode-map-options)))
(skk-define-minibuffer-maps)
;;
(unless skk-rule-tree
(setq skk-rule-tree (skk-compile-rule-list skk-rom-kana-base-rule-list
skk-rom-kana-rule-list))))
(defun skk-define-menu (map)
"SKK $B$N%W%k%@%&%s%a%K%e!<$rDj5A$9$k!#(B"
(easy-menu-define skk-menu map "Menu used in SKK mode." skk-menu-items))
(defun skk-define-j-mode-map ()
"$B%-!<%^%C%W(B `skk-j-mode-map' $B$rDj5A$9$k!#(B"
(unless (keymapp skk-j-mode-map)
(setq skk-j-mode-map (make-sparse-keymap))
(skk-update-minor-mode-map-alist 'skk-j-mode skk-j-mode-map)
(skk-update-minor-mode-map-alist 'skk-jisx0201-mode skk-j-mode-map))
(unless (eq (lookup-key skk-j-mode-map "a") 'skk-insert)
(dotimes (i 95) ;from " " to "~".
(define-key skk-j-mode-map (skk-char-to-unibyte-string (+ 32 i))
'skk-insert))
(skk-define-menu skk-j-mode-map)))
(defun skk-define-latin-mode-map ()
"$B%-!<%^%C%W(B `skk-latin-mode-map' $B$rDj5A$9$k!#(B"
(unless (keymapp skk-latin-mode-map)
(setq skk-latin-mode-map (make-sparse-keymap))
(skk-update-minor-mode-map-alist 'skk-latin-mode skk-latin-mode-map)
(skk-define-menu skk-latin-mode-map)))
(defun skk-define-jisx0208-latin-mode-map ()
"$B%-!<%^%C%W(B `skk-jisx0208-latin-mode-map' $B$rDj5A$9$k!#(B"
(unless (keymapp skk-jisx0208-latin-mode-map)
(setq skk-jisx0208-latin-mode-map (make-sparse-keymap))
(skk-update-minor-mode-map-alist 'skk-jisx0208-latin-mode
skk-jisx0208-latin-mode-map))
(unless (eq (lookup-key skk-jisx0208-latin-mode-map "a")
'skk-jisx0208-latin-insert)
(dotimes (i 128)
(when (aref skk-jisx0208-latin-vector i)
(define-key skk-jisx0208-latin-mode-map
(skk-char-to-unibyte-string i)
'skk-jisx0208-latin-insert)))
(define-key skk-jisx0208-latin-mode-map "\C-q" 'skk-toggle-characters)
(skk-define-menu skk-jisx0208-latin-mode-map)))
(defun skk-define-abbrev-mode-map ()
"$B%-!<%^%C%W(B `skk-abbrev-mode-map' $B$rDj5A$9$k!#(B"
(unless (keymapp skk-abbrev-mode-map)
(setq skk-abbrev-mode-map (make-sparse-keymap))
(skk-update-minor-mode-map-alist 'skk-abbrev-mode skk-abbrev-mode-map)
(dotimes (i 95)
(define-key skk-abbrev-mode-map (skk-char-to-unibyte-string (+ 32 i))
'skk-abbrev-insert))
(define-key skk-abbrev-mode-map "," 'skk-abbrev-comma)
(define-key skk-abbrev-mode-map "." 'skk-abbrev-period)
(define-key skk-abbrev-mode-map "\C-q" 'skk-toggle-characters)
(skk-define-menu skk-abbrev-mode-map)))
(defun skk-define-minibuffer-maps ()
(unless (eq (lookup-key minibuffer-local-map skk-kakutei-key) 'skk-kakutei)
(define-key minibuffer-local-map skk-kakutei-key #'skk-kakutei)
(define-key minibuffer-local-completion-map skk-kakutei-key #'skk-kakutei)
;; XEmacs doesn't have minibuffer-local-ns-map
(when (and (boundp 'minibuffer-local-ns-map)
(keymapp (symbol-value 'minibuffer-local-ns-map)))
(define-key minibuffer-local-ns-map skk-kakutei-key #'skk-kakutei))))
(skk-define-abbrev-mode-map)
(skk-define-latin-mode-map)
(skk-define-jisx0208-latin-mode-map)
(skk-define-j-mode-map)
(defun skk-setup-j-mode-map-options ()
(unless (eq (lookup-key skk-j-mode-map
(skk-char-to-unibyte-string skk-try-completion-char))
'skk-insert)
(when (vectorp skk-kakutei-key)
(define-key skk-j-mode-map skk-kakutei-key #'skk-kakutei))
(define-key skk-j-mode-map
(skk-char-to-unibyte-string skk-try-completion-char)
#'skk-insert)
;; Workaround for key translation.
(when (eval-when-compile (featurep 'emacs))
(when (eq skk-try-completion-char 9)
;; tab $B%-!<$O(B <tab> $B$NDj5A$,L5$1$l$P(B TAB $B$NDj5A$,3d$jEv$F$i$l$k!#(B
;; Org-mode $B$J$I$O(B <tab> $B$rDj5A$9$k$N$G!$(BSKK $B$NJ}$G$b(B <tab> $B$rDj5A(B
;; $B$9$kI,MW$,$"$k!#(B
(define-key skk-j-mode-map [(tab)] #'skk-comp-wrapper)))
;; comp $B$H(B dcomp $B$G$NA08uJd$XLa$kF0:n$r(B Shift TAB $B$G$b2DG=$H$9$k!#(B
(when skk-previous-completion-use-backtab
(define-key skk-j-mode-map skk-previous-completion-backtab-key
#'skk-previous-comp-maybe))
;;
(unless (featurep 'skk-kanagaki)
(dolist (key skk-previous-candidate-keys)
(define-key skk-j-mode-map key #'skk-previous-candidate)))
;;
(when skk-use-jisx0201-input-method
;; This command is autoloaded.
(define-key skk-j-mode-map "\C-q" #'skk-toggle-katakana))
(unless skk-use-viper
(define-key skk-j-mode-map
(skk-char-to-unibyte-string skk-start-henkan-with-completion-char)
#'skk-comp-start-henkan)
(define-key skk-j-mode-map
(skk-char-to-unibyte-string skk-backward-and-set-henkan-point-char)
#'skk-backward-and-set-henkan-point))
(skk-setup-delete-backward-char)
(skk-setup-undo)
;;
(when (eq skk-j-mode-function-key-usage 'conversion)
(define-key skk-j-mode-map [f1] #'skk-start-henkan-prog-1)
(define-key skk-j-mode-map [f2] #'skk-start-henkan-prog-2)
(define-key skk-j-mode-map [f3] #'skk-start-henkan-prog-3)
(define-key skk-j-mode-map [f4] #'skk-start-henkan-prog-4)
(define-key skk-j-mode-map [f5] #'skk-start-henkan-prog-5)
(define-key skk-j-mode-map [f6] #'skk-start-henkan-prog-6)
(define-key skk-j-mode-map [f7] #'skk-start-henkan-prog-7)
(define-key skk-j-mode-map [f8] #'skk-start-henkan-prog-8)
(define-key skk-j-mode-map [f9] #'skk-start-henkan-prog-9)
(define-key skk-j-mode-map [f10] #'skk-start-henkan-prog-0))))
(defun skk-setup-latin-mode-map-options ()
(unless (eq (lookup-key skk-latin-mode-map skk-kakutei-key) 'skk-kakutei)
(define-key skk-latin-mode-map skk-kakutei-key #'skk-kakutei)))
(defun skk-setup-jisx0208-latin-mode-map-options ()
(unless (eq (lookup-key skk-jisx0208-latin-mode-map skk-kakutei-key)
'skk-kakutei)
(define-key skk-jisx0208-latin-mode-map skk-kakutei-key #'skk-kakutei)
(unless skk-use-viper
(define-key skk-jisx0208-latin-mode-map
(skk-char-to-unibyte-string skk-backward-and-set-henkan-point-char)
#'skk-backward-and-set-henkan-point))))
(declare-function skk-start-henkan-with-completion "skk-comp")
(defun skk-setup-abbrev-mode-map-options ()
(unless (eq (lookup-key skk-abbrev-mode-map skk-kakutei-key) 'skk-kakutei)
(define-key skk-abbrev-mode-map skk-kakutei-key #'skk-kakutei)
(define-key skk-abbrev-mode-map
(skk-char-to-unibyte-string skk-start-henkan-char)
#'skk-start-henkan)
(define-key skk-abbrev-mode-map
(skk-char-to-unibyte-string skk-try-completion-char)
#'skk-try-completion)
(unless skk-use-viper
(define-key skk-abbrev-mode-map
(skk-char-to-unibyte-string skk-start-henkan-with-completion-char)
#'skk-start-henkan-with-completion))))
(defun skk-make-indicator-alist ()
"SKK $B%$%s%8%1!<%?7?%*%V%8%'%/%H$rMQ0U$7!"O"A[%j%9%H$K$^$H$a$k!#(B"
(cond
((eval-when-compile (featurep 'xemacs))
(skk-xemacs-prepare-modeline-properties))
(t
(skk-emacs-prepare-modeline-properties)))
;;
(let ((mode-string-list '(skk-latin-mode-string
skk-hiragana-mode-string
skk-katakana-mode-string
skk-jisx0208-latin-mode-string
skk-abbrev-mode-string
skk-jisx0201-mode-string))
mode string base)
(save-match-data
(cons
(cons 'default
(cons "" (skk-mode-string-to-indicator 'default "")))
(mapcar (lambda (symbol)
(setq mode (prin1-to-string symbol))
(string-match "skk-\\([-a-z0-9]+\\)-mode-string" mode)
(setq mode (intern (match-string-no-properties 1 mode)))
(setq string (symbol-value symbol))
;; $BK\Mh$J$i$3$N$h$&$K%f!<%6JQ?t$r2C9)$9$k$N$O$*$+$7$$$,!"(B
;; $B0\9T4|$N=hCV$H$7$F;CDjE*$K9T$J$&!#(B
(cond
((string-match "^ +" string)
;; minor-mode setting
(setq base (substring string (match-end 0))))
((string-match "^--" string)
;; mode-line left setting
(setq base (substring string (match-end 0)))
(when (string-match "::*$" base)
(setq base (substring base 0 (match-beginning 0)))))
(t
(setq base string)))
(cons mode
(cons (concat " " base)
(skk-make-indicator-alist-1 mode base))))
mode-string-list)))))
(defun skk-make-indicator-alist-1 (mode base)
;; faces.el (Emacs 24.2)
;; Make `modeline' an alias for `mode-line', for compatibility.
;; (put 'modeline 'face-alias 'mode-line)
;; * Incompatible Lisp Changes in Emacs 24.3
;; ** Some obsolete functions, variables, and faces have been removed:
;; *** `modeline'
(let* ((ml (if (skk-facep 'mode-line)
'mode-line ;GNU Emacs (2012-10-02 Remove obsolete face `modeline')
'modeline)) ;XEmacs
(string (concat "--" base
(cond ((skk-face-proportional-p ml)
":")
((memq mode '(latin abbrev))
"::")
(t
":")))))
(skk-mode-string-to-indicator mode string)))
(defun skk-setup-modeline ()
"$B%b!<%I%i%$%s$X$N%9%F!<%?%9I=<($r=`Hw$9$k!#(B"
(setq skk-indicator-alist (skk-make-indicator-alist))
(case skk-status-indicator
(left
(unless (and mode-line-format
(memq 'skk-modeline-input-mode (default-value 'mode-line-format)))
(setq-default mode-line-format
(append '("" skk-modeline-input-mode)
(default-value 'mode-line-format))))
(skk-loop-for-buffers (buffer-list)
(when (and (consp mode-line-format)
(skk-local-variable-p 'mode-line-format)
(null (memq 'skk-modeline-input-mode mode-line-format)))
(setq mode-line-format
(append '("" skk-modeline-input-mode) mode-line-format))))
(when skk-icon
(unless (memq 'skk-icon (default-value 'mode-line-format))
(setq-default mode-line-format
(append '("" skk-icon)
(default-value 'mode-line-format))))
(skk-loop-for-buffers (buffer-list)
(when (and (consp mode-line-format)
(skk-local-variable-p 'mode-line-format)
(null (memq 'skk-icon mode-line-format)))
(setq mode-line-format (append '("" skk-icon) mode-line-format)))))
(force-mode-line-update t))
;;
(t
(when (and (consp mode-line-format)
(equal (car mode-line-format) "")
(eq 'skk-modeline-input-mode (nth 1 mode-line-format)))
;; for skk-restart.
(setq-default mode-line-format
(nthcdr 2 mode-line-format)))
(skk-loop-for-buffers (buffer-list)
(when (and (consp mode-line-format)
(equal (car mode-line-format) "")
(eq 'skk-modeline-input-mode (nth 1 mode-line-format)))
;; for skk-restart.
(setq mode-line-format (nthcdr 2 mode-line-format))))
(setq-default skk-modeline-input-mode "")
(add-minor-mode 'skk-mode 'skk-modeline-input-mode))))
(defun skk-setup-emulation-commands (commands emulation)
(let ((map (if (and (boundp 'overriding-local-map)
(keymapp 'overriding-local-map))
overriding-local-map
(current-global-map))))
(dolist (command commands)
(dolist (key (where-is-internal command map))
(define-key skk-abbrev-mode-map key emulation)
(define-key skk-j-mode-map key emulation)))))
(defun skk-setup-delete-backward-char ()
"$B!V8eB`!W7O$N%-!<$K%3%^%s%I(B `skk-delete-backward-char' $B$r3dEv$F$k!#(B"
(skk-setup-emulation-commands
skk-delete-backward-char-commands 'skk-delete-backward-char))
(defun skk-setup-undo ()
"$B!V$d$jD>$7!W7O$N%-!<$K%3%^%s%I(B `skk-undo' $B$r3dEv$F$k!#(B"
(skk-setup-emulation-commands skk-undo-commands 'skk-undo))
(defun skk-setup-verbose-messages ()
(unless skk-henkan-on-message
(let ((list
(split-string
(apply 'format
;; fotmat#STRING
(case skk-j-mode-function-key-usage
(conversion
"\
\[F5]%s [F6]%s [F7]%s [F8]%s [F9]%s [F10]%s")
(t
"\
\[C-5 SPC]%s [C-6 SPC]%s [C-7 SPC]%s [C-8 SPC]%s [C-9 SPC]%s [C-0 SPC]%s"))
;; format#OBJECTS
(mapcar
(lambda (x)
(cdr
(assoc (caar (symbol-value
(intern-soft
(format "skk-search-prog-list-%d"
x))))
'((skk-search-tankanji . "$BC14A;z(B")
(skk-search-identity . "$BL5JQ49(B")
(skk-search-katakana . "$B%+%?%+%J(B")
(skk-search-hankaku-katakana . "$BH>3Q%+%J(B")
(skk-search-jisx0208-romaji . "$BA43Q%m!<%^(B")
(skk-search-romaji . "$B%m!<%^(B")
(nil . "$BL$Dj5A(B"))
)))
'(5 6 7 8 9 0))) " "))
new) ; END varlist
;; BODY
(dolist (x list)
(let* ((y (split-string x "]"))
(s1 (car y))
(s2 (nth 1 y)))
(setq new (concat new
(propertize (concat s1 "]") 'face
'skk-verbose-kbd-face)
s2 " "))))
(setq skk-henkan-on-message new))
))
(defun skk-compile-init-file-maybe ()
"$BI,MW$J$i(B `skk-init-file' $B$r%P%$%H%3%s%Q%$%k$9$k!#(B
`skk-byte-compile-init-file' $B$,(B non-nil $B$N>l9g$G!"(B`skk-init-file' $B$r%P%$%H%3(B
$B%s%Q%$%k$7$?%U%!%$%k$,B8:_$7$J$$$+!"$=$N%P%$%H%3%s%Q%$%k:Q%U%!%$%k$h$j(B
`skk-init-file' $B$NJ}$,?7$7$$$H$-$O!"(B`skk-init-file' $B$r%P%$%H%3%s%Q%$%k$9$k!#(B
`skk-byte-compile-init-file' $B$,(B nil $B$N>l9g$G!"(B`skk-init-file' $B$r%P%$%H%3%s%Q(B
$B%$%k$7$?%U%!%$%k$h$j(B `skk-init-file' $B$NJ}$,?7$7$$$H$-$O!"$=$N%P%$%H%3%s%Q%$(B
$B%k:Q%U%!%$%k$r>C$9!#(B"
(save-match-data
(let* ((file (expand-file-name skk-init-file))
(init-file (if (file-exists-p (concat file ".el"))
(concat file ".el")
file))
(elc (concat init-file
(if (string-match "\\.el$" init-file)
"c"
".elc"))))
(if skk-byte-compile-init-file
(when (and (file-exists-p init-file)
(or (not (file-exists-p elc))
(file-newer-than-file-p init-file elc)))
(save-window-excursion ; for keep window configuration.
(skk-message "%s $B$r%P%$%H%3%s%Q%$%k$7$^$9(B"
"Byte-compile %s"
skk-init-file)
(sit-for 2)
(byte-compile-file init-file)))
(when (and (file-exists-p init-file)
(file-exists-p elc)
(file-newer-than-file-p init-file elc))
(delete-file elc))))))
(defun skk-delete-selection-wrapper ()
(unless (and (member (char-to-string (skk-last-command-char))
(mapcar (lambda (x) (car x)) skk-auto-paren-string-alist))
skk-use-auto-enclose-pair-of-region)
(delete-region (point) (mark))
(if (and overwrite-mode
(eq this-command 'self-insert-command))
(let ((overwrite-mode nil))
(self-insert-command
(prefix-numeric-value current-prefix-arg))
(setq this-command 'ignore)))))
(defun skk-setup-delete-selection-mode ()
"Delete Selection $B%b!<%I$N$?$a$N@_Dj$r$9$k!#(B
Delete Selection $B%b!<%I$,(B SKK $B$r;H$C$?F|K\8lF~NO$KBP$7$F$b5!G=$9$k$h$&$K(B
$B%;%C%H%"%C%W$9$k!#(B"
(let ((property (cond ((featurep 'xemacs)
'pending-delete)
(t
'delete-selection)))
(funcs '(skk-current-kuten
skk-current-touten
skk-input-by-code-or-menu
skk-today))
(supersede-funcs '(skk-delete-backward-char)))
(unless (get 'skk-insert property)
(dolist (func funcs)
(put func property t))
(dolist (func supersede-funcs)
(put func property 'supersede))
(put 'skk-insert property 'skk-delete-selection-wrapper))))
(defun skk-setup-auto-paren ()
(when (and skk-auto-insert-paren
skk-auto-paren-string-alist)
;; skk-auto-paren-string-alist $B$NCf$+$i!"(B
;; skk-special-midashi-char-list $B$NMWAG$K4XO"$9$k$b$N$r<h$j=|$/!#(B
(dolist (s (mapcar #'char-to-string
skk-special-midashi-char-list))
(skk-remove-alist 'skk-auto-paren-string-alist s))
(when (memq t (mapcar (lambda (e)
(skk-ascii-char-p (string-to-char (car e))))
skk-auto-paren-string-alist))
(let (rulealst str)
(setq rulealst (nconc (mapcar (lambda (e)
(nth 2 e))
skk-rom-kana-rule-list)
(mapcar (lambda (e)
(nth 2 e))
skk-rom-kana-base-rule-list)))
(dolist (cell skk-auto-paren-string-alist)
(setq str (car cell))
(when (and (skk-ascii-char-p (string-to-char str))
;; $B=PNOJ8;z$,F~$C$F$$$k%;%k$rD4$Y$F!"$$$:$l$+$N(B
;; $B%-!<$K%P%$%s%I$5$l$F$$$J$$$+$I$&$+$r3NG'$9$k!#(B
(null (assoc str rulealst))
(null (rassoc str rulealst))
;; $B3d$jIU$1$h$&$H$7$F$$$k%-!<$,!"2?$+B>$N=PNOJ8;z$K(B
;; $B%P%$%s%I$5$l$F$$$J$$$+$I$&$+$r3NG'$9$k!#(B
(null (assoc str skk-rom-kana-base-rule-list))
(null (assoc str skk-rom-kana-rule-list)))
;; skk-auto-paren-string-alist $B$N3FMWAG$N(B car $B$NJ8;z$,(B
;; ascii char $B$G$"$k>l9g$O!"(Bskk-rom-kana-rule-list,
;; skk-rom-kana-base-rule-list $B$K$=$NJ8;z$r=q$-9~$`!#(B
;; $BK\Mh$O(B ascii char $B$O(B skk-rom-kana-rule-list,
;; skk-rom-kana-base-rule-list $B$K=q$/I,MW$,$J$$(B
;; --- skk-emulate-original-map$B$K$h$kF~NO$,9T$J$o$l$k(B ---
;; $B$,!"(Bskk-auto-paren-string-alist $B$K;XDj$5$l$?BP$K$J$k(B
;; $BJ8;z$NA^F~$N$?$a$K$O!"%-!<$H$J$kJ8;z$r=q$$$F$*$/I,MW$,(B
;; $B$"$k!#(B
(setq skk-rom-kana-rule-list
(cons (list str nil str)
skk-rom-kana-rule-list))))))))
(defun skk-setup-minibuffer ()
"$B%+%l%s%H%P%C%U%!$NF~NO%b!<%I$K=>$C$F%_%K%P%C%U%!$NF~NO%b!<%I$r@_Dj$9$k!#(B"
(case skk-minibuffer-origin-mode
(hiragana
(skk-j-mode-on))
(katakana
(skk-j-mode-on t))
(abbrev
(skk-abbrev-mode-on))
(latin
(skk-latin-mode-on))
(jisx0208-latin
(skk-jisx0208-latin-mode-on))))
(defun skk-setup-jisyo-buffer ()
"SKK $B$N<-=q%P%C%U%!$rMQ0U$9$k!#(B
`skk-jisyo' $B$N<-=q%P%C%U%!$G!"(B
(1)$B6u%P%C%U%!$G$"$l$P!"?7$7$/%X%C%@!<$r:n$j!"(B
(2)$B<-=q%(%s%H%j$,$"$k4{B8$N<-=q%P%C%U%!$J$i$P!"%X%C%@!<$,@5$7$$$+$I$&$+$r(B
$B%A%'%C%/$9$k!#(B"
;; skk-okuri-ari-min $B$H(B skk-okuri-nasi-min $B$N0LCV$rJQ99$7$?!#(B
;; $B"-(B $B?7$7$$(B skk-okuri-ari-min
;; ;; okuri-ari entries.
;; $B"+(B $B0JA0$N(B skk-okuri-ari-min
;;
;; $B"-(B skk-okuri-ari-max $B"-(B $B?7$7$$(B skk-okuri-nasi-min
;; ;; okuri-nasi entries.
;; $B"+(B $B0JA0$N(B skk-okuri-nasi-min
;;
;;
;; $BJQ99A0$N0LCV$G$"$l$P!"2<5-$N$h$&$J6u<-=q$N>l9g!"(B
;;
;; ;; okuri-ari entries.
;; ;; okuri-nasi entries.
;;
;; skk-okuri-ari-min $B$H(B skk-okuri-ari-max $B$N%^!<%+!<$,=E$J$C$F$7$^$$!"(B
;; skk-okuri-ari-min $B$N0LCV$KA^F~$7$?8uJd$,(B skk-okuri-ari-max $B$N%^!<%+!<(B
;; $B$r8eJ}$K2!$7$d$i$J$$!#(B
;;
;; case-fold-search $B$O!"<-=q%P%C%U%!$G$O>o$K(B nil$B!#(B
(save-match-data
(when (zerop (buffer-size))
;; $B6u%P%C%U%!$@$C$?$i!"%X%C%@!<$N$_A^F~!#(B
(insert ";; okuri-ari entries.\n" ";; okuri-nasi entries.\n"))
(goto-char (point-min))
(unless (re-search-forward "^;; okuri-ari entries.$" nil 'noerror)
(skk-error "$BAw$j$"$j%(%s%H%j$N%X%C%@!<$,$"$j$^$;$s!*(B"
"Header line for okuri-ari entries is missing!"))
;; $B8GDj%]%$%s%H$J$N$G!"(B(point) $B$G==J,!#(B
(setq skk-okuri-ari-min (point))
(unless (re-search-forward "^;; okuri-nasi entries.$" nil 'noerror)
(skk-error "$BAw$j$J$7%(%s%H%j$N%X%C%@!<$,$"$j$^$;$s!*(B"
"Header line for okuri-nasi entries is missing!"))
(beginning-of-line)
;; $B6&M-<-=q$J$i8GDj%]%$%s%H$G$bNI$$$N$@$,!"<-=q%P%C%U%!$GJT=8$r9T(B
;; $B$J$C$?$H$-$N$3$H$rG[N8$7$F%^!<%+!<$K$7$F$*$/!#(B
(setq skk-okuri-ari-max (point-marker))
(forward-line 1)
(backward-char 1)
(setq skk-okuri-nasi-min (point-marker))))
(defun skk-emulate-original-map (arg)
"$B%-!<F~NO$KBP$7$F(B Emacs $B$N%*%j%8%J%k$N%-!<3d$jIU$1$G%3%^%s%I$r<B9T$9$k!#(B"
(let ((prefix-arg arg)
(keys (skk-command-key-sequence (this-command-keys) this-command)))
(when keys ; If key is nil, the command may have been invoked by M-x.
(let (skk-mode
skk-latin-mode
skk-j-mode
skk-abbrev-mode
skk-jisx0208-latin-mode
skk-jisx0201-mode
command)
;; have to search key binding after binding 4 minor mode flags to nil.
(setq command (key-binding keys))
(unless command
(setq keys (lookup-key function-key-map keys))
(when keys
(setq command (key-binding keys))))
;; avoid recursive calling of skk-emulate-original-map.
(unless (eq command this-command)
(setq this-command command)
(unless (or (memq command skk-undo-commands)
(memq command skk-delete-backward-char-commands))
(skk-cancel-undo-boundary))
;; if no bindings are found, call `undefined'. it's
;; original behaviour.
(command-execute (or command
#'undefined)))))))
(defun skk-command-key-sequence (key command)
"KEY $B$+$i(B universal arguments $B$r<h$j=|$-!"(BCOMMAND $B$r<B9T$9$k%-!<$rJV$9!#(B
`execute-extended-command' $B$K$h$C$F%3%^%s%I$,<B9T$5$l$?>l9g$O!"(Bnil $B$rJV$9!#(B"
(while (not (or (zerop (length key))
(eq command (key-binding key))))
(setq key (vconcat (cdr (append key nil)))))
(unless (zerop (length key))
key))
(defun skk-adjust-user-option ()
"$B%f!<%6%*%W%7%g%s$NIT@09g$rD4@0$9$k!#(B"
(unless (skk-color-cursor-display-p)
(setq skk-use-color-cursor nil))
;; $BN>N)$G$-$J$$%*%W%7%g%s$rD4@0$9$k!#(B
(when skk-process-okuri-early
;; skk-process-okuri-early $B$NCM$,(B non-nil $B$G$"$k$H$-$K2<5-$NCM$,(B non-nil
;; $B$G$"$l$P@5>o$KF0$+$J$$$N$G$3$NJQ?t$NM%@h=g0L$r9b$/$7$?!#(B
(setq skk-kakutei-early nil
skk-auto-okuri-process nil
skk-henkan-okuri-strictly nil
skk-henkan-strict-okuri-precedence nil))
(unless skk-jisyo-save-count
;; $B8=:_$N<BAu$G$O!"8D?M<-=q$N%*!<%H%;!<%VL5$7$G$O8D?M<-=q$N6&M-$O$G$-$J$$(B
;; $B$3$H$K$J$C$F$$$k!#(B
(setq skk-share-private-jisyo nil)))
(defun skk-latin-mode (arg)
"SKK $B$N%b!<%I$r%"%9%-!<%b!<%I$KJQ99$9$k!#(B"
(interactive "P")
(skk-kakutei)
(skk-latin-mode-on)
nil)
(defun skk-jisx0208-latin-mode (arg)
"SKK $B$N%b!<%I$rA41Q%b!<%I$KJQ99$9$k!#(B"
(interactive "P")
(skk-kakutei)
(skk-jisx0208-latin-mode-on)
nil)
(defun skk-abbrev-mode (arg)
"ascii $BJ8;z$r%-!<$K$7$?JQ49$r9T$&$?$a$NF~NO%b!<%I!#(B"
(interactive "*P")
(case skk-henkan-mode
(active
(skk-kakutei))
(on
(skk-error "$B4{$K"&%b!<%I$KF~$C$F$$$^$9(B" "Already in $B"&(B mode")))
(let (skk-dcomp-activate)
(skk-set-henkan-point-subr))
(skk-abbrev-mode-on)
nil)
(defun skk-toggle-characters (arg)
"$B"#%b!<%I!""'%b!<%I$G!"$+$J%b!<%I$H%+%J%b!<%I$r%H%0%k$G@Z$jBX$($k!#(B
$B"&%b!<%I$G$O(B `skk-henkan-start-point' ($B"&$ND>8e(B) $B$H%+!<%=%k$N4V$NJ8;zNs$K$D$$(B
$B$F!"$R$i$,$J$H%+%?%+%J$rF~$lBX$($k!#(B"
(interactive "P")
(let ((show skk-show-mode-enable)) ;$B%A%e!<%H%j%"%k<B9TCf$N$_(B nil
(cond
((eq skk-henkan-mode 'on) ;$B"&%b!<%I(B
(let (char-type)
(skk-save-point
(goto-char skk-henkan-start-point)
(while (and (>= skk-save-point (point))
;; (not (eobp))
(or
;; "$B!<(B" $B$G$OJ8;z<oJL$,H=JL$G$-$J$$$N$G!"%]%$%s%H$r?J$a$k!#(B
(looking-at "$B!<(B")
(eq 'unknown (setq char-type (skk-what-char-type)))))
(forward-char 1)))
(skk-henkan-skk-region-by-func
(case char-type
(hiragana #'skk-katakana-region)
(katakana #'skk-hiragana-region)
(jisx0208-latin #'skk-latin-region)
(ascii #'skk-jisx0208-latin-region))
;; `skk-katakana-region' $B$N0z?t(B VCONTRACT $B$^$?$O(B
;; `skk-hiragana-region' $B$N0z?t(B VEXPAND $B$rM?$($k!#(B
(memq char-type '(hiragana katakana))))
(setq show nil))